After this discussion (graph theory post) I got Grokking algorithms, and trying to implement some classics. Starting with Dijkstra.
I attach a drawing of the graph, and the python code. Like you all know and I am trying to figure out, the code is supposed to go through all the nodes and find a way to go further "cheaper".
I get the below error:
Why do I get this error? Obviously the while loop should stop when the returned node is none?
If you wonder why everything is called "1", its because there is a second graph for testing purposes but I have an error with the first one .
"If you lie to the computer, it will get you."
Favorite Granny's Wisdom Pearl