Example #1
0
        public ISolution HillClimbing(ISolution sol)
        {
            int              min  = prb.Eval(sol);
            ISolution        best = sol;
            List <ISolution> nebh = Neibours(sol);

            foreach (ISolution a in nebh)
            {
                if (prb.Eval(a) < min)
                {
                    best = a;
                }
            }
            return(best);
        }