forked from YaccConstructor/QuickGraph
-
-
Notifications
You must be signed in to change notification settings - Fork 71
AdjacencyGraph
Alexandre Rabérin edited this page May 11, 2020
·
1 revision
The AdjacencyGraph<TVertex, TEdge>
, also known as adjacency list provides an efficient data structure to access the out-edges of a vertex.
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 AdjacencyGraph<int, Edge<int>>();
...
foreach(int vertex in graph.Vertices)
{
foreach(Edge<int> edge in graph.OutEdges(vertex))
{
Console.WriteLine(edge);
}
}
If you need to access in-edges as well, consider using the BidirectionalGraph.