GetEdgeWeight - Maple Help

Online Help

All Products    Maple    MapleSim


GraphTheory

  

SetEdgeWeight

  

set edge weight

  

GetEdgeWeight

  

get edge weight

 

Calling Sequence

Parameters

Description

Examples

Calling Sequence

SetEdgeWeight(G, e, w)

GetEdgeWeight(G, e)

Parameters

G

-

weighted graph

e

-

edge/arc

w

-

numeric; edge weight

Description

• 

SetEdgeWeight is used to change the weight of an edge of a weighted graph. It returns the old weight of the edge.

• 

GetEdgeWeight is used to get the weight of an edge of a weighted graph.

Examples

withGraphTheory:

GMakeWeightedCompleteGraph4

GGraph 1: an undirected weighted graph with 4 vertices and 6 edge(s)

(1)

GetEdgeWeightG,1,2

1

(2)

SetEdgeWeightG,1,2,3

1

(3)

GetEdgeWeightG,1,2

3

(4)

foreinEdgesCycleGraph4doSetEdgeWeightG,e,2enddo

1

(5)

WeightMatrixG

0212202112022120

(6)

See Also

IsWeighted

MakeWeighted

WeightMatrix