Example #1
0
        private void GreedyAlgorithm_Click(object sender, EventArgs e)
        {
            if (this.Validation())
            {
                this.PrepareData();

                Form showResult = new AlgorithmForm("Жадібний", manufactures, clients,
                                                    (manufactures, clients) =>
                {
                    List <Route> _routes;

                    Expensive greedy    = new Expensive();
                    var resultAlgorithm = greedy.Solver(manufactures, clients, out _routes);

                    return(new TransportTaskResult
                    {
                        ResultRoute = _routes,
                        Cost = resultAlgorithm
                    });
                });
                showResult.Show();
            }
            else
            {
                MessageBox.Show("Перевірте введені дані");
            }
        }
Example #2
0
        static int Expensive(List <Manufacture> manufactures, List <Client> clients)
        {
            List <Route> routes;
            Expensive    algorithm = new Expensive();

            return(algorithm.Solver(manufactures, clients, out routes));
        }
Example #3
0
        private int GenerateGreedy(List <Manufacture> manufactures, List <Client> clients)
        {
            List <Route> routes;
            Expensive    algorithm = new Expensive();

            return(algorithm.Solver(manufactures, clients, out routes));
        }