Network::eWeight -- returns the
table of edge weights
Introduction returns the table of
the edge weights of the network Network::eWeight(G)G.
Call(s)Network::eWeight(G)
ParametersG |
- | a network |
Returnsa table
DetailsNetwork::eWeight(G) returns a table with
the edge weight of the network G. Thus
Network::eWeight(G)[[v,w]] is the weight of
the edge [v,w] in the network G.
Example
1>> V := [1,2,3,4,5]: Ed := [[1,2], [1,3], [2,3], [2,4], [3,4], [3,5], [4,5]]: Ew := [30, 20, 25, 10, 20, 25, 20]: N1 := Network(V, Ed, Eweight=Ew): Network::eWeight(N1)
table(
[4, 5] = 20,
[3, 5] = 25,
[3, 4] = 20,
[2, 4] = 10,
[2, 3] = 25,
[1, 3] = 20,
[1, 2] = 30
)
The default weight is 1.
>> N1 := Network::complete(3): Network::eWeight(N1)
table(
[3, 2] = 1,
[3, 1] = 1,
[2, 3] = 1,
[2, 1] = 1,
[1, 3] = 1,
[1, 2] = 1
)
Network::EWeight