Пример #1
0
        static void Main(string[] args)
        {
            /*int[,] matrix = {
             *  { 0, 1, 0, 0, 0, 1, 1},
             *  { 1, 0, 0, 1, 1, 1, 0},
             *  { 0, 0, 0, 1, 0, 0, 1},
             *  { 0, 1, 1, 0, 1, 0, 0},
             *  { 0, 1, 0, 1, 0, 0, 0},
             *  { 1, 1, 0, 0, 0, 0, 0},
             *  { 1, 0, 1, 0, 0, 0, 0}
             * }; */

            int[,] matrix =
            {
                { 0, 1, 0, 0, 0, 1, 1 },
                { 1, 0, 0, 0, 1, 1, 0 },
                { 0, 0, 0, 0, 0, 0, 0 },
                { 0, 0, 0, 0, 0, 0, 0 },
                { 0, 1, 0, 0, 0, 0, 0 },
                { 1, 1, 0, 0, 0, 0, 0 },
                { 1, 0, 0, 0, 0, 0, 0 }
            };

            Graph.Graph graph = new Graph.Graph(matrix);

            graph.BreadthTraversal(Console.WriteLine);
        }