Question

2. Dijkstras Algorithm: Perform Dijkstras on the following graph a. You must start at a since this is a single source shortest path algorithm b. You must show the state of the priority queue before each addition to the path c. Indicate on the graph the paths (circle edges part of a path) a start

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

Dijkstra's Alogorithm is like a prims alogorithm.

Consider one node as a source node and find all the adjacent nodes of that node and find minimum distance of a node among all the adjacent nodes.

Here the source node is 'a' ,this is a starting node and intially all the values of nodes in the priority queue are empty.

The priority queue is {a,inf,inf,inf,inf,inf}

The adjacent nodes of a are c,d and e.

In these adjacent nodes node c has minimum distance.so the priority queue is {a,c} and the graph is

Node c does not have any adjacent nodes. so select minimum distance node among remaining adjacent nodes of a.So node e has minimum distance. The priority queue is {a,c,e}. The adjacent nodes of e are d.

*1

Next select node d.The priority queue is {a,c,e,d}.

The adjacent nodes of d are b.The priority queue is {a,c,e,d,b}.

The final shortest path is

Here node f is not adjacent to any node.So we dont travel to that path.

Add a comment
Know the answer?
Add Answer to:
Dijkstra's Algorithm: Perform Dijkstra's on the following graph a. You must start at a - since...
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