construct a shortest path spanning tree
graph or network
Important: The networks package has been deprecated.Use the superseding command GraphTheory[DijkstrasAlgorithm] instead.
This is an implementation of Dijkstra's algorithm for shortest path spanning tree. A priority queue is used for storing the edges.
The final distances are recorded as the vertex weights in the resulting graph (a spanning tree). The tree is rooted at v and the ancestors and daughters of each node are computed relative to this tree.
Edge weights are assumed to be lengths or distances so that edge weights are required to be non-negative. Undirected edges are assumed to be bidirectional.
This routine is normally loaded via the command with(networks) but may also be referenced using the full name networks[shortpathtree](...).
G ≔ petersen⁡:
T ≔ shortpathtree⁡G,1:
Download Help Document
What kind of issue would you like to report? (Optional)