Luke L. answered 05/07/22
Experienced engineer with extensive teaching experience
Here are the rough steps of Dijkstra's Algorithm from Wikipedia (https://en.wikipedia.org/wiki/Dijkstra%27s_algorithm#Pseudocode):
I am assuming you are asking what will happen if we change the "<" on line 15 to ">". If that happens, then the if statement on line 15 is never executed, since nothing is greater than infinity. In that case, the new version does not produce the longest path from the source to every other vertex, because every vertex is set to infinity, and that'll never change. In short, changing the "<" on line 15 to ">" only makes the algorithm return nothing useful, not the longest path.
If you need more help with Dijkstra's algorithm in general, I am happy to walk through it with you! Just book a session with me and I will walk through it and explain it until you understand. Right now I am still offering heavily discounted price because I am new to this Wyzant (but not new to tutoring!). Eventually, I will raise it to my regular rate, so book soon!