- What is a directed acyclic graph?
- Example: CS major course prerequisites.
- What is a topological sorting for such a graph?
- How does DFS work in a directed graph? When will we encounter back-edges in this case?
- Perform DFS, noting the order in which vertices become dead-ends.
- The reverse of that order is a topological sort (WHY?).
- Example with our course requirement graph.
- Group activity: Do this for exercise 4.2.1a.
- Record the incoming degree for each vertex (HOW?).
- Find a source vertex (incoming degree 0).
- Add it next on the ordering, and remove all edges emanating from it, adjust the numbers.
- If at any point there are no source vertices, then the graph is not acyclic.
- Example with our course requirement graph.
- Group activity: Do this for exercise 4.2.1a.