delete vertex from graph
vertex or a list or set of vertices
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.
G≔Graph 1: an undirected unweighted graph with 5 vertices and 5 edge(s)
H≔Graph 2: an undirected unweighted graph with 3 vertices and 1 edge(s)
J≔Graph 3: an undirected unweighted graph with 3 vertices and 1 edge(s)
The next example raises an error because graph G only has five vertices.
Error, (in GraphTheory:-DeleteVertex) second argument expected to be a vertex or a list of vertices of the graph
Download Help Document
What kind of issue would you like to report? (Optional)