Set initial distance to 0 in the greedy algorithm

This commit is contained in:
2021-04-15 20:51:02 +02:00
parent 193e9046eb
commit aa4a3fdec9

View File

@@ -15,6 +15,7 @@ def get_first_solution(n, data):
) )
furthest_index = distance_sum["distance"].astype(float).idxmax() furthest_index = distance_sum["distance"].astype(float).idxmax()
furthest_row = distance_sum.iloc[furthest_index] furthest_row = distance_sum.iloc[furthest_index]
furthest_row["distance"] = 0
return furthest_row return furthest_row