Skip to content

Mutating Graphs

Mark Junker edited this page Jun 7, 2018 · 1 revision

Most data structures are mutable and support batched addition/removal of vertices/edges.

Removing vertices with a predicate

varg=newAjacencyGraph<string,Edge<string>>();
...// remove any vertex starting with foo
int removed=g.RemoveVertexIf(v =>v.StartsWith("foo"));Console.WriteLine("{0} vertices removed",removed);

Clone this wiki locally