Dijkstra's algorithm
When you have done all of these steps you can use the list to find the shortest way from the first thing to any other thing.  First write down the other thing.  Then keep doing these steps: