GraphPath

As of Version 10, all the functionality of the GraphUtilities package is built into the Wolfram System. >>

GraphPath[g,start,end]

finds a shortest path between vertices start and end in graph g.

Details

Examples

open allclose all

Basic Examples  (2)

In[1]:=
Click for copyable input

This defines a small directed graph:

In[2]:=
Click for copyable input
In[3]:=
Click for copyable input
Out[3]=

This finds the shortest path from vertex 1 to vertex 3:

In[4]:=
Click for copyable input
Out[4]=

This finds the shortest path from vertex 1 to vertex 3, ignoring the edge weights:

In[5]:=
Click for copyable input
Out[5]=

GraphPath has been superseded by FindShortestPath:

In[1]:=
Click for copyable input
Out[1]=
In[2]:=
Click for copyable input
Out[2]=
In[3]:=
Click for copyable input
Out[3]=

Options  (1)

Properties & Relations  (1)

Possible Issues  (1)

Interactive Examples  (1)

See Also

FindShortestPath  GraphDistance  GraphDistanceMatrix

Tutorials