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:

Use it to show the shortest paths to all vertices:

Scope  (7)

ShortestPathFunction works with undirected graphs:

Directed graphs:

Weighted graphs:

A ShortestPathFunction can give shortest paths from a fixed vertex:

To a fixed vertex:

Between any pair of vertices:

ShortestPathFunction returns {} when no path exists:

Wolfram Research (2010), ShortestPathFunction, Wolfram Language function, https://reference.wolfram.com/language/ref/ShortestPathFunction.html.

Text

Wolfram Research (2010), ShortestPathFunction, Wolfram Language function, https://reference.wolfram.com/language/ref/ShortestPathFunction.html.

BibTeX

@misc{reference.wolfram_2021_shortestpathfunction, author="Wolfram Research", title="{ShortestPathFunction}", year="2010", howpublished="\url{https://reference.wolfram.com/language/ref/ShortestPathFunction.html}", note=[Accessed: 28-July-2021 ]}

BibLaTeX

@online{reference.wolfram_2021_shortestpathfunction, organization={Wolfram Research}, title={ShortestPathFunction}, year={2010}, url={https://reference.wolfram.com/language/ref/ShortestPathFunction.html}, note=[Accessed: 28-July-2021 ]}

CMS

Wolfram Language. 2010. "ShortestPathFunction." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/ShortestPathFunction.html.

APA

Wolfram Language. (2010). ShortestPathFunction. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/ShortestPathFunction.html