Compare commits

..

1 Commits

Author SHA1 Message Date
coolneng 2fe874e733
Remove duplicates from the solutions 2021-04-11 22:24:22 +02:00
1 changed files with 2 additions and 4 deletions

View File

@ -37,11 +37,9 @@ def greedy_algorithm(n, m, data):
solutions = solutions.append(first_solution, ignore_index=True)
for _ in range(m):
last_solution = solutions["point"].tail(n=1)
centroid, furthest_index = get_furthest_element(
element=int(last_solution), data=data
)
centroid, index = get_furthest_element(element=int(last_solution), data=data)
solutions = solutions.append(dict(centroid), ignore_index=True)
data = data.drop(furthest_index)
data = data.drop(index)
return solutions