updating clustering function
This commit is contained in:
parent
d6d62d6f08
commit
375b1b91e9
@ -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
|
||||||
|
|||||||
@ -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:
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user