PRODUCTS
Mathematica
Mathematica for Students
Mathematica for the Classroom
grid
Mathematica
web
Mathematica
Mathematica Player
(free download)
Mathematica Player Pro
Wolfram
Workbench
Mathematica
Applications
PURCHASE
Online Store
Other Ways to Buy
Volume & Site Licensing
Contact Sales
Software
Service
Upgrades
Training
Books
FOR USERS
All User Resources
Product Registration
Technical Support
Customer Service
Developer Support
Does My Site Have a License?
Free Seminars
Certified Training
Custom Group Seminars
Documentation & Examples
Tutorial Screencasts
Video Gallery
Demonstrations Project
Education Portal
Student Resources
COMPANY
About Wolfram Research
News & Events
Wolfram Blog
Employment Opportunities
History of
Mathematica
Stephen Wolfram's Home Page
Contact Us
OUR SITES
Demonstrations Project
MathWorld
Integrator
Wolfram Functions Site
Wolfram Blog
Mathematica Journal
Wolfram Library Archive
Wolfram
Tones
Wolfram Science
Stephen Wolfram
DOCUMENTATION CENTER SEARCH
Graph Utilities Package
>
Graph Utilities
Package Symbol
Graph Utilities Package
Tutorials »
|
Graph Utilities Package
More About »
GraphPath
GraphPath[
g
,
start
,
end
]
finds a shortest path between vertices
start
and
end
in graph
g
.
MORE INFORMATION
To use
GraphPath
, you first need to load the
Graph Utilities Package
using
Needs
["GraphUtilities`"]
.
The following options can be used:
Method
Automatic
method to use to find the shortest path
Weighted
True
specifies whether edge weight is to be used in calculating distance
EXAMPLES
CLOSE ALL
Basic Examples
(1)
Needs["GraphUtilities`"]
This defines a small directed graph:
In[2]:=
In[3]:=
Out[3]=
This finds the shortest path from vertex 1 to vertex 3:
In[4]:=
Out[4]=
This finds the shortest path from vertex 1 to vertex 3, ignoring the edge weights:
In[5]:=
Out[5]=
Options
(1)
Properties & Relations
(1)
Possible Issues
(1)
SEE ALSO
TUTORIALS
Graph Utilities Package
MORE ABOUT
Graph Utilities Package
© 2008 Wolfram Research, Inc.