public void Setup() { var bidirectionalEdgeCosts = new Dictionary <E, double>(); // Create dict of forward and backward edges foreach (var edgePair in edgesCosts) { var edge = edgePair.Key; var reversed = edge.Reversed(); bidirectionalEdgeCosts.Add(edge, edgePair.Value); bidirectionalEdgeCosts.Add(reversed, edgePair.Value); } testGraph = new AdjacencyListGraph <string, Edge <string> >(); foreach (string vertex in vertices) { testGraph.AddVertex(vertex); } foreach (E edge in edgesCosts.Keys) { testGraph.AddBidirectionalEdge(edge); } shortestPath = new Algorithms.DijkstraShortestPath <string, E>(testGraph, bidirectionalEdgeCosts); shortestPath.ComputeAllFromVertex("a"); }
public void Setup() { testGraph = new AdjacencyListGraph <string, Edge <string> >(); foreach (var vertex in vertices) { testGraph.AddVertex(vertex); } foreach (var edge in edges) { testGraph.AddDirectedEdge(edge); } }
public void Setup() { testGraph = new AdjacencyListGraph <string, E>(); foreach (string vertex in vertices) { testGraph.AddVertex(vertex); } foreach (E edge in edgesCosts.Keys) { testGraph.AddDirectedEdge(edge); } shortestPath = new Algorithms.DijkstraShortestPath <string, E>(testGraph, edgesCosts); shortestPath.ComputeAllFromVertex("a"); }
public void Setup() { testGraph = new AdjacencyListGraph <string, Edge <string> >(); }