public static void PrintDirectedGraph <T>(DirectedGraph <T> graph) { graph.Edges.ForEach(x => { Console.WriteLine($"{x.SourceVertex.Value} == {x.Weight} ==> {x.DestinationVertex.Value}"); }); }
private void ReplaceVertexParent(DirectedGraph <T> tree, Vertex <T> destVertex, Edge <T> newEdge) { tree.Edges.RemoveAll(x => x.DestinationVertex.Value.Equals(destVertex.Value)); tree.AddEdge(newEdge); }