public void testShorstPathAlg() { IgnoreIfTrue(!IsAssemblyForAdapteeYanQiSupportingStreamReader()); Console.WriteLine("Testing Dijkstra Algorithm."); DijkstraShortestPathAlg alg = new DijkstraShortestPathAlg(graph); Console.WriteLine(alg.GetShortestPath(graph.GetVertex(0), graph.GetVertex(38))); }
/** * @param args */ public static void main(String[] args) { ConsoleUtility.WriteLine("Welcome to the class VariableGraph!"); VariableGraph graph = new VariableGraph("data/test_50"); graph.DeleteVertex(13); graph.DeleteVertex(12); graph.DeleteVertex(10); graph.DeleteVertex(23); graph.DeleteVertex(47); graph.DeleteVertex(49); graph.DeleteVertex(3); graph.DeleteEdge(new Pair <int, int>(26, 41)); DijkstraShortestPathAlg alg = new DijkstraShortestPathAlg(graph); ConsoleUtility.WriteLine(alg.GetShortestPath(graph.GetVertex(0), graph.GetVertex(20))); }
/// <param name="args"> </param> public static void Main(string[] args) { Console.WriteLine("Welcome to the class VariableGraph!"); VariableGraph graph = new VariableGraph("data/test_50"); graph.remove_vertex(13); graph.remove_vertex(12); graph.remove_vertex(10); graph.remove_vertex(23); graph.remove_vertex(47); graph.remove_vertex(49); graph.remove_vertex(3); graph.remove_edge(new Pair <int, int>(26, 41)); DijkstraShortestPathAlg alg = new DijkstraShortestPathAlg(graph); Console.WriteLine(alg.get_shortest_path(graph.get_vertex(0), graph.get_vertex(20))); }