Instructions
Set the starting point of your path. This is called the "initial node." The distance to point X is called "X Distance."
Set the value to all unknown, unvisited nodes equal to a default value of infinity distance.
Assign a value to all of the adjacent nodes to the "initial node." Each value represents the distance to that node and replaces the value of infinity that was previously assigned.
Assign the node with the lowest distance value as the optimal node. Repeat the step with this node, continually searching for the shortest distance until you reach node X.