public LayeredTopologicalSortAlgorithm(IVertexAndEdgeListGraph <TVertex, TEdge> g) : base(g) { tmpGraph = new BidirectionalGraph <TVertex, TEdge>(); //create a copy from the graph tmpGraph.AddVertexRange(g.Vertices); foreach (var e in g.Edges) { tmpGraph.AddEdge(e); } }