Skip to content

UndirectedBidirectionalGraph

Alexandre Rabérin edited this page May 11, 2020 · 1 revision

UndirectedBidirectionalGraph

The UndirectedBidirectionalGraph<TVertex, TEdge> provides a wrapper around a bidirectional graph in order to adapt it as an undirected graph.

This class is mutable via the wrapped graph, serializable and cloneable.

var graph = new BidirectionalGraph<int, Edge<int>>();
var adapterGraph = new UndirectedBidirectionalGraph<int, Edge<int>>(graph);
...
foreach(int vertex in adapterGraph.Vertices)
{
    foreach(Edge<int> edge in graph.AdjacentEdges(vertex))
    {
        Console.WriteLine(edge);
    }
}
Clone this wiki locally