#Dijkstra’s Algorithm help..

4 messages · Page 1 of 1 (latest)

fiery linden
#

Shortest path is a > c > d > e > g > z. When I go through the algorithm on paper I end up with a > c > b > d > e > g > z. This happens on iteration k = 2, when u is updated with the element of V that has the shortest distance from a (in this case b). This adds b to the path which makes it longer than the shortest path. I must be missing something here. Any help is appreciated.

dreamy streamBOT
#
  1. Ask your question and show the work you've done so far. If you've posted a screenshot of a question, specify which part you need help with.
  2. Wait patiently for a helper to come along.
  3. Once someone helps you, say thank you and close the thread with:
    +close
    
  4. Feel free to nominate the person for helper of the week in #helper-nominations
  5. Do not ping the mods, unless someone is breaking the rules.
  6. If you're happy with the help you got here, and the server overall, you can contribute financially as well:
fiery linden
#

+close