This is documentation for Mathematica 8, which was
based on an earlier version of the Wolfram Language.
View current documentation (Version 11.1)

VertexAdd

VertexAdd
makes a graph by adding the vertex v to the graph g.
VertexAdd
adds a collection of vertices to g.
  • VertexAdd will add the vertex v only if it does not already exist in g.
Add a vertex to a complete graph:
Add a vertex to a complete graph:
In[1]:=
Click for copyable input
Out[1]=
VertexAdd works with undirected graphs:
Directed graphs:
Add a set of vertices to the graph:
Works with large graphs:
VertexAdd does not change the EdgeList:
The number of vertices can be found using VertexCount:
New in 8