| 6 | 1 | 0 | 17 | 3 | |
| 1 | 2 | 3 | 8 | ||
| 3 | 2 | ||||
| 0 | 2 | 17 | 5 | 3 | |
| 17 | 3 | 17 | 5 | 3 | |
| 3 | 8 | 2 | 3 | 3 |
void getEdges(const Graph & g, tmatrix&adj) // pre: g is Graph with g.vertexSize() > 0 // post: adj is adjacency matrix for graph g // if there is an edge from vertex i to vertex j // in g with weight w, then adj[i][j] == w
We can use BFS to find the shortest path between nodes in an unweighted graph. How? How is Dijkstra's algorithm an improvement over your algorithm?