GraphTheory/PathWeight - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Microsoft Edge.

Online Help

Home : Support : Online Help : GraphTheory/PathWeight

GraphTheory

  

PathWeight

  

compute path weight

 

Calling Sequence

Parameters

Description

Examples

Compatibility

Calling Sequence

PathWeight(G, w)

Parameters

G

-

graph

w

-

list or Trail object corresponding to a walk in the graph

Description

• 

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.

Examples

Compute the path weight of a walk through an unweighted graph.

(1)

(2)

Compute the path weight of a walk through a weighted directed graph including a self-loop.

(3)

(4)

(5)

(6)

(7)

(8)

Compatibility

• 

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