Unformatted text preview: i do if mark[w] = 0 then begin mark[w]=1; count=count-1 e n d if count = 1 then print(‘YES’) else print(‘NO’) 8. Sort the below graph topologically. Illustrate all major steps. A solution at the end 9. In the graph from Question 4 replace arrows by lines, i.e. translate it into a graph which is indirected. Assume ordering as in 4.b. a. Find a minimum-cost spanning tree by Prim’s algorithm. b. Find a minimum-cost spanning tree by Kruskal’s algorithm. c. Find a depth-first spanning tree starting at a. d. Find a breadth-first spanning tree starting at a. Give all steps. Solutions at the end...
View Full Document
- Spring '03
- Graph Theory, source vertex, adjacency lists, minimum-cost spanning tree, incoming arcs