Shortest path tree from node
returns
a directed graph, tree
= shortestpathtree(G
,s
)tree
, that contains the tree
of shortest paths from source node s
to all other
nodes in the graph. If the graph is weighted (that is, G.Edges
contains
a variable Weight
), then those weights are used
as the distances along the edges in the graph. Otherwise, all edge
distances are taken to be 1
.
uses
additional options specified by one or more Name-Value pair arguments,
using any of the input argument combinations in previous syntaxes.
For example, tree
= shortestpathtree(___,Name,Value
)shortestpathtree(G,s,'OutputForm','vector')
returns
a numeric vector that describes the shortest path tree.
digraph
| distances
| graph
| nearest
| shortestpath