DeleteVertex - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Microsoft Edge.

Online Help

All Products    Maple    MapleSim


GraphTheory

  

DeleteVertex

  

delete vertex from graph

 

Calling Sequence

Parameters

Description

Examples

Calling Sequence

DeleteVertex(G, V)

Parameters

G

-

graph

V

-

vertex or a list or set of vertices

Description

• 

The DeleteVertex command returns a copy of the graph G with the specified vertex, or list of vertices, deleted.  The graph G is not changed. The resulting graph is the subgraph of G induced by the remaining vertices. Any edges adjacent to V are removed.

Examples

withGraphTheory:

GCycleGraph5

GGraph 1: an undirected graph with 5 vertices and 5 edge(s)

(1)

HDeleteVertexG,1,4

HGraph 2: an undirected graph with 3 vertices and 1 edge(s)

(2)

EdgesH

2,3

(3)

JInducedSubgraphG,2,3,5

JGraph 3: an undirected graph with 3 vertices and 1 edge(s)

(4)

EdgesJ

2,3

(5)

The next example raises an error because graph G only has five vertices.

DeleteVertexG,6

Error, (in GraphTheory:-DeleteVertex) second argument expected to be a vertex or a list of vertices of the graph

See Also

CycleGraph

Edges

Graph

InducedSubgraph