Answers to Self-Study Questions for Graph Operations

Test Yourself #1

Question 1: The following are all of the topological numberings of the given graph:
  1. A:1 B:2 C:3 D:4 E:5
  2. A:1 B:2 D:3 C:4 E:5
  3. A:1 C:2 B:3 D:4 E:5
  4. A:1 C:2 D:3 B:4 E:5
  5. A:1 C:2 D:3 E:4 B:5
  6. A:1 D:2 B:3 C:4 E:5
  7. A:1 D:2 C:3 B:4 E:5
  8. A:1 D:2 C:3 E:4 B:5

Question 2:

Question 3: The following code determines whether graph G is connected, assuming that each node has a list of its predecessors as well as a list of its successors: