diff --git a/src/local_search.py b/src/local_search.py index 79a6bfc..8e22d14 100644 --- a/src/local_search.py +++ b/src/local_search.py @@ -69,6 +69,6 @@ def explore_neighbourhood(element, n, data, max_iterations=100000): def local_search(first_solution, n, data): best_solution = explore_neighbourhood( - element=first_solution, n=n, data=data, max_iterations=50 + element=first_solution, n=n, data=data, max_iterations=5 ) return best_solution diff --git a/src/memetic_algorithm.py b/src/memetic_algorithm.py index 0308150..2f25fcc 100644 --- a/src/memetic_algorithm.py +++ b/src/memetic_algorithm.py @@ -37,6 +37,7 @@ def memetic_algorithm(n, m, data, hybridation, max_iterations=100000): if i % 10 == 0: best_index, _ = get_best_elements(population) run_local_search(n, data, population, mode=hybridation) + i += 5 parents = select_parents(population, n, mode="stationary") offspring = crossover(mode="position", parents=parents, m=m) offspring = mutate(offspring, n, data)