Question

a. (15 marks) i (7 marks) Consider the weighted directed graph below. Carry out the steps of Dijkstras shortest path algoritgraph G with weights w from s to t also produce Dijkstras shortest path algorithm the same shortest path Xs? If so, explain

a. (15 marks) i (7 marks) Consider the weighted directed graph below. Carry out the steps of Dijkstra's shortest path algorithm as covered in lectures, starting at vertex S. Consequently give the shortest path from S to vertex T and its length 6 A 2 3 4 S T F ii (2 marks) For a graph G = (V, E), what is the worst-case time complexity of the version of Dijkstra's shortest path algorithm examined in lectures? (Your answer should be in terms of |V| and/or |E|.) iii (6 marks) Repeat the above trace of Dijkstra's algorithm on the given graph, but where the weights are double those in the graph above. b. (6 marks) Consider an arbitrary weighted directed graph G = (V, E) with weights w : E -> R (that is, the weights are real numbers). Assume that when you run Dijkstra's shortest path algorithm on G from some vertex s E V to another vertex t E V, you get shortest path Xs-t Now, consider the same graph G = (V,E) with weights that are double the original weights (i.e. with weights u' : E -> R such that w'(e) = 2w(e) for any e € E: this is the general case of the specific instance in (a(iii)) above). Will running Dijkstra's shortest path algorithm on graph G with weights w' from s to t also produce the same shortest path X? If so, explain why (in no more than 5 lines). If not, give a counter-example. c. (6 marks) Consider an arbitrary weighted directed graph G = (V, E) with weights w : E -»R (that is, the weights are real numbers). Assume that when you run Dijkstra's shortest path algorithm on G from some vertex s E V to another vertex t E V, you get shortest path Xst Now, consider the same graph G = (V, E) with weights that are the original weights plus 2 (i.e. with weights u' : E -> R such that w'(e) = w(e) +2 for any e E E). Will running Page 11
graph G with weights w' from s to t also produce Dijkstra's shortest path algorithm the same shortest path Xs? If so, explain why (in no more than 5 lines). If not, give a counter-example. on
0 0
Add a comment Improve this question Transcribed image text
Answer #1

Question A:
part I.
Shortest path's length from S to T is 8. There two roads with sum of 8: S->A->D->T and S->F->T.
part II.  If we sue adjacenty list to represent graph than worst time for Dijskstra is O(E + VlogV). If we use matrix to represent graph than it is O(V^2 +ElogV).
part III. Distance will be length of 16. Ands there will be same roads as in first part of question.
Question B:
multiplying each node by same number will not change shortest path. Each path's length in graph will became A*B where A is the prevous length and B is the number we use to multiply edges.
Questions C:
No, roads will not be same, because adding 2 to each edge affects roads differently. For example if one road had 2 edges it will be increased by 4, while another road with 3 edges will be increased by 6. So the shortest path might not stay same,


Comment down for any queries

Please give a thumb up

Add a comment
Know the answer?
Add Answer to:
a. (15 marks) i (7 marks) Consider the weighted directed graph below. Carry out the steps...
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