/// <summary>
        /// Places the given city in the individual.
        /// </summary>
        /// <param name="problem"></param>
        /// <param name="calculator"></param>
        /// <param name="genomes"></param>
        /// <param name="city_to_place"></param>
        /// <returns></returns>
        public static BestPlacementResult CalculateBestPlacementInGenomes(
            Problem problem,
            FitnessCalculator calculator,
            List <Genome> genomes,
            int city_to_place)
        {
            List <int> cities_to_place = new List <int>();

            cities_to_place.Add(city_to_place);
            return(BestPlacementHelper.CalculateBestPlacementInGenomes(problem, calculator, genomes, cities_to_place));
        }
        public static List <Genome> DoFast(
            Problem problem,
            FitnessCalculator calculator,
            List <Genome> genomes,
            List <int> cities_to_place)
        {
            // initialize the best placement result.
            BestPlacementResult result = null;

            // create the new individual.
            cities_to_place = new List <int>(cities_to_place);
            while (cities_to_place.Count > 0)
            {
                int city_to_place = cities_to_place[cities_to_place.Count - 1];
                cities_to_place.RemoveAt(cities_to_place.Count - 1);

                // calculates the next best position for placement.
                result = BestPlacementHelper.CalculateBestPlacementInGenomes(
                    problem,
                    calculator,
                    genomes,
                    city_to_place);

                // calculate the new individual using the result.
                List <int> round = genomes[result.RoundIdx];
                if (round.Count == result.CityIdx)
                {
                    round.Add(result.City);
                }
                else
                {
                    round.Insert(result.CityIdx, result.City);
                }

                // remove the placed city.
                cities_to_place.Remove(result.City);
            }

            // return the result.
            return(genomes);
        }