Lecture 37
Learning objectives
After this class, you should be able to:
- Given a DAG, show the steps in topologically sorting the vertices using the
O(|V| + |E|)
time algorithm.- Give applications for topological sort.
- Given a graph and a source vertex, show the steps in finding unweighted shortest paths from the source to all other vertices.
- Give an application for the unweighted shortest path problem.
- Given a graph algorithm, choose a suitable data structure to represent the graph and analyze the time and space requirements.
Reading assignment
- Sections 9.2, 9.3.1.
- Lecture: Graphs.
Exercises and review questions
- Exercises and review questions on current lecture's material
- Topologically sort the DAG in figure 9.79 using the
O(|V| + |E|)
algorithm.- Ignore the weights on the edges and find the shortest paths between vertex
s
and all other vertices in figure 9.79.- Would you use an adjancency matrix or an adjaceny list to represent a graph with the better topological sort algorithm? Justify your answer based on the time and space requirements with each choice.
- Give practical applications for topologocal sort and unweighted shortest path. Post your answer on the discussion board.
- Questions on next lecture's material
- Start preparing for the final exam. Look at the finals review and post any questions that you would like answered on the discussion board.
Last modified: 6 Dec 2011