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.

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

BibTeX

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

BibLaTeX

@online{reference.wolfram_2024_shortestpathfunction, organization={Wolfram Research}, title={ShortestPathFunction}, year={2010}, url={https://reference.wolfram.com/language/ref/ShortestPathFunction.html}, note=[Accessed: 22-December-2024 ]}