From 38585aa16b3a1e8ed281060f70b8630d311253fb Mon Sep 17 00:00:00 2001 From: coolneng Date: Wed, 19 May 2021 18:26:56 +0200 Subject: [PATCH] Remove additional iteration from greedy algorithm --- src/greedy.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/greedy.py b/src/greedy.py index aec4be8..a779c35 100644 --- a/src/greedy.py +++ b/src/greedy.py @@ -46,7 +46,7 @@ def greedy_algorithm(n, m, data): solutions = DataFrame(columns=["point", "distance"]) first_solution = get_first_solution(n, data) solutions = solutions.append(first_solution, ignore_index=True) - for _ in range(m): + for _ in range(m - 1): element = explore_solutions(solutions, data) solutions = solutions.append(element) data = remove_duplicates(