Пример #1
0
        private void DimensionalResult(string[,] edges)
        {
            DimensionalGraph graph = new DimensionalGraph(edges);

            Console.WriteLine("The in and out level for verticals: " + produceVerticalString(graph) + "respectively are: ");
            Console.Write("In level: ");
            foreach (int e in graph.GetInLevel())
            {
                Console.Write(e + " ");
            }
            Console.WriteLine("");
            Console.Write("Out level: ");
            foreach (int e in graph.GetOutLevel())
            {
                Console.Write(e + " ");
            }
        }
Пример #2
0
        private void findEulerPath(string[,] edges)
        {
            DimensionalGraph dimensionalGraph = new DimensionalGraph(edges);
            List <string>    result           = dimensionalGraph.FindEulerRoad();

            if (result.Count == 0)
            {
                Console.WriteLine("There is no Euler road in this graph");
            }
            else
            {
                Console.Write("The Euler Road in this graph is: ");
                for (int i = result.Count - 1; i >= 0; i--)
                {
                    Console.Write(result[i] + " ");
                }
                Console.WriteLine("");
            }
        }