OBSOLETE COMBINATORICA PACKAGE SYMBOL

# ShortestPath

As of Version 10, most of the functionality of the Combinatorica package is built into the Wolfram System. >>

ShortestPath[g,start,end]
finds a shortest path between vertices start and end in graph g.

## DetailsDetails

• ShortestPath functionality is now available in the built-in Wolfram Language function FindShortestPath.
• To use ShortestPath, you first need to load the Combinatorica Package using Needs["Combinatorica`"].
• 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 BellmanFord algorithm.
• The default is . 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.

## ExamplesExamplesopen allclose all

### Basic Examples  (2)Basic Examples  (2)

 In[1]:=
 In[2]:=
 In[3]:=
 Out[3]=
 In[4]:=
 Out[4]=

ShortestPath has been superseded by FindShortestPath:

 In[1]:=
 Out[1]=
 In[2]:=
 Out[2]=