## `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

- `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.
- Several nodes can be added with ``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`.

#### 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

- used to be called `Network::AddVertex`

Do you have questions or comments?
Copyright © SciFace Software GmbH & Co. KG 2000