Skip to content
Andrey Vernigora edited this page Feb 2, 2019 · 3 revisions

Mutating Graphs

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

Removing vertices with a predicate

var g = new AjacencyGraph<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