reset password
Author Message
G190852562
Posts: 162
Posted 12:33 Dec 08, 2014 |

1. Consider the following graph, List the node labels in the order they would be visited when performing depth first search starting from node 1. Assume that neighbors of a node are visited in numerically order. (Note, unless you are using the current version of the wiki page, the order will not be consistent with the code on the wiki.)

(Image: http://csns.calstatela.edu/download?fileId=4792589)

 1-2-3-4-5-6-7-8-9-10-11-12
 1-2-7-8-3-6-9-12-4-5-10-11
 1-2-3-4-6-5-7-8-9-10-12-11
 1-2-3-4-8-9-10-5-6-7-11-12
 
 I got the answer to this problem wrong. I felt that I can do a DFS on a smaller graph but not on a big one such a this. Can someone explain how to find the DFS on this graph, step-by-step?

 3. For the following graph, what's the distance between a and i by using depth-first search to find a path from a to i ? 

(the distance means how many edges on the finding path) Assume that neighbors of a node are visited in alphabetically ascending order.

(Image: http://csns.calstatela.edu/download?fileId=4792594)

 6
 7
 8
 9
 
 I definitely forgot how to do this. Are each edge counted as 1? Can someone explain step-by-step how to solve this exercise?