finds a path in a directed tree
path([a, b], G)
graph or network
list of two vertices
Important: The networks package has been deprecated.Use the superseding package GraphTheory instead.
If there is a directed path from a to b a list containing the nodes on the path is returned. The message FAIL is returned when no such path can be found.
The notion of a path depends exclusively on the status of the ancestor and daughter tables. These properties are not ordinarily maintained by the standard graph primitives such as addedge() and delete(). It is maintained by calls to spantree() and shortpathtree().
This routine is normally loaded via the command with(networks) but may also be referenced using the full name networks[path](...).
G ≔ petersen⁡:
T ≔ shortpathtree⁡G,1:
Download Help Document