Dijkstra's algorithm finds the shortest route between two given nodes on a network. This implementation of Dijkstra's algorithm uses javascript. The algorithm is quite complicated to explain briefly. The shortest route between two given nodes is found step by step, looking at all possible connections as each potential path is identified. Negative weights cannot be used, as the algorithm fails to find shortest routes in some situations with negative weights.
Dijkstra's algorithm takes a square matrix (representing a network with weighted arcs) and finds arcs which form a shortest route from the first node. The network must be connected. Negative weights cannot be used and will be converted to positive weights.
You can re-enter values and re-calculate the solution. The program doesn't work if any arcs have weight over one billion. This implementation always to starts with node A.