Previous Page Next Page Contents

Network::addVertex -- adds one or several vertices to a network

Introduction

Network::addVertex(G,v) adds the vertex or list of vertices v to the network G.

Call(s)

Network::addVertex(G, v <, Vweight=c>)
Network::addVertex(G, l <, Vweight=lc>)

Parameters

c - number
l - list of expressions
v - expression
lc - list of numbers
G - network

Options

Vweight - The weight of the vertex.

Returns

Network::addVertex returns the augmented network.

Details

Example 1

Starting from a cyclic network with four nodes, we add three more nodes with non-zero weights.

>> N1 := Network::cycle([v1,v2,v3,v4]):
   Network::vertex(N1)
                             [v1, v2, v3, v4]
>> N2 := Network::addVertex(N1, [v5,v6,v7], Vweight=[2,3,4]):
   Network::vertex(N2)
                       [v1, v2, v3, v4, v5, v6, v7]
>> Network::vWeight(N2)
                                 table(
                                   v7 = 4,
                                   v6 = 3,
                                   v5 = 2,
                                   v4 = 0,
                                   v3 = 0,
                                   v2 = 0,
                                   v1 = 0
                                 )

Changes




Do you have questions or comments?


Copyright © SciFace Software GmbH & Co. KG 2000