forked from YaccConstructor/QuickGraph
-
-
Notifications
You must be signed in to change notification settings - Fork 71
BidirectionalGraph
Alexandre Rabérin edited this page May 11, 2020
·
1 revision
The BidirectionalGraph<TVertex, TEdge>
provides an efficient data structure to access the out-edges and the in-edges of a vertex of sparse directed graphs.
This class is mutable, serializable, cloneable and can be constructed in many different ways. Internally, the data structure keeps a dictionary from TVertex
to a unordered list of TEdge
elements.
var graph = new BidirectionalGraph<int, Edge<int>>();
...
foreach(int vertex in graph.Vertices)
{
foreach(Edge<int> edge in graph.InEdges(vertex))
{
Console.WriteLine(edge);
}
}
If you only need to access out-edges, consider using the AdjacencyGraph, as it uses half the memory.