Describe the graph and why it is consistent with the matrix.

Graphs and Trees are useful in visualizing data and the relations within and between data sets. Conversely, it is also important to be able to represent graphs as databases or arrays, so that programs for processing the data can be written.

Part I: Adjacency Matrix and Shortest Path

Construct a graph based on the adjacency matrix that appears below. Label all nodes with indices consistent with the placement of numbers within the matrix.

 

⌈0 6 0 5 0⌉
| 6 0 1 0 |
| 0 1 0 4 |
| 5 0 4 0 0 |
⌊0 3 8 0 0⌋

 

  • Describe the graph and why it is consistent with the matrix.
  • How many simple paths are there from vertex 1 to vertex 5? Explain.Which is the shortest of those paths?