GraphTheory
PathWeight
compute path weight
Calling Sequence
Parameters
Description
Examples
Compatibility
PathWeight(G, w)
G
-
graph
w
list or Trail object corresponding to a walk in the graph
The PathWeight(G) command returns the path weight of the walk w in the graph G.
When G is weighted, this is the sum of the edge weights for all edges appearing in the walk w.
When G is unweighted, this is simply the number of edges of the walk.
Note that self-loops appearing in w are not included in the edge count for the purposes of computing graph density.
Compute the path weight of a walk through an unweighted graph.
Compute the path weight of a walk through a weighted directed graph including a self-loop.
The GraphTheory[PathWeight] command was introduced in Maple 2023.
For more information on Maple 2023 changes, see Updates in Maple 2023.
See Also
NumberOfEdges
Download Help Document