GraphTheory
AddVertex
add vertex to graph
Calling Sequence
Parameters
Description
Examples
AddVertex(G, V)
G
-
graph
V
vertex or list of vertices
The AddVertex command adds a vertex or vertices to a graph. A new graph is returned which contains the specified set of vertices in addition to the vertices in the original graph G.
with⁡GraphTheory:
G ≔ CycleGraph⁡5
G≔Graph 1: an undirected graph with 5 vertices and 5 edge(s)
AddVertex⁡G,a,b
Graph 2: an undirected graph with 7 vertices and 5 edge(s)
AddVertex⁡G,4
Error, (in GraphTheory:-AddVertex) some of the vertices to be added are already present in the graph
See Also
AddArc
AddEdge
CycleGraph
DeleteVertex
Graph
Download Help Document
What kind of issue would you like to report? (Optional)