## `Network::changeVertex` -- changes the weight of one or several vertices in a network

#### Introduction

`Network::changeVertex``(G, v, Vweight=c)` sets the weight of vertex `v` in network `G` to `c`.

#### Call(s)

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

#### Parameters

`c` | - | a number
`l` | - | a list of nodes
`v` | - | a node of the network `G`
`lc` | - | a list of numbers
`G` | - | a network

#### Options

`Vweight` | - | the new weight(s) of the vertices

#### Returns

the augmented network

#### Details

- `Network::changeVertex` changes the weight of one or several nodes in a network. An error is raised if the specified node is not contained in the network.
- ``Network::changeVertex`(G,v,Vweight=c)` changes the weight of node `v` in the network `G` to the new value `c`.
- Instead of changing the vertex weight for one single node, the weight of several nodes can be changed with ``Network::changeVertex`(G,l,Vweight=lc)` where `l` is a list of nodes and `lc` is a numerical list with exactly the same number of elements as `l`. If one of the specified nodes is not contained in the network an error is raised.

#### Example 1

We generate a cyclic path with default weights. Then, the vertex weights are changed.

    >> N1 := Network::cycle([v1,v2,v3,v4]):
       Network::vWeight(N1)

                                     table(
                                       v4 = 0,
                                       v3 = 0,
                                       v2 = 0,
                                       v1 = 0
                                     )

    >> N2 := Network::changeVertex(N1, [v1,v2,v3,v4],
                                   Vweight=[1,2,3,4]):
       Network::vWeight(N2)

                                     table(
                                       v4 = 4,
                                       v3 = 3,
                                       v2 = 2,
                                       v1 = 1
                                     )

#### Changes

- used to be called `Network::ChangeVertex`

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