Esempio n. 1
0
 public static void PrintDirectedGraph <T>(DirectedGraph <T> graph)
 {
     graph.Edges.ForEach(x => { Console.WriteLine($"{x.SourceVertex.Value} == {x.Weight} ==> {x.DestinationVertex.Value}"); });
 }
Esempio n. 2
0
 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);
 }