Exemple #1
0
        public static void Main()
        {
            String pairPath = "./blatt04_aufg1_a.txt";

            Console.WriteLine("processing " + pairPath);
            List <int[]> edges = TupleReader.ReadTriples(pairPath);

            Graph graph = new Graph(edges);

            // Display the graph
            graph.Display();

            int vStart = 0;             //compute shortest paths from this node

            double[] pi;                //shortest known path lengths
            int[]    pred;              //predeceesor nodes for these paths

            // Find the shortest path using the Dijkstra algorithm.
            ShortestPathsHeap(graph, vStart, out pi, out pred);

            // Output shortest paths
            DisplayShortestPaths(vStart, pi, pred);

            double[] pi2;               //shortest known path lengths
            int[]    pred2;             //predeceesor nodes for these paths

//			// Check Again with Array implementation
            //ShortestPathsArray(graph, vStart, out pi2, out pred2);

//			// Output shortest paths
            //DisplayShortestPaths(vStart, pi2, pred2);
        }