Ejemplo n.º 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);
        }
Ejemplo n.º 2
0
        public static void RunDynamic()
        {
            isSolving   = true;
            path        = new List <int>();
            timeCounter = new Stopwatch();
            isSolving   = true;
            timeCounter.Start();
            DynamicTSP dynamic = new DynamicTSP(_matrix, 0);

            dynamic.Solve();
            timeCounter.Stop();
            path = dynamic.tour;

            cost      = dynamic.minTourCost;
            isSolving = false;
        }
Ejemplo n.º 3
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();
        }