Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

I Dijkstra's algorithm - Shortest Path Query

  1. Jan 8, 2017 #1

    I am just wondering what you should do in the case that you have a choice between two nodes to include for the next step, i..e both are equal to the minimal value of the set under consideration

    Do you need to follow through both cases and then see which way is the shortest, or is there a way of knowing beforehand?

    Many thanks.
  2. jcsd
  3. Jan 9, 2017 #2


    User Avatar
    Staff Emeritus
    Science Advisor
    Homework Helper
    Gold Member
    2017 Award

    You pick one of them as the current node. The other will be the current node in the next cycle.
  4. Jan 9, 2017 #3
    ahh makes sense ! thank you :)
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook

Have something to add?
Draft saved Draft deleted