An option Algorithm that takes on the values Automatic, Dijkstra, or BellmanFord is provided. This allows a choice between using Dijkstra's algorithm and the Bellman-Ford algorithm.
The default is Algorithm->Automatic. In this case, depending on whether edges have negative weights and depending on the density of the graph, the algorithm chooses between BellmanFord and Dijkstra.