ViewPoint.remove#

ViewPoint.remove() → None#

Remove this vertex, and all its edges, from its graph

Raises:

ValueError – the vertex is not connected to a graph

v.remove() removes v, and every edge touching it (incoming or outgoing), from its graph. The Vertex object itself is not deleted.

Note

This is a thin convenience wrapper around Graph.remove_vertex.

Return type:

None

>>> from pgraph import UGraph
>>> g = UGraph()
>>> v1 = g.add_vertex(coord=[0,0], name='v1')
>>> v2 = g.add_vertex(coord=[1,1], name='v2')
>>> g.add_edge(v1, v2)
Edge{[v1] -- [v2], cost=1.414}
>>> v2.remove()
>>> print(g)
UGraph: 1 vertex, 0 edges, 1 component
Seealso:

Graph.remove_vertex Edge.remove