Mutating Graphs - KeRNeLith/QuikGraph GitHub Wiki

Mutating Graphs

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

Removing vertices with a predicate

var graph = new AjacencyGraph<string, Edge<string>>();
...
// Remove any vertex starting with foo
int removed = graph.RemoveVertexIf(v => v.StartsWith("foo"));
Console.WriteLine($"{removed} vertices removed");
⚠️ **GitHub.com Fallback** ⚠️