updating clustering function

This commit is contained in:
Louis 2023-06-16 13:41:14 +02:00
parent d6d62d6f08
commit 375b1b91e9
2 changed files with 2 additions and 2 deletions

View File

@ -37,7 +37,7 @@ def plot_clusters(cities, clusters):
nb_ville = 100 nb_ville = 100
max_coords = 1000 max_coords = 1000
nb_truck = 4 nb_truck = 5
# Define the coordinates of the cities # Define the coordinates of the cities
# And set depot at the first city in the middle of the map # And set depot at the first city in the middle of the map

View File

@ -13,7 +13,7 @@ def split_tour_across_clusters(cities, nb_truck):
for i, label in enumerate(kmeans.labels_): for i, label in enumerate(kmeans.labels_):
clusters[label].append(i) clusters[label].append(i)
max_iterations = len(cities)**2 max_iterations = len(cities)
iteration = 0 iteration = 0
while True: while True: