Assignment 05 - Prim vs Dijkstra

Assignment 05 - Prim vs Dijkstra - 1 Show the tree(without...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
COMP 271: Design and Analysis of Algorithms Fall 2007 Assignment 5 Assigned: 11/10/07 Due Date: 4pm, 18/10/07 No late submission will be accepted as the solution will be released at 4:30pm. Question 1 : Consider running Prim’s MST algorithm and Dijkstra’s single- source shortest path algorithm on the graph shown below. For Prim’s algorithm, ignore edge orientation and start from vertex s . For Dijkstra’s algorithm, use s as the source vertex. Then the two algorithm result in exactly the same tree.
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: 1. Show the tree (without showing the process of ±nding it). 2. Modify the edge weights so that the two algorithms produce two di²erent trees. The edge weights should be distinct after modiFcation. Show the trees produced. (Hint: You can do this by changing the weight of one edge.) s a b c d 7 2 3 8 9 6 5 1 Notes : You can discuss homework question with your classmates, but you must write up your answers independently. Acknowledge the people with whom you have discussed the assignment. 1...
View Full Document

This note was uploaded on 10/18/2009 for the course COMP 271 taught by Professor Arya during the Spring '07 term at HKUST.

Ask a homework question - tutors are online