Summary: Written 7 Page 1
CS 2420 Fall 2010
Written 7 ­ 10 Points **Due at Classtime** Late assignments are NOT accepted
1. Go to csilm.usu.edu, CS3, Graph Storage. Create a graph. Note, the buttons at the bottom to create a
random graph (New Graph) and Show Storage. Look at the various methods of storing the graph
[adjacency list, adjacency matrix, edge list]. From the Show Storage window, experiment with the
operations (Successors, Predecessors, Are Adjacent) to see the number of operations required. For each
of the three methods of storage, give a situation where the method of graph storage is a superior way to
represent the graph.
2. For the graph below, trace through the algorithm of Figure 9.7 to compute a topological ordering. At
each iteration of the while loop, indicate v, the topNum (Topological order number) for v, and the
values in q.
Vertex
v Contents of queue q
topNum
Assigned to v