static void Main(string[] args)
        {
            DateTime dt = DateTime.Now;

            int[,] G1 = null, G2 = null;
            int option = 0;

            if (args.Any())
            {
                GraphReader.readArgs(args, out G1, out G2, ref option);
            }
            else
            {
                G1 = new int[, ] {
                    { 0, 1, 0, 1, 0, 1, 0, 0 },
                    { 1, 0, 1, 1, 0, 1, 1, 1 },
                    { 0, 1, 0, 1, 0, 0, 0, 0 },
                    { 1, 1, 1, 0, 1, 1, 0, 1 },
                    { 0, 0, 0, 1, 0, 1, 0, 0 },
                    { 1, 1, 0, 1, 1, 0, 1, 0 },
                    { 0, 1, 0, 0, 0, 1, 0, 0 },
                    { 0, 1, 0, 1, 0, 0, 0, 0 }
                };
                G2 = new int[, ] {
                    { 0, 1, 0, 1, 0, 0, 0, 0 },
                    { 1, 0, 1, 1, 0, 1, 1, 1 },
                    { 0, 1, 0, 1, 0, 0, 0, 0 },
                    { 1, 1, 1, 0, 1, 1, 0, 1 },
                    { 0, 0, 0, 1, 0, 1, 0, 0 },
                    { 0, 1, 0, 1, 1, 0, 1, 0 },
                    { 0, 1, 0, 0, 0, 1, 0, 0 },
                    { 0, 1, 0, 1, 0, 0, 0, 0 }
                };
            }
            //Console.Write(Graph.convertFromMatrix(G1));
            //Console.Write(Graph.convertFromMatrix(G2));
            State s = new State(G1, G2);

            Console.Write("V Solution\n");

            if (option == 0)
            {
                SolutionV.McGregor(new State(G1, G2), ref s);
                Console.Write(s);
                Console.Write((String.Format("SCORE: {0} ({0}v + {1}e)\n", s.correspondingVerticles.Count - s.countOfNullNodes, s.correspondingEdges.Count)));
                s = new State(G1, G2);
            }
            else
            {
                Console.Write("V+E Solution\n");
                SolutionV.McGregor(new State(G1, G2), ref s, 1);
                Console.Write(s);
                Console.Write((String.Format("SCORE: {0} ({1}v + {2}e)\n", s.correspondingEdges.Count + s.correspondingVerticles.Count - s.countOfNullNodes, s.correspondingVerticles.Count - s.countOfNullNodes, s.correspondingEdges.Count)));
            }
        }
Example #2
0
        static void Main(string[] args)
        {
            DateTime dt = DateTime.Now;

            int[,] G1 = null, G2 = null;
            int option = 0;

            if (args.Any())
            {
                GraphReader.readArgs(args, out G1, out G2, ref option);
            }
            else
            {
                G1 = new int[, ] {
                    { 0, 1, 0, 1, 0, 1, 0, 0 },
                    { 1, 0, 1, 1, 0, 1, 1, 1 },
                    { 0, 1, 0, 1, 0, 0, 0, 0 },
                    { 1, 1, 1, 0, 1, 1, 0, 1 },
                    { 0, 0, 0, 1, 0, 1, 0, 0 },
                    { 1, 1, 0, 1, 1, 0, 1, 0 },
                    { 0, 1, 0, 0, 0, 1, 0, 0 },
                    { 0, 1, 0, 1, 0, 0, 0, 0 }
                };
                G2 = new int[, ] {
                    { 0, 1, 0, 1, 0, 0, 0, 0 },
                    { 1, 0, 1, 1, 0, 1, 1, 1 },
                    { 0, 1, 0, 1, 0, 0, 0, 0 },
                    { 1, 1, 1, 0, 1, 1, 0, 1 },
                    { 0, 0, 0, 1, 0, 1, 0, 0 },
                    { 0, 1, 0, 1, 1, 0, 1, 0 },
                    { 0, 1, 0, 0, 0, 1, 0, 0 },
                    { 0, 1, 0, 1, 0, 0, 0, 0 }
                };
            }
            //Console.Write(Graph.convertFromMatrix(G1));
            //Console.Write(Graph.convertFromMatrix(G2));
            State s = new State(G1, G2);

            Console.Write("V Solution\n");

            if (option == 0)
            {
                SolutionV.McGregor(new State(G1, G2), ref s);
                Console.Write(s);
                s = new State(G1, G2);
            }
            else
            {
                Console.Write("V+E Solution\n");
                SolutionV.McGregor(new State(G1, G2), ref s, 1);
                Console.Write(s);
            }
        }