Network::addVertex
-- adds one
or several vertices to a networkNetwork::addVertex
(G,v)
adds the vertex or
list of vertices v
to the network G
.
Network::addVertex(G, v <, Vweight=c>)
Network::addVertex(G, l <, Vweight=lc>)
c |
- | number |
l |
- | list of expressions |
v |
- | expression |
lc |
- | list of numbers |
G |
- | network |
Vweight |
- | The weight of the vertex. |
Network::addVertex
returns the augmented network.
Network::addVertex
adds one or several nodes to an
already existing network. A node is to be assumed an arbitrary
expression. If the specified node is already contained in the network
an error is raised.Network::addVertex
(G,v)
adds the node
v
to the network G
. A weight can be defined
for the new vertex with Network::addVertex
(G,v,Vweight=c)
. If these specification is
missing, the default value 0 is assumed.Network::addVertex
(G,l)
, where l
is a list of nodes. None of these nodes is allowed to be already
contained in the network. Weights can be specified by
Network::addVertex
(G,l,Vweight=lc)
where lc
is a numerical
list with exactly the same number of elements as l
.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 )
Network::AddVertex