A community for students.
Here's the question you clicked on:
 0 viewing
RaphaelFilgueiras
 2 years ago
some one can explain me how Dijkstra algorithm works?
RaphaelFilgueiras
 2 years ago
some one can explain me how Dijkstra algorithm works?

This Question is Closed

lenquist
 2 years ago
Best ResponseYou've already chosen the best response.1The Djikstra algorithm finds the shortest path from one node to all the others producing a shortest path tree. 1. You start from a random node (node A in Your picture). Node A has a value of 0 because it's the starting node. 2. The path from A > B = 2 so You assign the value 2 to node B. 3. The path from A  > G = 6 so You assign the value 6 to Node G. Since node A has no more neighbor nodes (there are no more nodes directly connected to node A) You are done with it. Your next node is the node with the smallest value (which is B with a value of 2). 4. Here we have B > C = 7 so node C gets 7 + the value of B which is 2. So C = 9. B  > E = 2. So E gets the value 2 + 2 = 4. That's it for node B. The next one is E which has the smallest value (4). 5. The connections with E are E>F = 2 (F gets a 4 + 2) and E>G = 5. Now here is the important bit; G already has a value (it's 6). But since 5 < 6, we delete the value 6 and instead write the five. Thats because the path A>B>E>G = 5 is smaller than A > G = 6. So G gets a new value: 5. This process is repeated for every node. Here is a animation that could help You visualize the algorithm: http://upload.wikimedia.org/wikipedia/commons/4/45/Dijksta_Anim.gif
Ask your own question
Sign UpFind more explanations on OpenStudy
Your question is ready. Sign up for free to start getting answers.
spraguer
(Moderator)
5
→ View Detailed Profile
is replying to Can someone tell me what button the professor is hitting...
23
 Teamwork 19 Teammate
 Problem Solving 19 Hero
 Engagement 19 Mad Hatter
 You have blocked this person.
 ✔ You're a fan Checking fan status...
Thanks for being so helpful in mathematics. If you are getting quality help, make sure you spread the word about OpenStudy.