Question

Figure 1: Graph for Problem 1 Problem 1 Consider a depth-first search on the graph shown in Figure 1, starting with node c. C

0 0
Add a comment Improve this question Transcribed image text
Answer #1

a) Order of Nodes visited : C B D E G H F A

Starting with node C [C], node C has two neighbors node B and node F. As per the function of graph.neighbors() node B will be visited first [C-B] and then node F will be visited after visiting the neighbors of node B. After visiting B, node D [C-B-D] will be visited as it is the only neighbor of node B. D has two neighbors E and F (F will be visited after visiting E and its neighbors) [C-B-D-E-G-H-F]. Now, only node A is remaining because it is not reachable from any other node. So, it will be visited at last [C-B-D-E-G-H-F-A].

B) time .start/time finish are mentioned in the figure given below.

Explanation: same as part a)2/13 3/12 10/1 1/14 5/8 15/16 4/9

Add a comment
Know the answer?
Add Answer to:
Figure 1: Graph for Problem 1 Problem 1 Consider a depth-first search on the graph shown in Figure 1, starting with nod...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT