Пример #1
0
        static void testfunction()
        {
            int verticles = 15;

            _matrix = new AdjacencyMatrix(verticles);
            timeCounter   timemaster = new timeCounter(100);
            DynamicTSP    tester     = new DynamicTSP(_matrix, 0);
            TspBruteForce brute      = new TspBruteForce(_matrix);

            timemaster.measureSolver(tester, verticles);
            timemaster.measureSolver(brute, verticles);
        }
Пример #2
0
        public static void runMeasures()
        {
            DynamicTSP     dynamic    = new DynamicTSP();
            TspBruteForce  brute      = new TspBruteForce();
            BranchAndBound branch     = new BranchAndBound();
            timeCounter    timemaster = new timeCounter(100);

            excel = new ExcelManager("pomiary");
            excel.createNewFile();
            for (int i = 2; i < 10; i++)
            {
                excel.changeCell(i, 3, timemaster.measureSolver(dynamic, i + 2).ToString()); //dynamic
                Console.WriteLine("Dynamic END" + i);
                excel.changeCell(i, 4, timemaster.measureSolver(branch, i + 2).ToString());  //branch
                Console.WriteLine("Branch&Bound done" + i);
                excel.changeCell(i, 2, timemaster.measureSolver(brute, i + 2).ToString());   //brute
                Console.WriteLine("BruteForce done" + i);
            }
            excel.close();
        }