Beispiel #1
0
        static void Main(string[] args)
        {
            int[] idHouse = { 1, 2, 3, 4, 5, 6 };

            Graph graph = new Graph();

            for (int i = 0; i < idHouse.Length; i++)
            {
                graph.AddHouse(idHouse[i]);
            }

            graph.AddRoad(1, 2, 7);
            graph.AddRoad(1, 3, 9);
            graph.AddRoad(1, 5, 14);
            graph.AddRoad(2, 3, 18);
            graph.AddRoad(2, 4, 15);
            graph.AddRoad(3, 4, 11);
            graph.AddRoad(3, 5, 2);
            graph.AddRoad(4, 6, 6);
            graph.AddRoad(6, 5, 20);

            graph.TheMinimumTotaDistance(graph);
            Console.ReadLine();
        }