ShortestPathFunction

ShortestPathFunction[type,data]

represents a function that gives the shortest path from a source vertex s to target vertex t in a graph.

Details

Examples

open allclose all

Basic Examples  (1)

Obtain a function that gives shortest paths from vertex 4:

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

Use it to show the shortest paths to all vertices:

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

Scope  (7)

See Also

FindShortestPath  GraphDistance  GraphDistanceMatrix

Introduced in 2010
(8.0)