Graph Utilities Package >

GraphDistance

GraphDistance[g, i, j]
gives the distance from vertex i to vertex j in the graph g.
  • GraphDistance returns the graph distance from one vertex to another. Infinity is returned if no path exists from i to j. By default every edge is assumed to have an edge weight of 1.
  • The following option can be used:
WeightedFalsespecifies whether edge weight is to be used in calculating distance
© 2008 Wolfram Research, Inc. japanese.gif
Ask a question about this page  |  Suggest an improvement  |  Leave a message for the team