Exemplo n.º 1
0
        static void Main(string[] args)
        {
            bool isGraphsChecker     = IsValidGraphsChecker(args);
            bool isComplexityChecker = IsValidComplexityChecker(args);

            if (!(isGraphsChecker ^ isComplexityChecker))
            {
                ShowHelp(args);
                return;
            }

            bool exact = args[0] == "exact";

            if (isGraphsChecker)
            {
                var G            = GraphLoader.FromCSV(args[1]);
                var H            = GraphLoader.FromCSV(args[2]);
                var modularGraph = ModularGraph.Create(G, H);

                if (exact)
                {
                    var exactResult = new Exact(G, H, modularGraph).Run();
                    GraphLoader.ToCSV(exactResult, "Examples/exact.csv");
                }
                else
                {
                    var approximateResult = new Approximate(G, H, modularGraph).Run();
                    GraphLoader.ToCSV(approximateResult, "Examples/approximate.csv");
                }
            }
            else
            {
                new ComplexityChecker(args[2], exact).Run();
            }
        }