Set initial distance to 0 in the greedy algorithm

This commit is contained in:
coolneng 2021-04-15 20:51:02 +02:00
parent 193e9046eb
commit aa4a3fdec9
Signed by: coolneng
GPG Key ID: 9893DA236405AF57
1 changed files with 1 additions and 0 deletions

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