DSA Lab 7 Fall 2009, 10/14/09
This lab is about graphs, BFS and algorithms.
- For the graph shown
Petersen graph,
starting from any vertex (the end vertices of the paths will be distinct), display a DFS spanning tree (these are all examples of subgraphs of the given graph) and a BFS spanning tree. Here is a Problem which models Petersen's graph.
- The BFS procedure is already described in the above code. Modify it to
print the BFS spanning tree.
- Modify the code to make it (shortest path algorithm) work on a weighted graph (i.e., edges have weights) You can use Priority queue from STL.