Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

fill in the following table in a and I will give a thumb up. 4. (40 pts.) Dijkstra's: The following questions test your knowledge of

fill in the following table in a and I will give a thumb up. image text in transcribed
4. (40 pts.) Dijkstra's: The following questions test your knowledge of Dijkstra's algorithm. The various parts are not related to each other in this question. You can use drawing/handwriting for parts (b) and (c). CMPSC 465, Spring 2023, HW 6 2 (a) (10pt) Suppose Dijkstra's algorithm runs on the following graph, starting at node A. Fill in the following table with the intermediate distance values of all the nodes at each iteration of the algorithm. The first two columns are already filled in for you. (b) (10pt) Draw a graph with no negative cycles for which Dijkstra's algorithm produces the wrong answer. Your graph must have no more than five vertices. Indicate the source where Dijkstra's algorithm will be started from. (c) (10pt) Draw a graph with at least two negative weight edge for which Dijkstra's algorithm produces the correct answer. Your graph must have no more than five vertices. Indicate the source where Dijkstra's algorithm will be started from. Label each vertex with the distance produced by Dijkstra's as well as with the correct distance. (d) (10pt) Professor Johnson suggests the following algorithm for finding the shortest path from node u to node w in a directed graph with some negative edges: add a large constant to each edge weight so that all the weights become positive, then run Dijkstra's algorithm starting at node u, and return the shortest path found to node w. You realize though that this algorithm will not always work. Give an example of a weighted directed graph for which Professor Johnson's strategy won't work. Your example should not have more than 5 vertices. You can use handwriting for this part. 4. (40 pts.) Dijkstra's: The following questions test your knowledge of Dijkstra's algorithm. The various parts are not related to each other in this question. You can use drawing/handwriting for parts (b) and (c). CMPSC 465, Spring 2023, HW 6 2 (a) (10pt) Suppose Dijkstra's algorithm runs on the following graph, starting at node A. Fill in the following table with the intermediate distance values of all the nodes at each iteration of the algorithm. The first two columns are already filled in for you. (b) (10pt) Draw a graph with no negative cycles for which Dijkstra's algorithm produces the wrong answer. Your graph must have no more than five vertices. Indicate the source where Dijkstra's algorithm will be started from. (c) (10pt) Draw a graph with at least two negative weight edge for which Dijkstra's algorithm produces the correct answer. Your graph must have no more than five vertices. Indicate the source where Dijkstra's algorithm will be started from. Label each vertex with the distance produced by Dijkstra's as well as with the correct distance. (d) (10pt) Professor Johnson suggests the following algorithm for finding the shortest path from node u to node w in a directed graph with some negative edges: add a large constant to each edge weight so that all the weights become positive, then run Dijkstra's algorithm starting at node u, and return the shortest path found to node w. You realize though that this algorithm will not always work. Give an example of a weighted directed graph for which Professor Johnson's strategy won't work. Your example should not have more than 5 vertices. You can use handwriting for this part

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Joe Celkos Data And Databases Concepts In Practice

Authors: Joe Celko

1st Edition

1558604324, 978-1558604322

More Books

Students also viewed these Databases questions

Question

Describe the utility of an ion-trap mass analyzer.

Answered: 1 week ago

Question

=+Are you interested in working on global teams?

Answered: 1 week ago

Question

=+Do you want to work from home?

Answered: 1 week ago

Question

=+ What skills and competencies will enable someone

Answered: 1 week ago