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
- ShortestPathFunction[…] is generated by FindShortestPath.
- ShortestPathFunction[{s,All},…][t] gives the shortest path from s to t.
- ShortestPathFunction[{All,t},…][s] gives the shortest path from s to t.
- ShortestPathFunction[{All,All},…][s,t] gives the shortest path from s to t.
Examples
open allclose allBasic Examples (1)
Scope (7)
ShortestPathFunction works with undirected graphs:
A ShortestPathFunction can give shortest paths from a fixed vertex:
ShortestPathFunction returns {} when no path exists:
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