Network::changeEdge
--
changes weight and capacity of one or several edgesNetwork::changeEdge
(G, e, Eweight=c,
Capacity=l)
changes the weight of edge e
in network
G
to c
and its capacity to
l
.
Network::changeEdge(G, e <, Eweight=c> <, Capacity=t>)
Network::changeEdge(G, l <, Eweight=lc> <, Capacity=lt>)
lc,lt |
- | lists of numbers |
c,t |
- | numbers |
l |
- | list of edges |
e |
- | edge |
G |
- | network |
Eweight |
- | change the weight of the edge |
Capacity |
- | change the capacity of the edge |
The altered network
Network::changeEdge
changes the weight and capacity of
one or several edges in a network. An edge is given as a list
containing two nodes of the network. An error is raised if the
specified edge is not contained in the network.Network::changeEdge
(G, e, Eweight=c)
changes the weight of edge
e
in the network G
to the new value
c
.Network::changeEdge
(G, e, Capacity=t)
changes the capacity of edge
e
in the network G
to the new value
t
.Network::changeEdge
(G, e, Eweight=c, Capacity=t)
changes the weight and capacity of edge e
simultaneously.ChangeEdge(G,l,Eweight=lc,Capacity=lt)
has to be given
where l
is a list of edges and lc
and
lt
are numerical lists with exactly the same number of
elements as l
.We construct a cyclic network with default weights. Then, those weights are changed.
>> N1 := Network::cycle([v1, v2, v3, v4]): Network::eWeight(N1)
table( [v4, v1] = 1, [v3, v4] = 1, [v2, v3] = 1, [v1, v2] = 1 )
>> N2 := Network::changeEdge(N1, [[v1,v2], [v2,v3]], Eweight=[2,2]): Network::eWeight(N2)
table( [v4, v1] = 1, [v3, v4] = 1, [v2, v3] = 2, [v1, v2] = 2 )
Network::ChangeEdge