Next Page Contents

Network::addEdge -- adds one or several edges to a network

Introduction

Network::addEdge augments an existing network by new edges

Call(s)

Network::addEdge(G, e <, Eweight=c> <, Capacity=t>)
Network::addEdge(G, l <, Eweight=lc> <, Capacity=lt>)

Parameters

lc,lt - lists of numbers
c,t - numbers
l - list of edges
e - edge
G - network

Options

Eweight - The weight(s) for the new edge(s). Default is 1.
Capacity - The capacity/capacities for the new edge(s). Default is 1.

Returns

The augmented network

Details

Example 1

We construct a cyclic network and add a few edges.

>> N1 := Network::cycle([v1,v2,v3,v4]):
   Network::edge(N1)
                 [[v1, v2], [v2, v3], [v3, v4], [v4, v1]]
>> N2 := Network::addEdge(N1, [v1,v3]):
   Network::edge(N2)
            [[v1, v2], [v2, v3], [v3, v4], [v4, v1], [v1, v3]]

Now, both v2 and v3 are direct successors of v1.

>> Network::epost(N2)[v1];
                                 [v2, v3]

Network::addEdge can augment a network with weights and capacities.

>> N3 := Network::addEdge(N1, [[v1,v3],[v1,v4]], Capacity = [3,5]):
   Network::eCapacity(N3);
                              table(
                                [v1, v4] = 5,
                                [v1, v3] = 3,
                                [v4, v1] = 1,
                                [v3, v4] = 1,
                                [v2, v3] = 1,
                                [v1, v2] = 1
                              )

Changes




Do you have questions or comments?


Copyright © SciFace Software GmbH & Co. KG 2000