Skip to content

AdjacencyGraph

Mark Junker edited this page Jun 7, 2018 · 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|Creating Graphs]. Internally, the data structure keeps a dictionary from TVertex to a unordered list of TEdge elements.

vargraph=newAdjacencyGraph<int,Edge<int>>();
...foreach(varvertexingraph.Vertices)foreach(varedgeingraph.OutEdges(vertex))Console.WriteLine(edge);

If you need to access in-edges as well, consider using the BidirectionalGraph.

Clone this wiki locally