Close
Close window
networks(deprecated)/addvertex - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Mozilla Firefox.
Maplesoft logo
Maplesoft logo

Online Help

All Products Maple MapleSim


Home : Support : Online Help : networks(deprecated)/addvertex
[フレーム] [フレーム]

networks

addvertex

add a vertex or set of vertices to a graph

Calling Sequence

addvertex(v1, G)

addvertex(v1, v2, G)

addvertex(v1, weights=w, G)

addvertex([v1, v2], weights=[w1, w2], G)

Parameters

G

-

graph or network

v1, v2, ..., vn

-

new vertices for the graph G

w

-

user supplied weight for a vertex (default 0)

Description

Important: The networks package has been deprecated . Use the superseding command GraphTheory[AddVertex] instead.

This routine adds one or more vertices to a graph. The vertex names used are returned as an expression sequence.

To force addvertex() to use a specific weight for a single vertex use the optional argument (eg. weights=3).

If more than one vertex is to be added, they can be presented as a list or set of vertices. In this case, non-default weights must also be specified as a list of weights as in: addvertex([1, 3], weights=[0, 0], G)

A vertex cannot be a symbol or string beginning with the letter e; these are reserved, by the package, for edge names.

This routine is normally loaded via the command with(networks) but can also be referenced using the full name networks[addvertex](...).

Examples

Important: The networks package has been deprecated . Use the superseding command GraphTheory[AddVertex] instead.

>

withnetworks:

>

newG:

>

addvertex1,2,3,4,G:

>

addvertexvname,xx,G:

>

verticesG

1,2,3,4,vname,xx

(1)
>

vweight1,G

0

(2)
>

addvertexn1,n2,weights=5,symwt,G

n1,n2

(3)
>

vweightn2,G

symwt

(4)


Download Help Document

AltStyle によって変換されたページ (->オリジナル) /