示例#1
0
        public static void Test()
        {
            Graph graph = new Graph(10);

            graph.Connect(0, 2);
            graph.Connect(0, 1);
            graph.Connect(2, 4);
            graph.Connect(3, 4);
            graph.Connect(3, 5);
            graph.Connect(4, 5);
            graph.Connect(4, 6);
            graph.Connect(6, 8);

            GraphHandler handler = new BFS_EdgeTo(graph.Clone());

            handler.Path(0, 8).PrintToConsole();
        }
示例#2
0
        public static void Test()
        {
            Graph graph = new Graph(10);

            graph.Connect(0, 2);
            graph.Connect(0, 1);
            graph.Connect(2, 4);
            graph.Connect(3, 4);
            graph.Connect(3, 5);
            graph.Connect(4, 5);
            graph.Connect(4, 6);
            graph.Connect(6, 8);

            GraphHandler handler = new BFS_EdgeTo(graph.Clone());

            handler.Path(0, 8).PrintToConsole();
        }