networks[spantree] - finds a minimum weight spanning tree
|
Calling Sequence
|
|
spantree(G)
spantree(G, s)
spantree(G, s, w)
|
|
Parameters
|
|
G
|
-
|
graph or network
|
s
|
-
|
starting or root vertex for the tree
|
w
|
-
|
name for returning the sum of the edge weights in the tree
|
|
|
|
|
Description
|
|
•
|
This routine constructs a spanning tree for the graph G. The result is returned as a new graph derived from G and consisting of that spanning tree.
|
•
|
The chosen tree has edges which minimize the total edge weight of the tree.
|
•
|
The routine uses Prim's algorithm, which fails if G is not strongly connected.
|
•
|
The routine is normally loaded via the command with(networks) but may also be referenced using the full name networks[spantree](...).
|
|
|
Download Help Document
Was this information helpful?