graph :: MutableDigraph :: remove_vertex
u
from this graph and all its incident arcs.If the vertex does not exist in the graph, then nothing happens.
var g = new HashDigraph[Int]
g.add_vertex(0)
g.add_vertex(1)
assert g.has_vertex(0)
g.remove_vertex(0)
assert not g.has_vertex(0)
# Removes the vertex `u` from this graph and all its incident arcs.
#
# If the vertex does not exist in the graph, then nothing happens.
#
# ~~~
# var g = new HashDigraph[Int]
# g.add_vertex(0)
# g.add_vertex(1)
# assert g.has_vertex(0)
# g.remove_vertex(0)
# assert not g.has_vertex(0)
# ~~~
fun remove_vertex(u: V) is abstract
lib/graph/digraph.nit:734,2--746,36
redef fun remove_vertex(u)
do
if has_vertex(u) then
for v in successors(u) do
remove_arc(u, v)
end
for v in predecessors(u) do
remove_arc(v, u)
end
incoming_vertices_map.keys.remove(u)
outgoing_vertices_map.keys.remove(u)
end
end
lib/graph/digraph.nit:963,2--975,4