Merge branch 'Test' into 'main'
Test See merge request axok/a3-algorithmique-avancee!3
This commit is contained in:
commit
42240fdab7
BIN
.assets/images/stats_52berlin_aco_0.1_to_120_secs.png
Normal file
BIN
.assets/images/stats_52berlin_aco_0.1_to_120_secs.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 82 KiB |
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
||||
*.pyc
|
||||
File diff suppressed because one or more lines are too long
85
tests/01_cluster_splitter.py
Normal file
85
tests/01_cluster_splitter.py
Normal file
@ -0,0 +1,85 @@
|
||||
from sklearn.cluster import KMeans
|
||||
import matplotlib.pyplot as plt
|
||||
import numpy as np
|
||||
import random, time
|
||||
from libs.clustering import split_tour_across_clusters
|
||||
|
||||
def generate_cities(nb, max_coords=1000):
|
||||
return [random.sample(range(max_coords), 2) for _ in range(nb)]
|
||||
|
||||
def plot_clusters(cities, clusters):
|
||||
# Création d'une liste de couleurs pour les différents clusters
|
||||
colors = [
|
||||
'#1f77b4', # Bleu moyen
|
||||
'#ff7f0e', # Orange
|
||||
'#2ca02c', # Vert
|
||||
'#d62728', # Rouge
|
||||
'#9467bd', # Violet
|
||||
'#8c564b', # Marron
|
||||
'#e377c2', # Rose
|
||||
'#7f7f7f', # Gris
|
||||
'#bcbd22', # Vert olive
|
||||
'#17becf', # Turquoise
|
||||
'#1b9e77', # Vert Teal
|
||||
'#d95f02', # Orange foncé
|
||||
'#7570b3', # Violet moyen
|
||||
'#e7298a', # Fuchsia
|
||||
'#66a61e', # Vert pomme
|
||||
'#e6ab02', # Jaune or
|
||||
'#a6761d', # Bronze
|
||||
'#666666', # Gris foncé
|
||||
'#f781bf', # Rose clair
|
||||
'#999999', # Gris moyen
|
||||
]
|
||||
|
||||
# Création d'un nouveau graphique
|
||||
plt.figure()
|
||||
|
||||
# Pour chaque cluster
|
||||
for i, cluster in clusters.items():
|
||||
# Sélection d'une couleur pour le cluster
|
||||
color = colors[i % len(colors)]
|
||||
|
||||
# Pour chaque ville dans le cluster
|
||||
for city_index in cluster:
|
||||
# Récupération des coordonnées de la ville
|
||||
city = cities[city_index]
|
||||
|
||||
# Ajout de la ville au graphique
|
||||
plt.scatter(city[0], city[1], c=color, s=20)
|
||||
|
||||
# show first city in black and twice bigger
|
||||
plt.scatter(cities[0][0], cities[0][1], c='k', s=200)
|
||||
|
||||
|
||||
# Affichage du graphique
|
||||
plt.show()
|
||||
|
||||
|
||||
nb_ville = 1000
|
||||
max_coords = 1000
|
||||
nb_truck = 2
|
||||
|
||||
# Define the coordinates of the cities
|
||||
# And set depot at the first city in the middle of the map
|
||||
start_time_generate = time.time()
|
||||
cities = generate_cities(nb_ville, max_coords)
|
||||
cities[0] = [max_coords/2, max_coords/2]
|
||||
stop_time_generate = time.time()
|
||||
|
||||
# Split the tour across clusters with nb_truck trucks
|
||||
start_time_split = time.time()
|
||||
clusters = split_tour_across_clusters(cities, nb_truck)
|
||||
stop_time_split = time.time()
|
||||
|
||||
# show the number of cities in each cluster
|
||||
for cluster in clusters.values():
|
||||
print(len(cluster))
|
||||
|
||||
# show the time
|
||||
print("\n---- TIME ----")
|
||||
print("generate cities time: ", stop_time_generate - start_time_generate)
|
||||
print("split cities time: ", stop_time_split - start_time_split)
|
||||
|
||||
# show the clusters
|
||||
plot_clusters(cities, clusters)
|
||||
101
tests/02_cluster_recuit_live_animation.py
Normal file
101
tests/02_cluster_recuit_live_animation.py
Normal file
@ -0,0 +1,101 @@
|
||||
from sklearn.cluster import KMeans
|
||||
import matplotlib.pyplot as plt
|
||||
import numpy as np
|
||||
import random, time, math
|
||||
from libs.clustering import split_tour_across_clusters
|
||||
from libs.simulated_annealing import total_distance
|
||||
|
||||
def generate_cities(nb, max_coords=1000):
|
||||
return [random.sample(range(max_coords), 2) for _ in range(nb)]
|
||||
|
||||
previous_route = None
|
||||
|
||||
def draw_cities(cities, previous_route, color='b', title=' '):
|
||||
plt.title(title)
|
||||
|
||||
# If there's a previous route, we remove it.
|
||||
if previous_route is not None:
|
||||
previous_route.remove()
|
||||
|
||||
x = [city[0] for city in cities]
|
||||
y = [city[1] for city in cities]
|
||||
x.append(x[0])
|
||||
y.append(y[0])
|
||||
|
||||
# We plot the route with the specified color and keep a reference to the Line2D object.
|
||||
previous_route, = plt.plot(x, y, color=color, marker='x', linestyle='-')
|
||||
|
||||
plt.draw()
|
||||
plt.pause(0.005)
|
||||
|
||||
# We return the reference so we can remove this route when a new one is found.
|
||||
return previous_route
|
||||
|
||||
|
||||
def simulated_annealing(cities, color='b', temperature=100000, cooling_rate=0.9999, temperature_ok=0.001):
|
||||
interration = 0
|
||||
plt.ion()
|
||||
current_solution = cities.copy()
|
||||
best_solution = cities.copy()
|
||||
previous_route = draw_cities(best_solution, None, color, 'Initial solution')
|
||||
while temperature > temperature_ok:
|
||||
new_solution = current_solution.copy()
|
||||
# Swap two cities in the route
|
||||
i = random.randint(0, len(new_solution) - 1)
|
||||
j = random.randint(0, len(new_solution) - 1)
|
||||
new_solution[i], new_solution[j] = new_solution[j], new_solution[i]
|
||||
# Calculate the acceptance probability
|
||||
current_energy = total_distance(current_solution)
|
||||
new_energy = total_distance(new_solution)
|
||||
delta = new_energy - current_energy
|
||||
if delta < 0 or random.random() < math.exp(-delta / temperature):
|
||||
current_solution = new_solution
|
||||
if total_distance(current_solution) < total_distance(best_solution):
|
||||
best_solution = current_solution
|
||||
previous_route = draw_cities(best_solution, previous_route, color, 'Current best solution, total distance = ' + str(total_distance(best_solution)) + ', iteration = ' + str(interration))
|
||||
# Cool down
|
||||
temperature *= cooling_rate
|
||||
interration += 1
|
||||
plt.ioff()
|
||||
return best_solution
|
||||
|
||||
nb_ville = 50
|
||||
max_coords = 1000
|
||||
nb_truck = 4
|
||||
temperature = 10000
|
||||
cooling_rate = 0.999
|
||||
temperature_ok = 0.000001
|
||||
|
||||
start_time_generate = time.time()
|
||||
cities = generate_cities(nb_ville, max_coords) # generate 100 cities
|
||||
cities[0] = [max_coords/2, max_coords/2] # placing depot at the center
|
||||
stop_time_generate = time.time()
|
||||
|
||||
|
||||
start_time_split = time.time()
|
||||
clusters = split_tour_across_clusters(cities, nb_truck)
|
||||
stop_time_split = time.time()
|
||||
|
||||
for cluster in clusters.values():
|
||||
print(len(cluster))
|
||||
print("\n---- TIME ----")
|
||||
print("generate cities time: ", stop_time_generate - start_time_generate)
|
||||
print("split cities time: ", stop_time_split - start_time_split)
|
||||
|
||||
# create new figure for annealing paths
|
||||
plt.figure()
|
||||
colors = ['b', 'g', 'r', 'c', 'm', 'y', 'k']
|
||||
|
||||
for i, cluster_indices in enumerate(clusters.values()):
|
||||
# Sélection d'une couleur pour le cluster
|
||||
color = colors[i % len(colors)]
|
||||
|
||||
# Récupération des coordonnées de la ville
|
||||
cluster_cities = [cities[index] for index in cluster_indices]
|
||||
|
||||
# Appel de la fonction simulated_annealing avec la couleur choisie
|
||||
best_route = simulated_annealing(cluster_cities, color, temperature, cooling_rate, temperature_ok)
|
||||
print("Final solution for cluster ", i, ":", best_route)
|
||||
print("Total distance: ", total_distance(best_route))
|
||||
|
||||
plt.show()
|
||||
80
tests/03_cluster_recuit_no_animation.py
Normal file
80
tests/03_cluster_recuit_no_animation.py
Normal file
@ -0,0 +1,80 @@
|
||||
import matplotlib.pyplot as plt
|
||||
import random, time
|
||||
from libs.clustering import split_tour_across_clusters
|
||||
from libs.simulated_annealing import SimulatedAnnealing, total_distance
|
||||
|
||||
def generate_cities(nb, max_coords=1000):
|
||||
return [random.sample(range(max_coords), 2) for _ in range(nb)]
|
||||
|
||||
nb_ville = 100
|
||||
max_coords = 1000
|
||||
nb_truck = 4
|
||||
temperature = 10000
|
||||
cooling_rate = 0.999
|
||||
temperature_ok = 0.001
|
||||
|
||||
start_time_generate = time.time()
|
||||
cities = generate_cities(nb_ville, max_coords)
|
||||
cities[0] = [max_coords/2, max_coords/2]
|
||||
stop_time_generate = time.time()
|
||||
|
||||
start_time_split = time.time()
|
||||
clusters = split_tour_across_clusters(cities, nb_truck)
|
||||
stop_time_split = time.time()
|
||||
|
||||
for cluster in clusters.values():
|
||||
print(len(cluster))
|
||||
print("\n---- TIME ----")
|
||||
print("generate cities time: ", stop_time_generate - start_time_generate)
|
||||
print("split cities time: ", stop_time_split - start_time_split)
|
||||
|
||||
# create new figure for annealing paths
|
||||
plt.figure()
|
||||
colors = [
|
||||
'#1f77b4', # Bleu moyen
|
||||
'#ff7f0e', # Orange
|
||||
'#2ca02c', # Vert
|
||||
'#d62728', # Rouge
|
||||
'#9467bd', # Violet
|
||||
'#8c564b', # Marron
|
||||
'#e377c2', # Rose
|
||||
'#7f7f7f', # Gris
|
||||
'#bcbd22', # Vert olive
|
||||
'#17becf', # Turquoise
|
||||
'#1b9e77', # Vert Teal
|
||||
'#d95f02', # Orange foncé
|
||||
'#7570b3', # Violet moyen
|
||||
'#e7298a', # Fuchsia
|
||||
'#66a61e', # Vert pomme
|
||||
'#e6ab02', # Jaune or
|
||||
'#a6761d', # Bronze
|
||||
'#666666', # Gris foncé
|
||||
'#f781bf', # Rose clair
|
||||
'#999999', # Gris moyen
|
||||
]
|
||||
|
||||
best_routes = []
|
||||
|
||||
for i, cluster_indices in enumerate(clusters.values()):
|
||||
# Sélection d'une couleur pour le cluster
|
||||
color = colors[i % len(colors)]
|
||||
|
||||
# Récupération des coordonnées de la ville
|
||||
cluster_cities = [cities[index] for index in cluster_indices]
|
||||
|
||||
# Appel de la fonction simulated_annealing
|
||||
simulated_annealing = SimulatedAnnealing(cluster_cities, temperature=10000, cooling_rate=0.999, temperature_ok=0.01)
|
||||
best_route = simulated_annealing.run()
|
||||
best_routes.append((best_route, color))
|
||||
|
||||
print("Final solution for cluster ", i, ":", best_route)
|
||||
print("Total distance: ", total_distance(best_route))
|
||||
|
||||
for i, (route, color) in enumerate(best_routes):
|
||||
x = [city[0] for city in route]
|
||||
y = [city[1] for city in route]
|
||||
x.append(x[0])
|
||||
y.append(y[0])
|
||||
plt.plot(x, y, color=color, marker='x', linestyle='-', label=f"Cluster {i}")
|
||||
plt.legend(loc="best")
|
||||
plt.show()
|
||||
142
tests/04_cluster_ant_colony_no_animation.py
Normal file
142
tests/04_cluster_ant_colony_no_animation.py
Normal file
@ -0,0 +1,142 @@
|
||||
from sklearn.cluster import KMeans
|
||||
import matplotlib.pyplot as plt
|
||||
import numpy as np
|
||||
import random, time, math
|
||||
from libs.clustering import split_tour_across_clusters
|
||||
|
||||
random.seed(3)
|
||||
|
||||
def generate_cities(nb, max_coords=1000):
|
||||
return [random.sample(range(max_coords), 2) for _ in range(nb)]
|
||||
|
||||
def distance(city1, city2):
|
||||
return math.sqrt((city1[0] - city2[0]) ** 2 + (city1[1] - city2[1]) ** 2) + 1e-10
|
||||
|
||||
def total_distance(cities):
|
||||
return sum([distance(cities[i - 1], cities[i]) for i in range(len(cities))])
|
||||
|
||||
class AntColony:
|
||||
def __init__(self, cities, n_ants, alpha=1, beta=2, evaporation=0.5, intensification=2, max_time=0.1):
|
||||
self.cities = cities
|
||||
self.n = len(cities)
|
||||
self.n_ants = n_ants
|
||||
self.alpha = alpha
|
||||
self.beta = beta
|
||||
self.evaporation = evaporation
|
||||
self.intensification = intensification
|
||||
self.max_time = max_time
|
||||
self.pheromones = [[1 / self.n for _ in range(self.n)] for __ in range(self.n)]
|
||||
|
||||
def choose_next_city(self, ant):
|
||||
unvisited_cities = [i for i in range(self.n) if i not in ant]
|
||||
probabilities = [self.pheromones[ant[-1]][i] ** self.alpha * ((1 / distance(self.cities[ant[-1]], self.cities[i])) ** self.beta) for i in unvisited_cities]
|
||||
total = sum(probabilities)
|
||||
if total == 0:
|
||||
probabilities = [1 / len(unvisited_cities) for _ in unvisited_cities]
|
||||
else:
|
||||
probabilities = [p / total for p in probabilities]
|
||||
return np.random.choice(unvisited_cities, p=probabilities)
|
||||
|
||||
def update_pheromones(self, ant):
|
||||
pheromones_delta = self.intensification / total_distance([self.cities[i] for i in ant])
|
||||
for i in range(len(ant) - 1):
|
||||
self.pheromones[ant[i]][ant[i+1]] += pheromones_delta
|
||||
|
||||
def run(self):
|
||||
best_ant = []
|
||||
best_distance = float('inf')
|
||||
start_time = time.time()
|
||||
while time.time() - start_time < self.max_time:
|
||||
ants = [[random.randint(0, self.n - 1)] for _ in range(self.n_ants)]
|
||||
for ant in ants:
|
||||
for _ in range(self.n - 1):
|
||||
ant.append(self.choose_next_city(ant))
|
||||
ant_distance = total_distance([self.cities[i] for i in ant])
|
||||
if ant_distance < best_distance:
|
||||
best_distance = ant_distance
|
||||
best_ant = ant.copy()
|
||||
self.update_pheromones(ant)
|
||||
self.pheromones = [[(1 - self.evaporation) * p for p in row] for row in self.pheromones]
|
||||
return [self.cities[i] for i in best_ant]
|
||||
|
||||
nb_ville = 50
|
||||
max_coords = 1000
|
||||
nb_truck = 2
|
||||
max_time = 3
|
||||
nb_ants = 10
|
||||
|
||||
max_time_per_cluster = max_time / nb_truck
|
||||
|
||||
start_time_generate = time.time()
|
||||
cities = generate_cities(nb_ville, max_coords)
|
||||
cities[0] = [max_coords/2, max_coords/2]
|
||||
stop_time_generate = time.time()
|
||||
|
||||
start_time_split = time.time()
|
||||
clusters = split_tour_across_clusters(cities, nb_truck)
|
||||
stop_time_split = time.time()
|
||||
|
||||
for cluster in clusters.values():
|
||||
print(len(cluster))
|
||||
print("\n---- TIME ----")
|
||||
print("generate cities time: ", stop_time_generate - start_time_generate)
|
||||
print("split cities time: ", stop_time_split - start_time_split)
|
||||
|
||||
# create new figure for annealing paths
|
||||
plt.figure()
|
||||
colors = [
|
||||
'#1f77b4', # Bleu moyen
|
||||
'#ff7f0e', # Orange
|
||||
'#2ca02c', # Vert
|
||||
'#d62728', # Rouge
|
||||
'#9467bd', # Violet
|
||||
'#8c564b', # Marron
|
||||
'#e377c2', # Rose
|
||||
'#7f7f7f', # Gris
|
||||
'#bcbd22', # Vert olive
|
||||
'#17becf', # Turquoise
|
||||
'#1b9e77', # Vert Teal
|
||||
'#d95f02', # Orange foncé
|
||||
'#7570b3', # Violet moyen
|
||||
'#e7298a', # Fuchsia
|
||||
'#66a61e', # Vert pomme
|
||||
'#e6ab02', # Jaune or
|
||||
'#a6761d', # Bronze
|
||||
'#666666', # Gris foncé
|
||||
'#f781bf', # Rose clair
|
||||
'#999999', # Gris moyen
|
||||
]
|
||||
|
||||
best_routes = []
|
||||
|
||||
for i, cluster_indices in enumerate(clusters.values()):
|
||||
# Sélection d'une couleur pour le cluster
|
||||
color = colors[i % len(colors)]
|
||||
|
||||
# Récupération des coordonnées de la ville
|
||||
cluster_cities = [cities[index] for index in cluster_indices]
|
||||
|
||||
# Appel de la fonction AntColony.run
|
||||
ant_colony = AntColony(cluster_cities, n_ants=nb_ants, max_time=max_time_per_cluster)
|
||||
best_route = ant_colony.run()
|
||||
best_routes.append((best_route, color))
|
||||
|
||||
print("Total distance for cluster", i, ": ", total_distance(best_route))
|
||||
|
||||
# calculate total distance for all clusters
|
||||
full_total_distance = 0
|
||||
for route, color in best_routes:
|
||||
full_total_distance += total_distance(route)
|
||||
|
||||
print("Total distance for all clusters: ", full_total_distance)
|
||||
|
||||
for i, (route, color) in enumerate(best_routes):
|
||||
x = [city[0] for city in route]
|
||||
y = [city[1] for city in route]
|
||||
x.append(x[0])
|
||||
y.append(y[0])
|
||||
plt.plot(x, y, color=color, marker='x', linestyle='-', label=f"Cluster {i}")
|
||||
# add title with nb_ville, nb_truck and max_time
|
||||
plt.title(f"nb_ville = {nb_ville}, nb_truck = {nb_truck}, max_time = {max_time}")
|
||||
|
||||
plt.show()
|
||||
166
tests/05_cluster_ant_colony_recuit_no_animation.py
Normal file
166
tests/05_cluster_ant_colony_recuit_no_animation.py
Normal file
@ -0,0 +1,166 @@
|
||||
from sklearn.cluster import KMeans
|
||||
import matplotlib.pyplot as plt
|
||||
import numpy as np
|
||||
import random, time, math
|
||||
from libs.clustering import split_tour_across_clusters
|
||||
|
||||
random.seed(3)
|
||||
|
||||
def generate_cities(nb, max_coords=1000):
|
||||
return [random.sample(range(max_coords), 2) for _ in range(nb)]
|
||||
|
||||
def distance(city1, city2):
|
||||
return math.sqrt((city1[0] - city2[0]) ** 2 + (city1[1] - city2[1]) ** 2) + 1e-10
|
||||
|
||||
def total_distance(cities):
|
||||
return sum([distance(cities[i - 1], cities[i]) for i in range(len(cities))])
|
||||
|
||||
class AntColony:
|
||||
def __init__(self, cities, n_ants, alpha=1, beta=2, evaporation=0.5, intensification=2, max_time=0.1):
|
||||
self.cities = cities
|
||||
self.n = len(cities)
|
||||
self.n_ants = n_ants
|
||||
self.alpha = alpha
|
||||
self.beta = beta
|
||||
self.evaporation = evaporation
|
||||
self.intensification = intensification
|
||||
self.max_time = max_time
|
||||
self.pheromones = [[1 / self.n for _ in range(self.n)] for __ in range(self.n)]
|
||||
|
||||
def choose_next_city(self, ant):
|
||||
unvisited_cities = [i for i in range(self.n) if i not in ant]
|
||||
probabilities = [self.pheromones[ant[-1]][i] ** self.alpha * ((1 / distance(self.cities[ant[-1]], self.cities[i])) ** self.beta) for i in unvisited_cities]
|
||||
total = sum(probabilities)
|
||||
if total == 0:
|
||||
probabilities = [1 / len(unvisited_cities) for _ in unvisited_cities]
|
||||
else:
|
||||
probabilities = [p / total for p in probabilities]
|
||||
return np.random.choice(unvisited_cities, p=probabilities)
|
||||
|
||||
def update_pheromones(self, ant):
|
||||
pheromones_delta = self.intensification / total_distance([self.cities[i] for i in ant])
|
||||
for i in range(len(ant) - 1):
|
||||
self.pheromones[ant[i]][ant[i+1]] += pheromones_delta
|
||||
|
||||
def run(self):
|
||||
best_ant = []
|
||||
best_distance = float('inf')
|
||||
start_time = time.time()
|
||||
while time.time() - start_time < self.max_time:
|
||||
ants = [[random.randint(0, self.n - 1)] for _ in range(self.n_ants)]
|
||||
for ant in ants:
|
||||
for _ in range(self.n - 1):
|
||||
ant.append(self.choose_next_city(ant))
|
||||
ant_distance = total_distance([self.cities[i] for i in ant])
|
||||
if ant_distance < best_distance:
|
||||
best_distance = ant_distance
|
||||
best_ant = ant.copy()
|
||||
self.update_pheromones(ant)
|
||||
self.pheromones = [[(1 - self.evaporation) * p for p in row] for row in self.pheromones]
|
||||
return [self.cities[i] for i in best_ant]
|
||||
|
||||
def simulated_annealing(cities, temperature=10000, cooling_rate=0.9999, temperature_ok=0.1):
|
||||
interration = 0
|
||||
current_solution = cities.copy()
|
||||
best_solution = cities.copy()
|
||||
while temperature > temperature_ok:
|
||||
new_solution = current_solution.copy()
|
||||
# Swap two cities in the route
|
||||
i = random.randint(0, len(new_solution) - 1)
|
||||
j = random.randint(0, len(new_solution) - 1)
|
||||
new_solution[i], new_solution[j] = new_solution[j], new_solution[i]
|
||||
# Calculate the acceptance probability
|
||||
current_energy = total_distance(current_solution)
|
||||
new_energy = total_distance(new_solution)
|
||||
delta = new_energy - current_energy
|
||||
if delta < 0 or random.random() < math.exp(-delta / temperature):
|
||||
current_solution = new_solution
|
||||
if total_distance(current_solution) < total_distance(best_solution):
|
||||
best_solution = current_solution
|
||||
# Cool down
|
||||
temperature *= cooling_rate
|
||||
interration += 1
|
||||
return best_solution
|
||||
|
||||
nb_ville = 50
|
||||
max_coords = 1000
|
||||
nb_truck = 2
|
||||
max_time = 3
|
||||
nb_ants = 10
|
||||
|
||||
max_time_per_cluster = max_time / nb_truck
|
||||
|
||||
start_time_generate = time.time()
|
||||
cities = generate_cities(nb_ville, max_coords)
|
||||
cities[0] = [max_coords/2, max_coords/2]
|
||||
stop_time_generate = time.time()
|
||||
|
||||
start_time_split = time.time()
|
||||
clusters = split_tour_across_clusters(cities, nb_truck)
|
||||
stop_time_split = time.time()
|
||||
|
||||
for cluster in clusters.values():
|
||||
print(len(cluster))
|
||||
print("\n---- TIME ----")
|
||||
print("generate cities time: ", stop_time_generate - start_time_generate)
|
||||
print("split cities time: ", stop_time_split - start_time_split)
|
||||
|
||||
# create new figure for annealing paths
|
||||
plt.figure()
|
||||
colors = [
|
||||
'#1f77b4', # Bleu moyen
|
||||
'#ff7f0e', # Orange
|
||||
'#2ca02c', # Vert
|
||||
'#d62728', # Rouge
|
||||
'#9467bd', # Violet
|
||||
'#8c564b', # Marron
|
||||
'#e377c2', # Rose
|
||||
'#7f7f7f', # Gris
|
||||
'#bcbd22', # Vert olive
|
||||
'#17becf', # Turquoise
|
||||
'#1b9e77', # Vert Teal
|
||||
'#d95f02', # Orange foncé
|
||||
'#7570b3', # Violet moyen
|
||||
'#e7298a', # Fuchsia
|
||||
'#66a61e', # Vert pomme
|
||||
'#e6ab02', # Jaune or
|
||||
'#a6761d', # Bronze
|
||||
'#666666', # Gris foncé
|
||||
'#f781bf', # Rose clair
|
||||
'#999999', # Gris moyen
|
||||
]
|
||||
|
||||
best_routes = []
|
||||
|
||||
for i, cluster_indices in enumerate(clusters.values()):
|
||||
# Sélection d'une couleur pour le cluster
|
||||
color = colors[i % len(colors)]
|
||||
|
||||
# Récupération des coordonnées de la ville
|
||||
cluster_cities = [cities[index] for index in cluster_indices]
|
||||
|
||||
# Appel de la fonction AntColony.run
|
||||
ant_colony = AntColony(cluster_cities, n_ants=nb_ants, max_time=max_time_per_cluster)
|
||||
best_route = ant_colony.run()
|
||||
best_route = simulated_annealing(best_route)
|
||||
best_routes.append((best_route, color))
|
||||
|
||||
print("Total distance for cluster", i, ": ", total_distance(best_route))
|
||||
|
||||
# calculate total distance for all clusters
|
||||
full_total_distance = 0
|
||||
for route, color in best_routes:
|
||||
full_total_distance += total_distance(route)
|
||||
|
||||
print("Total distance for all clusters: ", full_total_distance)
|
||||
|
||||
for i, (route, color) in enumerate(best_routes):
|
||||
x = [city[0] for city in route]
|
||||
y = [city[1] for city in route]
|
||||
x.append(x[0])
|
||||
y.append(y[0])
|
||||
plt.plot(x, y, color=color, marker='x', linestyle='-', label=f"Cluster {i}")
|
||||
# add title with nb_ville, nb_truck and max_time
|
||||
plt.title(f"nb_ville = {nb_ville}, nb_truck = {nb_truck}, max_time = {max_time}")
|
||||
|
||||
plt.show()
|
||||
81
tests/101_analyse_aco.py
Normal file
81
tests/101_analyse_aco.py
Normal file
@ -0,0 +1,81 @@
|
||||
from matplotlib import pyplot as plt
|
||||
from libs.aco import AntColony, total_distance
|
||||
|
||||
cities = [[37.4393516691, 541.2090699418], [612.1759508571, 494.3166877396], [38.1312338227, 353.1484581781], [53.4418081065, 131.484901365], [143.0606355347, 631.7200953923], [689.9451267256, 468.5354998742], [112.7478815786, 529.417757826], [141.4875865042, 504.818485571], [661.0513901702, 445.9375182115], [98.7899036592, 384.5926031158], [697.3881696597, 180.3962284275], [536.4894189738, 287.2279085051], [192.4067320507, 20.439405931], [282.7865258765, 229.8001556189], [240.8251726391, 281.51414372], [246.9281323057, 322.461332116], [649.7313216456, 62.3331575282], [352.96585626, 666.7873101942], [633.392367658, 534.9398453712], [488.311799404, 437.4869439948], [141.4039286509, 228.4325551488], [17.3632612602, 240.2407068508], [397.5586451389, 231.3591208928], [565.7853781464, 282.3858748974], [475.8975387047, 468.5392706317], [322.4224566559, 550.3165478233], [397.5586634023, 74.7588387765], [672.8618339396, 432.882640963], [571.2189680147, 530.261699153], [104.6531165914, 482.8224768783], [356.7098388794, 67.6477131712], [400.4070255527, 253.6794479997], [282.3036243109, 426.8380500923], [58.7766988363, 507.1712386832], [189.75062244, 460.3815233617], [659.9124120147, 226.6284156239], [639.0307636033, 467.2302300719], [415.0258357432, 233.3045376118], [547.2662016307, 161.6589278401], [616.6547902644, 339.3409309407], [494.8592427417, 148.1217856389], [629.9980812186, 433.4548164038], [471.101431241, 314.2219307579], [138.2440514421, 137.1679919735], [91.5847556724, 110.0203007516], [390.6972811808, 423.9774318385], [565.1617825137, 429.1598152874], [54.5248980387, 438.5515408431], [334.350832971, 153.796923804], [531.0291024509, 612.3874827889], [475.7345905802, 385.7844618897], [228.8325218994, 410.4461939615], [578.3805347586, 321.3303494537], [358.9170574485, 404.4670352898], [486.4648554867, 593.0429937016], [343.169370767, 509.3123571315], [530.3626972076, 137.6881275684], [498.8065475299, 576.2102674608], [224.31827155, 312.4677490415], [595.836073259, 81.8130051356], [661.5588724308, 217.0456944477], [43.6892045516, 305.4722789165], [79.465345253, 445.9641737689], [210.4163247004, 130.7151137038], [432.2642292251, 629.4092661116], [623.2487161301, 69.189285084], [436.5194739944, 282.935645607], [59.4163265482, 40.1280234442], [630.9230074073, 230.342988813], [579.3265539688, 601.0359410602], [117.862450748, 112.9796833705], [297.7912565664, 166.3131886803], [22.7642703744, 455.5340094037], [259.7095810385, 10.6199925885], [342.3579873647, 599.3880182608], [10.0260950143,
|
||||
488.9310558282], [315.2926064118, 273.2275475579], [220.7044919297, 270.0819745721], [192.1186059948, 314.1839922798], [271.5042718992, 225.2921989972], [530.7320005441, 504.0670155337], [42.5331441666, 656.3645162886], [396.1274792588, 539.4648066027], [118.6631474021, 508.7129103929], [395.6913876595, 699.5376048429], [559.0157105844, 560.8866941411], [22.6471035906, 526.2470392816], [135.6377085256, 325.8409901555], [141.4507014379, 485.2477927763], [396.7741299332, 460.7557115283], [87.7494562765, 19.6170129082], [350.4245639661, 420.6531186835], [216.7010817133, 466.4816410995], [130.9237737024, 351.1491733079], [72.6329856671, 645.7852219213], [144.6002949996, 457.4224283926], [212.3725077442, 594.9216893413], [49.9186786455, 541.4350825349], [656.6943525585, 558.1109593509], [176.5941623792, 648.5239953299], [500.3825200226, 198.7428378322], [634.317867842, 612.8291643194], [59.7537372726, 551.6321886765], [15.2145765106, 143.0441928532], [283.0054378872, 376.4439530184], [146.5389000907, 39.4231794338], [101.8685605377, 635.098685018], [588.1968537448, 580.5946976921], [457.2628632528, 350.0164047376], [537.4663680494, 472.5842276692], [269.3669098585, 367.4763636538], [239.9045383695, 102.629765339], [88.4677500396, 384.0507209275], [658.9133693395, 583.9575181023], [97.7359146347, 157.4558657632], [506.6191384007, 233.0022156094], [500.2566898239, 64.9136393489], [594.4048565021, 275.874186899], [66.230814661, 24.1317387604], [598.4162993909, 414.5557574275], [172.308833083, 344.3963466366], [299.48128518, 251.829512132], [303.8379894831, 21.052606379], [197.896926984, 512.388896098], [56.0199567669, 243.0663818382], [255.5566183121, 448.8651882442], [608.4256112402, 222.5421309272], [70.2722703273, 77.9227026433], [398.2298999899, 119.557657386], [635.4970237093, 133.3225902609], [378.3484559418, 272.2907677147], [484.8029663388, 677.0730379436], [278.8710882619, 299.9308770828], [381.6537300653, 360.3337602785], [557.6070707573, 595.3185092281], [249.0589749342, 76.6595112599], [562.9048787838, 670.0382113114], [398.550436558, 392.6493259144], [590.893972056, 370.7414913742], [558.2008003726, 0.4198814512], [461.4114714423, 530.5254969413], [354.7242881504, 685.40453619], [193.6611295657,
|
||||
669.7432521028], [352.3140807211, 140.3273323662], [308.434570974, 115.2054269847], [299.588137008, 530.588961902], [334.2748764383, 152.1494569394], [690.9658585947, 134.5793307203], [48.0798124069, 270.968067372], [91.6467647724, 166.3541158474]]
|
||||
optimal = 6528
|
||||
|
||||
n_ants = 10
|
||||
alpha = 1
|
||||
beta = 2
|
||||
evaporation = 0.5
|
||||
intensification = 2
|
||||
max_times = [1, 2, 5]
|
||||
iterations = 2
|
||||
|
||||
best_distances = []
|
||||
times = []
|
||||
colors = [
|
||||
'#1f77b4', # Bleu moyen
|
||||
'#ff7f0e', # Orange
|
||||
'#2ca02c', # Vert
|
||||
'#d62728', # Rouge
|
||||
'#9467bd', # Violet
|
||||
'#8c564b', # Marron
|
||||
'#e377c2', # Rose
|
||||
'#7f7f7f', # Gris
|
||||
'#bcbd22', # Vert olive
|
||||
'#17becf', # Turquoise
|
||||
'#1b9e77', # Vert Teal
|
||||
'#d95f02', # Orange foncé
|
||||
'#7570b3', # Violet moyen
|
||||
'#e7298a', # Fuchsia
|
||||
'#66a61e', # Vert pomme
|
||||
'#e6ab02', # Jaune or
|
||||
'#a6761d', # Bronze
|
||||
'#666666', # Gris foncé
|
||||
'#f781bf', # Rose clair
|
||||
'#999999', # Gris moyen
|
||||
]
|
||||
|
||||
for max_time in max_times:
|
||||
for iteration in range(iterations):
|
||||
ant_colony = AntColony(cities, n_ants, alpha, beta, evaporation, intensification, max_time)
|
||||
print("Running iteration number {}/{} ({} sec)".format(iteration + 1, iterations, max_time))
|
||||
best_route = ant_colony.run()
|
||||
best_distances.append([total_distance(best_route), colors[max_times.index(max_time) % len(colors)]])
|
||||
times.append(max_time)
|
||||
|
||||
title = ""
|
||||
title += "Best distance per iterations\n"
|
||||
title += "Ants: " + str(n_ants) + " "
|
||||
title += "Alpja: " + str(alpha) + " "
|
||||
title += "Beta: " + str(beta) + " "
|
||||
title += "Evaporation: " + str(evaporation) + " "
|
||||
title += "Intensification: " + str(intensification) + " "
|
||||
title += "Max time: " + str(max_time)
|
||||
plt.title(title)
|
||||
plt.xlabel('Iteration')
|
||||
plt.ylabel('Distance')
|
||||
plt.axhline(y=optimal, color='r')
|
||||
|
||||
distances = [x[0] for x in best_distances] # Extractions des valeurs
|
||||
|
||||
max_dist = max(distances)
|
||||
plt.ylim(0, max_dist+max_dist*0.2)
|
||||
|
||||
values = [item[0] for item in best_distances]
|
||||
colors = [item[1] for item in best_distances]
|
||||
|
||||
bars = plt.bar(range(len(values)), values, color=colors)
|
||||
|
||||
for i, bar in enumerate(bars):
|
||||
yval = bar.get_height()
|
||||
plt.text(bar.get_x() + bar.get_width()/2, yval + 0.05,
|
||||
"dist: {}\ntime: {}s".format(int(yval), times[i]),
|
||||
rotation=75, ha='center', va='bottom')
|
||||
|
||||
plt.xticks(range(len(values)), [str(i+1) for i in range(len(values))])
|
||||
|
||||
plt.show()
|
||||
75
tests/102_analyse_simulated_annealing.py
Normal file
75
tests/102_analyse_simulated_annealing.py
Normal file
@ -0,0 +1,75 @@
|
||||
from matplotlib import pyplot as plt
|
||||
from libs.simulated_annealing import SimulatedAnnealing, total_distance
|
||||
|
||||
cities = [[6734, 1453], [2233, 10], [5530, 1424], [401, 841], [3082, 1644], [7608, 4458], [7573, 3716], [7265, 1268], [6898, 1885], [1112, 2049], [5468, 2606], [5989, 2873], [4706, 2674], [4612, 2035], [6347, 2683], [6107, 669], [7611, 5184], [7462, 3590], [7732, 4723], [5900, 3561], [4483, 3369], [6101, 1110], [5199, 2182], [1633, 2809], [4307, 2322], [675, 1006], [7555, 4819], [7541, 3981], [3177, 756], [7352, 4506], [7545, 2801], [3245, 3305], [6426, 3173], [4608, 1198], [23, 2216], [7248, 3779], [7762, 4595], [7392, 2244], [3484, 2829], [6271, 2135], [4985, 140], [1916, 1569], [7280, 4899], [7509, 3239], [10, 2676], [6807, 2993], [5185, 3258], [3023, 1942]]
|
||||
optimal = 33523
|
||||
|
||||
temperatures = [100000, 1000000, 10000000, 100000000]
|
||||
cooling_rate = 0.99999
|
||||
temperature_ok = 0.000001
|
||||
iterations = 2
|
||||
|
||||
best_distances = []
|
||||
temps = []
|
||||
colors = [
|
||||
'#1f77b4', # Bleu moyen
|
||||
'#ff7f0e', # Orange
|
||||
'#2ca02c', # Vert
|
||||
'#d62728', # Rouge
|
||||
'#9467bd', # Violet
|
||||
'#8c564b', # Marron
|
||||
'#e377c2', # Rose
|
||||
'#7f7f7f', # Gris
|
||||
'#bcbd22', # Vert olive
|
||||
'#17becf', # Turquoise
|
||||
'#1b9e77', # Vert Teal
|
||||
'#d95f02', # Orange foncé
|
||||
'#7570b3', # Violet moyen
|
||||
'#e7298a', # Fuchsia
|
||||
'#66a61e', # Vert pomme
|
||||
'#e6ab02', # Jaune or
|
||||
'#a6761d', # Bronze
|
||||
'#666666', # Gris foncé
|
||||
'#f781bf', # Rose clair
|
||||
'#999999', # Gris moyen
|
||||
]
|
||||
|
||||
for temperature in temperatures:
|
||||
for iteration in range(iterations):
|
||||
simulated_annealing = SimulatedAnnealing(cities, temperature=temperature, cooling_rate=0.999, temperature_ok=0.01)
|
||||
print("Running iteration number {}/{} ({} temperature)".format(iteration + 1, iterations, temperature))
|
||||
best_route = simulated_annealing.run()
|
||||
best_distances.append([total_distance(best_route), colors[temperatures.index(temperature) % len(colors)]])
|
||||
temps.append(temperature)
|
||||
|
||||
title = ""
|
||||
title += "Best distance per iterations\n"
|
||||
title += "Temperature: " + str(temperature) + " "
|
||||
title += "Cooling rate: " + str(cooling_rate) + " "
|
||||
title += "Temperature ok: " + str(temperature_ok) + " "
|
||||
plt.title(title)
|
||||
plt.xlabel('Iteration')
|
||||
plt.ylabel('Distance')
|
||||
plt.axhline(y=optimal, color='r')
|
||||
|
||||
distances = [x[0] for x in best_distances] # Extractions des valeurs
|
||||
|
||||
for best_distance in best_distances:
|
||||
print(best_distance)
|
||||
max_dist = max(distances)
|
||||
plt.ylim(0, max_dist+max_dist*0.2)
|
||||
|
||||
values = [item[0] for item in best_distances]
|
||||
colors = [item[1] for item in best_distances]
|
||||
|
||||
bars = plt.bar(range(len(values)), values, color=colors)
|
||||
|
||||
for i, bar in enumerate(bars):
|
||||
yval = bar.get_height()
|
||||
plt.text(bar.get_x() + bar.get_width()/2, yval + 0.05,
|
||||
"dist: {}\ntime: {}s".format(int(yval), temps[i]),
|
||||
rotation=75, ha='center', va='bottom')
|
||||
|
||||
plt.xticks(range(len(values)), [str(i+1) for i in range(len(values))])
|
||||
|
||||
plt.show()
|
||||
3
tests/data_sample/150_cities_minimum_6528.txt
Normal file
3
tests/data_sample/150_cities_minimum_6528.txt
Normal file
@ -0,0 +1,3 @@
|
||||
[[37.4393516691, 541.2090699418], [612.1759508571, 494.3166877396], [38.1312338227, 353.1484581781], [53.4418081065, 131.484901365], [143.0606355347, 631.7200953923], [689.9451267256, 468.5354998742], [112.7478815786, 529.417757826], [141.4875865042, 504.818485571], [661.0513901702, 445.9375182115], [98.7899036592, 384.5926031158], [697.3881696597, 180.3962284275], [536.4894189738, 287.2279085051], [192.4067320507, 20.439405931], [282.7865258765, 229.8001556189], [240.8251726391, 281.51414372], [246.9281323057, 322.461332116], [649.7313216456, 62.3331575282], [352.96585626, 666.7873101942], [633.392367658, 534.9398453712], [488.311799404, 437.4869439948], [141.4039286509, 228.4325551488], [17.3632612602, 240.2407068508], [397.5586451389, 231.3591208928], [565.7853781464, 282.3858748974], [475.8975387047, 468.5392706317], [322.4224566559, 550.3165478233], [397.5586634023, 74.7588387765], [672.8618339396, 432.882640963], [571.2189680147, 530.261699153], [104.6531165914, 482.8224768783], [356.7098388794, 67.6477131712], [400.4070255527, 253.6794479997], [282.3036243109, 426.8380500923], [58.7766988363, 507.1712386832], [189.75062244, 460.3815233617], [659.9124120147, 226.6284156239], [639.0307636033, 467.2302300719], [415.0258357432, 233.3045376118], [547.2662016307, 161.6589278401], [616.6547902644, 339.3409309407], [494.8592427417, 148.1217856389], [629.9980812186, 433.4548164038], [471.101431241, 314.2219307579], [138.2440514421, 137.1679919735], [91.5847556724, 110.0203007516], [390.6972811808, 423.9774318385], [565.1617825137, 429.1598152874], [54.5248980387, 438.5515408431], [334.350832971, 153.796923804], [531.0291024509, 612.3874827889], [475.7345905802, 385.7844618897], [228.8325218994, 410.4461939615], [578.3805347586, 321.3303494537], [358.9170574485, 404.4670352898], [486.4648554867, 593.0429937016], [343.169370767, 509.3123571315], [530.3626972076, 137.6881275684], [498.8065475299, 576.2102674608], [224.31827155, 312.4677490415], [595.836073259, 81.8130051356], [661.5588724308, 217.0456944477], [43.6892045516, 305.4722789165], [79.465345253, 445.9641737689], [210.4163247004, 130.7151137038], [432.2642292251, 629.4092661116], [623.2487161301, 69.189285084], [436.5194739944, 282.935645607], [59.4163265482, 40.1280234442], [630.9230074073, 230.342988813], [579.3265539688, 601.0359410602], [117.862450748, 112.9796833705], [297.7912565664, 166.3131886803], [22.7642703744, 455.5340094037], [259.7095810385, 10.6199925885], [342.3579873647, 599.3880182608], [10.0260950143,
|
||||
488.9310558282], [315.2926064118, 273.2275475579], [220.7044919297, 270.0819745721], [192.1186059948, 314.1839922798], [271.5042718992, 225.2921989972], [530.7320005441, 504.0670155337], [42.5331441666, 656.3645162886], [396.1274792588, 539.4648066027], [118.6631474021, 508.7129103929], [395.6913876595, 699.5376048429], [559.0157105844, 560.8866941411], [22.6471035906, 526.2470392816], [135.6377085256, 325.8409901555], [141.4507014379, 485.2477927763], [396.7741299332, 460.7557115283], [87.7494562765, 19.6170129082], [350.4245639661, 420.6531186835], [216.7010817133, 466.4816410995], [130.9237737024, 351.1491733079], [72.6329856671, 645.7852219213], [144.6002949996, 457.4224283926], [212.3725077442, 594.9216893413], [49.9186786455, 541.4350825349], [656.6943525585, 558.1109593509], [176.5941623792, 648.5239953299], [500.3825200226, 198.7428378322], [634.317867842, 612.8291643194], [59.7537372726, 551.6321886765], [15.2145765106, 143.0441928532], [283.0054378872, 376.4439530184], [146.5389000907, 39.4231794338], [101.8685605377, 635.098685018], [588.1968537448, 580.5946976921], [457.2628632528, 350.0164047376], [537.4663680494, 472.5842276692], [269.3669098585, 367.4763636538], [239.9045383695, 102.629765339], [88.4677500396, 384.0507209275], [658.9133693395, 583.9575181023], [97.7359146347, 157.4558657632], [506.6191384007, 233.0022156094], [500.2566898239, 64.9136393489], [594.4048565021, 275.874186899], [66.230814661, 24.1317387604], [598.4162993909, 414.5557574275], [172.308833083, 344.3963466366], [299.48128518, 251.829512132], [303.8379894831, 21.052606379], [197.896926984, 512.388896098], [56.0199567669, 243.0663818382], [255.5566183121, 448.8651882442], [608.4256112402, 222.5421309272], [70.2722703273, 77.9227026433], [398.2298999899, 119.557657386], [635.4970237093, 133.3225902609], [378.3484559418, 272.2907677147], [484.8029663388, 677.0730379436], [278.8710882619, 299.9308770828], [381.6537300653, 360.3337602785], [557.6070707573, 595.3185092281], [249.0589749342, 76.6595112599], [562.9048787838, 670.0382113114], [398.550436558, 392.6493259144], [590.893972056, 370.7414913742], [558.2008003726, 0.4198814512], [461.4114714423, 530.5254969413], [354.7242881504, 685.40453619], [193.6611295657,
|
||||
669.7432521028], [352.3140807211, 140.3273323662], [308.434570974, 115.2054269847], [299.588137008, 530.588961902], [334.2748764383, 152.1494569394], [690.9658585947, 134.5793307203], [48.0798124069, 270.968067372], [91.6467647724, 166.3541158474]]
|
||||
1
tests/data_sample/15_cities_minimum_284.txt
Normal file
1
tests/data_sample/15_cities_minimum_284.txt
Normal file
@ -0,0 +1 @@
|
||||
[[-0.0, 0.0], [-21.5, -7.3], [-28.9, -0.0], [-43.1, -14.6], [-50.5, -7.4], [-64.7, -21.9], [-72.1, -0.2], [-79.3, 21.4], [-65.1, 36.1], [-57.6, 43.3], [-50.6, 21.6], [-36.0, 21.6], [-29.1, 43.2], [-14.7, 43.4], [-0.1, 28.7], [-0.0, 0.0]]
|
||||
1
tests/data_sample/48_cities_minimum_33523.txt
Normal file
1
tests/data_sample/48_cities_minimum_33523.txt
Normal file
@ -0,0 +1 @@
|
||||
[['6734', '1453'], ['2233', '10'], ['5530', '1424'], ['401', '841'], ['3082', '1644'], ['7608', '4458'], ['7573', '3716'], ['7265', '1268'], ['6898', '1885'], ['1112', '2049'], ['5468', '2606'], ['5989', '2873'], ['4706', '2674'], ['4612', '2035'], ['6347', '2683'], ['6107', '669'], ['7611', '5184'], ['7462', '3590'], ['7732', '4723'], ['5900', '3561'], ['4483', '3369'], ['6101', '1110'], ['5199', '2182'], ['1633', '2809'], ['4307', '2322'], ['675', '1006'], ['7555', '4819'], ['7541', '3981'], ['3177', '756'], ['7352', '4506'], ['7545', '2801'], ['3245', '3305'], ['6426', '3173'], ['4608', '1198'], ['23', '2216'], ['7248', '3779'], ['7762', '4595'], ['7392', '2244'], ['3484', '2829'], ['6271', '2135'], ['4985', '140'], ['1916', '1569'], ['7280', '4899'], ['7509', '3239'], ['10', '2676'], ['6807', '2993'], ['5185', '3258'], ['3023', '1942']]
|
||||
3
tests/data_sample/76_cities_minimum_538.txt
Normal file
3
tests/data_sample/76_cities_minimum_538.txt
Normal file
@ -0,0 +1,3 @@
|
||||
[['22', '22'], ['36', '26'], ['21', '45'], ['45', '35'], ['55', '20'], ['33', '34'], ['50', '50'], ['55', '45'], ['26', '59'], ['40', '66'], ['55', '65'], ['35', '51'], ['62', '35'], ['62', '57'], ['62', '24'], ['21', '36'], ['33', '44'], ['9', '56'], ['62', '48'], ['66', '14'],
|
||||
['44', '13'], ['26', '13'], ['11', '28'], ['7', '43'], ['17', '64'], ['41', '46'], ['55', '34'], ['35', '16'], ['52', '26'], ['43', '26'], ['31', '76'], ['22', '53'], ['26', '29'], ['50', '40'], ['55', '50'], ['54', '10'], ['60', '15'], ['47', '66'], ['30', '60'], ['30', '50'], ['12', '17'], ['15', '14'], ['16', '19'], ['21', '48'], ['50', '30'], ['51', '42'], ['50', '15'], ['48', '21'], ['12', '38'], ['15', '56'], ['29', '39'], ['54', '38'], ['55', '57'], ['67', '41'], ['10', '70'], ['6', '25'], ['65', '27'], ['40', '60'], ['70', '64'], ['64', '4'], ['36', '6'], ['30', '20'], ['20', '30'], ['15', '5'], ['50', '70'], ['57', '72'], ['45', '42'], ['38', '33'], ['50', '4'], ['66', '8'], ['59',
|
||||
'5'], ['35', '60'], ['27', '24'], ['40', '20'], ['40', '37'], ['40', '40']]
|
||||
BIN
tests/data_sample/ALL_tsp/a280.opt.tour.gz
Normal file
BIN
tests/data_sample/ALL_tsp/a280.opt.tour.gz
Normal file
Binary file not shown.
287
tests/data_sample/ALL_tsp/a280.tsp
Normal file
287
tests/data_sample/ALL_tsp/a280.tsp
Normal file
@ -0,0 +1,287 @@
|
||||
NAME : a280
|
||||
COMMENT : drilling problem (Ludwig)
|
||||
TYPE : TSP
|
||||
DIMENSION: 280
|
||||
EDGE_WEIGHT_TYPE : EUC_2D
|
||||
NODE_COORD_SECTION
|
||||
1 288 149
|
||||
2 288 129
|
||||
3 270 133
|
||||
4 256 141
|
||||
5 256 157
|
||||
6 246 157
|
||||
7 236 169
|
||||
8 228 169
|
||||
9 228 161
|
||||
10 220 169
|
||||
11 212 169
|
||||
12 204 169
|
||||
13 196 169
|
||||
14 188 169
|
||||
15 196 161
|
||||
16 188 145
|
||||
17 172 145
|
||||
18 164 145
|
||||
19 156 145
|
||||
20 148 145
|
||||
21 140 145
|
||||
22 148 169
|
||||
23 164 169
|
||||
24 172 169
|
||||
25 156 169
|
||||
26 140 169
|
||||
27 132 169
|
||||
28 124 169
|
||||
29 116 161
|
||||
30 104 153
|
||||
31 104 161
|
||||
32 104 169
|
||||
33 90 165
|
||||
34 80 157
|
||||
35 64 157
|
||||
36 64 165
|
||||
37 56 169
|
||||
38 56 161
|
||||
39 56 153
|
||||
40 56 145
|
||||
41 56 137
|
||||
42 56 129
|
||||
43 56 121
|
||||
44 40 121
|
||||
45 40 129
|
||||
46 40 137
|
||||
47 40 145
|
||||
48 40 153
|
||||
49 40 161
|
||||
50 40 169
|
||||
51 32 169
|
||||
52 32 161
|
||||
53 32 153
|
||||
54 32 145
|
||||
55 32 137
|
||||
56 32 129
|
||||
57 32 121
|
||||
58 32 113
|
||||
59 40 113
|
||||
60 56 113
|
||||
61 56 105
|
||||
62 48 99
|
||||
63 40 99
|
||||
64 32 97
|
||||
65 32 89
|
||||
66 24 89
|
||||
67 16 97
|
||||
68 16 109
|
||||
69 8 109
|
||||
70 8 97
|
||||
71 8 89
|
||||
72 8 81
|
||||
73 8 73
|
||||
74 8 65
|
||||
75 8 57
|
||||
76 16 57
|
||||
77 8 49
|
||||
78 8 41
|
||||
79 24 45
|
||||
80 32 41
|
||||
81 32 49
|
||||
82 32 57
|
||||
83 32 65
|
||||
84 32 73
|
||||
85 32 81
|
||||
86 40 83
|
||||
87 40 73
|
||||
88 40 63
|
||||
89 40 51
|
||||
90 44 43
|
||||
91 44 35
|
||||
92 44 27
|
||||
93 32 25
|
||||
94 24 25
|
||||
95 16 25
|
||||
96 16 17
|
||||
97 24 17
|
||||
98 32 17
|
||||
99 44 11
|
||||
100 56 9
|
||||
101 56 17
|
||||
102 56 25
|
||||
103 56 33
|
||||
104 56 41
|
||||
105 64 41
|
||||
106 72 41
|
||||
107 72 49
|
||||
108 56 49
|
||||
109 48 51
|
||||
110 56 57
|
||||
111 56 65
|
||||
112 48 63
|
||||
113 48 73
|
||||
114 56 73
|
||||
115 56 81
|
||||
116 48 83
|
||||
117 56 89
|
||||
118 56 97
|
||||
119 104 97
|
||||
120 104 105
|
||||
121 104 113
|
||||
122 104 121
|
||||
123 104 129
|
||||
124 104 137
|
||||
125 104 145
|
||||
126 116 145
|
||||
127 124 145
|
||||
128 132 145
|
||||
129 132 137
|
||||
130 140 137
|
||||
131 148 137
|
||||
132 156 137
|
||||
133 164 137
|
||||
134 172 125
|
||||
135 172 117
|
||||
136 172 109
|
||||
137 172 101
|
||||
138 172 93
|
||||
139 172 85
|
||||
140 180 85
|
||||
141 180 77
|
||||
142 180 69
|
||||
143 180 61
|
||||
144 180 53
|
||||
145 172 53
|
||||
146 172 61
|
||||
147 172 69
|
||||
148 172 77
|
||||
149 164 81
|
||||
150 148 85
|
||||
151 124 85
|
||||
152 124 93
|
||||
153 124 109
|
||||
154 124 125
|
||||
155 124 117
|
||||
156 124 101
|
||||
157 104 89
|
||||
158 104 81
|
||||
159 104 73
|
||||
160 104 65
|
||||
161 104 49
|
||||
162 104 41
|
||||
163 104 33
|
||||
164 104 25
|
||||
165 104 17
|
||||
166 92 9
|
||||
167 80 9
|
||||
168 72 9
|
||||
169 64 21
|
||||
170 72 25
|
||||
171 80 25
|
||||
172 80 25
|
||||
173 80 41
|
||||
174 88 49
|
||||
175 104 57
|
||||
176 124 69
|
||||
177 124 77
|
||||
178 132 81
|
||||
179 140 65
|
||||
180 132 61
|
||||
181 124 61
|
||||
182 124 53
|
||||
183 124 45
|
||||
184 124 37
|
||||
185 124 29
|
||||
186 132 21
|
||||
187 124 21
|
||||
188 120 9
|
||||
189 128 9
|
||||
190 136 9
|
||||
191 148 9
|
||||
192 162 9
|
||||
193 156 25
|
||||
194 172 21
|
||||
195 180 21
|
||||
196 180 29
|
||||
197 172 29
|
||||
198 172 37
|
||||
199 172 45
|
||||
200 180 45
|
||||
201 180 37
|
||||
202 188 41
|
||||
203 196 49
|
||||
204 204 57
|
||||
205 212 65
|
||||
206 220 73
|
||||
207 228 69
|
||||
208 228 77
|
||||
209 236 77
|
||||
210 236 69
|
||||
211 236 61
|
||||
212 228 61
|
||||
213 228 53
|
||||
214 236 53
|
||||
215 236 45
|
||||
216 228 45
|
||||
217 228 37
|
||||
218 236 37
|
||||
219 236 29
|
||||
220 228 29
|
||||
221 228 21
|
||||
222 236 21
|
||||
223 252 21
|
||||
224 260 29
|
||||
225 260 37
|
||||
226 260 45
|
||||
227 260 53
|
||||
228 260 61
|
||||
229 260 69
|
||||
230 260 77
|
||||
231 276 77
|
||||
232 276 69
|
||||
233 276 61
|
||||
234 276 53
|
||||
235 284 53
|
||||
236 284 61
|
||||
237 284 69
|
||||
238 284 77
|
||||
239 284 85
|
||||
240 284 93
|
||||
241 284 101
|
||||
242 288 109
|
||||
243 280 109
|
||||
244 276 101
|
||||
245 276 93
|
||||
246 276 85
|
||||
247 268 97
|
||||
248 260 109
|
||||
249 252 101
|
||||
250 260 93
|
||||
251 260 85
|
||||
252 236 85
|
||||
253 228 85
|
||||
254 228 93
|
||||
255 236 93
|
||||
256 236 101
|
||||
257 228 101
|
||||
258 228 109
|
||||
259 228 117
|
||||
260 228 125
|
||||
261 220 125
|
||||
262 212 117
|
||||
263 204 109
|
||||
264 196 101
|
||||
265 188 93
|
||||
266 180 93
|
||||
267 180 101
|
||||
268 180 109
|
||||
269 180 117
|
||||
270 180 125
|
||||
271 196 145
|
||||
272 204 145
|
||||
273 212 145
|
||||
274 220 145
|
||||
275 228 145
|
||||
276 236 145
|
||||
277 246 141
|
||||
278 252 125
|
||||
279 260 129
|
||||
280 280 133
|
||||
EOF
|
||||
BIN
tests/data_sample/ALL_tsp/a280.tsp.gz
Normal file
BIN
tests/data_sample/ALL_tsp/a280.tsp.gz
Normal file
Binary file not shown.
BIN
tests/data_sample/ALL_tsp/ali535.tsp.gz
Normal file
BIN
tests/data_sample/ALL_tsp/ali535.tsp.gz
Normal file
Binary file not shown.
BIN
tests/data_sample/ALL_tsp/att48.opt.tour.gz
Normal file
BIN
tests/data_sample/ALL_tsp/att48.opt.tour.gz
Normal file
Binary file not shown.
BIN
tests/data_sample/ALL_tsp/att48.tsp.gz
Normal file
BIN
tests/data_sample/ALL_tsp/att48.tsp.gz
Normal file
Binary file not shown.
BIN
tests/data_sample/ALL_tsp/att532.tsp.gz
Normal file
BIN
tests/data_sample/ALL_tsp/att532.tsp.gz
Normal file
Binary file not shown.
58
tests/data_sample/ALL_tsp/berlin52.opt.tour
Normal file
58
tests/data_sample/ALL_tsp/berlin52.opt.tour
Normal file
@ -0,0 +1,58 @@
|
||||
NAME : berlin52.opt.tour
|
||||
TYPE : TOUR
|
||||
DIMENSION : 52
|
||||
TOUR_SECTION
|
||||
1
|
||||
49
|
||||
32
|
||||
45
|
||||
19
|
||||
41
|
||||
8
|
||||
9
|
||||
10
|
||||
43
|
||||
33
|
||||
51
|
||||
11
|
||||
52
|
||||
14
|
||||
13
|
||||
47
|
||||
26
|
||||
27
|
||||
28
|
||||
12
|
||||
25
|
||||
4
|
||||
6
|
||||
15
|
||||
5
|
||||
24
|
||||
48
|
||||
38
|
||||
37
|
||||
40
|
||||
39
|
||||
36
|
||||
35
|
||||
34
|
||||
44
|
||||
46
|
||||
16
|
||||
29
|
||||
50
|
||||
20
|
||||
23
|
||||
30
|
||||
2
|
||||
7
|
||||
42
|
||||
21
|
||||
17
|
||||
3
|
||||
18
|
||||
31
|
||||
22
|
||||
-1
|
||||
EOF
|
||||
BIN
tests/data_sample/ALL_tsp/berlin52.opt.tour.gz
Normal file
BIN
tests/data_sample/ALL_tsp/berlin52.opt.tour.gz
Normal file
Binary file not shown.
60
tests/data_sample/ALL_tsp/berlin52.tsp
Normal file
60
tests/data_sample/ALL_tsp/berlin52.tsp
Normal file
@ -0,0 +1,60 @@
|
||||
NAME: berlin52
|
||||
TYPE: TSP
|
||||
COMMENT: 52 locations in Berlin (Groetschel)
|
||||
DIMENSION: 52
|
||||
EDGE_WEIGHT_TYPE: EUC_2D
|
||||
NODE_COORD_SECTION
|
||||
1 565.0 575.0
|
||||
2 25.0 185.0
|
||||
3 345.0 750.0
|
||||
4 945.0 685.0
|
||||
5 845.0 655.0
|
||||
6 880.0 660.0
|
||||
7 25.0 230.0
|
||||
8 525.0 1000.0
|
||||
9 580.0 1175.0
|
||||
10 650.0 1130.0
|
||||
11 1605.0 620.0
|
||||
12 1220.0 580.0
|
||||
13 1465.0 200.0
|
||||
14 1530.0 5.0
|
||||
15 845.0 680.0
|
||||
16 725.0 370.0
|
||||
17 145.0 665.0
|
||||
18 415.0 635.0
|
||||
19 510.0 875.0
|
||||
20 560.0 365.0
|
||||
21 300.0 465.0
|
||||
22 520.0 585.0
|
||||
23 480.0 415.0
|
||||
24 835.0 625.0
|
||||
25 975.0 580.0
|
||||
26 1215.0 245.0
|
||||
27 1320.0 315.0
|
||||
28 1250.0 400.0
|
||||
29 660.0 180.0
|
||||
30 410.0 250.0
|
||||
31 420.0 555.0
|
||||
32 575.0 665.0
|
||||
33 1150.0 1160.0
|
||||
34 700.0 580.0
|
||||
35 685.0 595.0
|
||||
36 685.0 610.0
|
||||
37 770.0 610.0
|
||||
38 795.0 645.0
|
||||
39 720.0 635.0
|
||||
40 760.0 650.0
|
||||
41 475.0 960.0
|
||||
42 95.0 260.0
|
||||
43 875.0 920.0
|
||||
44 700.0 500.0
|
||||
45 555.0 815.0
|
||||
46 830.0 485.0
|
||||
47 1170.0 65.0
|
||||
48 830.0 610.0
|
||||
49 605.0 625.0
|
||||
50 595.0 360.0
|
||||
51 1340.0 725.0
|
||||
52 1740.0 245.0
|
||||
EOF
|
||||
|
||||
BIN
tests/data_sample/ALL_tsp/berlin52.tsp.gz
Normal file
BIN
tests/data_sample/ALL_tsp/berlin52.tsp.gz
Normal file
Binary file not shown.
BIN
tests/data_sample/ALL_tsp/bier127.tsp.gz
Normal file
BIN
tests/data_sample/ALL_tsp/bier127.tsp.gz
Normal file
Binary file not shown.
BIN
tests/data_sample/ALL_tsp/brazil58.tsp.gz
Normal file
BIN
tests/data_sample/ALL_tsp/brazil58.tsp.gz
Normal file
Binary file not shown.
BIN
tests/data_sample/ALL_tsp/brd14051.tsp.gz
Normal file
BIN
tests/data_sample/ALL_tsp/brd14051.tsp.gz
Normal file
Binary file not shown.
BIN
tests/data_sample/ALL_tsp/brg180.opt.tour.gz
Normal file
BIN
tests/data_sample/ALL_tsp/brg180.opt.tour.gz
Normal file
Binary file not shown.
BIN
tests/data_sample/ALL_tsp/brg180.tsp.gz
Normal file
BIN
tests/data_sample/ALL_tsp/brg180.tsp.gz
Normal file
Binary file not shown.
BIN
tests/data_sample/ALL_tsp/burma14.tsp.gz
Normal file
BIN
tests/data_sample/ALL_tsp/burma14.tsp.gz
Normal file
Binary file not shown.
BIN
tests/data_sample/ALL_tsp/ch130.opt.tour.gz
Normal file
BIN
tests/data_sample/ALL_tsp/ch130.opt.tour.gz
Normal file
Binary file not shown.
BIN
tests/data_sample/ALL_tsp/ch130.tsp.gz
Normal file
BIN
tests/data_sample/ALL_tsp/ch130.tsp.gz
Normal file
Binary file not shown.
BIN
tests/data_sample/ALL_tsp/ch150.opt.tour.gz
Normal file
BIN
tests/data_sample/ALL_tsp/ch150.opt.tour.gz
Normal file
Binary file not shown.
157
tests/data_sample/ALL_tsp/ch150.tsp
Normal file
157
tests/data_sample/ALL_tsp/ch150.tsp
Normal file
@ -0,0 +1,157 @@
|
||||
NAME: ch150
|
||||
TYPE: TSP
|
||||
COMMENT: 150 city Problem (churritz)
|
||||
DIMENSION: 150
|
||||
EDGE_WEIGHT_TYPE: EUC_2D
|
||||
NODE_COORD_SECTION
|
||||
1 37.4393516691 541.2090699418
|
||||
2 612.1759508571 494.3166877396
|
||||
3 38.1312338227 353.1484581781
|
||||
4 53.4418081065 131.4849013650
|
||||
5 143.0606355347 631.7200953923
|
||||
6 689.9451267256 468.5354998742
|
||||
7 112.7478815786 529.4177578260
|
||||
8 141.4875865042 504.8184855710
|
||||
9 661.0513901702 445.9375182115
|
||||
10 98.7899036592 384.5926031158
|
||||
11 697.3881696597 180.3962284275
|
||||
12 536.4894189738 287.2279085051
|
||||
13 192.4067320507 20.4394059310
|
||||
14 282.7865258765 229.8001556189
|
||||
15 240.8251726391 281.5141437200
|
||||
16 246.9281323057 322.4613321160
|
||||
17 649.7313216456 62.3331575282
|
||||
18 352.9658562600 666.7873101942
|
||||
19 633.3923676580 534.9398453712
|
||||
20 488.3117994040 437.4869439948
|
||||
21 141.4039286509 228.4325551488
|
||||
22 17.3632612602 240.2407068508
|
||||
23 397.5586451389 231.3591208928
|
||||
24 565.7853781464 282.3858748974
|
||||
25 475.8975387047 468.5392706317
|
||||
26 322.4224566559 550.3165478233
|
||||
27 397.5586634023 74.7588387765
|
||||
28 672.8618339396 432.8826409630
|
||||
29 571.2189680147 530.2616991530
|
||||
30 104.6531165914 482.8224768783
|
||||
31 356.7098388794 67.6477131712
|
||||
32 400.4070255527 253.6794479997
|
||||
33 282.3036243109 426.8380500923
|
||||
34 58.7766988363 507.1712386832
|
||||
35 189.7506224400 460.3815233617
|
||||
36 659.9124120147 226.6284156239
|
||||
37 639.0307636033 467.2302300719
|
||||
38 415.0258357432 233.3045376118
|
||||
39 547.2662016307 161.6589278401
|
||||
40 616.6547902644 339.3409309407
|
||||
41 494.8592427417 148.1217856389
|
||||
42 629.9980812186 433.4548164038
|
||||
43 471.1014312410 314.2219307579
|
||||
44 138.2440514421 137.1679919735
|
||||
45 91.5847556724 110.0203007516
|
||||
46 390.6972811808 423.9774318385
|
||||
47 565.1617825137 429.1598152874
|
||||
48 54.5248980387 438.5515408431
|
||||
49 334.3508329710 153.7969238040
|
||||
50 531.0291024509 612.3874827889
|
||||
51 475.7345905802 385.7844618897
|
||||
52 228.8325218994 410.4461939615
|
||||
53 578.3805347586 321.3303494537
|
||||
54 358.9170574485 404.4670352898
|
||||
55 486.4648554867 593.0429937016
|
||||
56 343.1693707670 509.3123571315
|
||||
57 530.3626972076 137.6881275684
|
||||
58 498.8065475299 576.2102674608
|
||||
59 224.3182715500 312.4677490415
|
||||
60 595.8360732590 81.8130051356
|
||||
61 661.5588724308 217.0456944477
|
||||
62 43.6892045516 305.4722789165
|
||||
63 79.4653452530 445.9641737689
|
||||
64 210.4163247004 130.7151137038
|
||||
65 432.2642292251 629.4092661116
|
||||
66 623.2487161301 69.1892850840
|
||||
67 436.5194739944 282.9356456070
|
||||
68 59.4163265482 40.1280234442
|
||||
69 630.9230074073 230.3429888130
|
||||
70 579.3265539688 601.0359410602
|
||||
71 117.8624507480 112.9796833705
|
||||
72 297.7912565664 166.3131886803
|
||||
73 22.7642703744 455.5340094037
|
||||
74 259.7095810385 10.6199925885
|
||||
75 342.3579873647 599.3880182608
|
||||
76 10.0260950143 488.9310558282
|
||||
77 315.2926064118 273.2275475579
|
||||
78 220.7044919297 270.0819745721
|
||||
79 192.1186059948 314.1839922798
|
||||
80 271.5042718992 225.2921989972
|
||||
81 530.7320005441 504.0670155337
|
||||
82 42.5331441666 656.3645162886
|
||||
83 396.1274792588 539.4648066027
|
||||
84 118.6631474021 508.7129103929
|
||||
85 395.6913876595 699.5376048429
|
||||
86 559.0157105844 560.8866941411
|
||||
87 22.6471035906 526.2470392816
|
||||
88 135.6377085256 325.8409901555
|
||||
89 141.4507014379 485.2477927763
|
||||
90 396.7741299332 460.7557115283
|
||||
91 87.7494562765 19.6170129082
|
||||
92 350.4245639661 420.6531186835
|
||||
93 216.7010817133 466.4816410995
|
||||
94 130.9237737024 351.1491733079
|
||||
95 72.6329856671 645.7852219213
|
||||
96 144.6002949996 457.4224283926
|
||||
97 212.3725077442 594.9216893413
|
||||
98 49.9186786455 541.4350825349
|
||||
99 656.6943525585 558.1109593509
|
||||
100 176.5941623792 648.5239953299
|
||||
101 500.3825200226 198.7428378322
|
||||
102 634.3178678420 612.8291643194
|
||||
103 59.7537372726 551.6321886765
|
||||
104 15.2145765106 143.0441928532
|
||||
105 283.0054378872 376.4439530184
|
||||
106 146.5389000907 39.4231794338
|
||||
107 101.8685605377 635.0986850180
|
||||
108 588.1968537448 580.5946976921
|
||||
109 457.2628632528 350.0164047376
|
||||
110 537.4663680494 472.5842276692
|
||||
111 269.3669098585 367.4763636538
|
||||
112 239.9045383695 102.6297653390
|
||||
113 88.4677500396 384.0507209275
|
||||
114 658.9133693395 583.9575181023
|
||||
115 97.7359146347 157.4558657632
|
||||
116 506.6191384007 233.0022156094
|
||||
117 500.2566898239 64.9136393489
|
||||
118 594.4048565021 275.8741868990
|
||||
119 66.2308146610 24.1317387604
|
||||
120 598.4162993909 414.5557574275
|
||||
121 172.3088330830 344.3963466366
|
||||
122 299.4812851800 251.8295121320
|
||||
123 303.8379894831 21.0526063790
|
||||
124 197.8969269840 512.3888960980
|
||||
125 56.0199567669 243.0663818382
|
||||
126 255.5566183121 448.8651882442
|
||||
127 608.4256112402 222.5421309272
|
||||
128 70.2722703273 77.9227026433
|
||||
129 398.2298999899 119.5576573860
|
||||
130 635.4970237093 133.3225902609
|
||||
131 378.3484559418 272.2907677147
|
||||
132 484.8029663388 677.0730379436
|
||||
133 278.8710882619 299.9308770828
|
||||
134 381.6537300653 360.3337602785
|
||||
135 557.6070707573 595.3185092281
|
||||
136 249.0589749342 76.6595112599
|
||||
137 562.9048787838 670.0382113114
|
||||
138 398.5504365580 392.6493259144
|
||||
139 590.8939720560 370.7414913742
|
||||
140 558.2008003726 0.4198814512
|
||||
141 461.4114714423 530.5254969413
|
||||
142 354.7242881504 685.4045361900
|
||||
143 193.6611295657 669.7432521028
|
||||
144 352.3140807211 140.3273323662
|
||||
145 308.4345709740 115.2054269847
|
||||
146 299.5881370080 530.5889619020
|
||||
147 334.2748764383 152.1494569394
|
||||
148 690.9658585947 134.5793307203
|
||||
149 48.0798124069 270.9680673720
|
||||
150 91.6467647724 166.3541158474
|
||||
EOF
|
||||
BIN
tests/data_sample/ALL_tsp/ch150.tsp.gz
Normal file
BIN
tests/data_sample/ALL_tsp/ch150.tsp.gz
Normal file
Binary file not shown.
BIN
tests/data_sample/ALL_tsp/d1291.tsp.gz
Normal file
BIN
tests/data_sample/ALL_tsp/d1291.tsp.gz
Normal file
Binary file not shown.
BIN
tests/data_sample/ALL_tsp/d15112.tsp.gz
Normal file
BIN
tests/data_sample/ALL_tsp/d15112.tsp.gz
Normal file
Binary file not shown.
BIN
tests/data_sample/ALL_tsp/d1655.tsp.gz
Normal file
BIN
tests/data_sample/ALL_tsp/d1655.tsp.gz
Normal file
Binary file not shown.
BIN
tests/data_sample/ALL_tsp/d18512.tsp.gz
Normal file
BIN
tests/data_sample/ALL_tsp/d18512.tsp.gz
Normal file
Binary file not shown.
BIN
tests/data_sample/ALL_tsp/d198.tsp.gz
Normal file
BIN
tests/data_sample/ALL_tsp/d198.tsp.gz
Normal file
Binary file not shown.
BIN
tests/data_sample/ALL_tsp/d2103.tsp.gz
Normal file
BIN
tests/data_sample/ALL_tsp/d2103.tsp.gz
Normal file
Binary file not shown.
BIN
tests/data_sample/ALL_tsp/d493.tsp.gz
Normal file
BIN
tests/data_sample/ALL_tsp/d493.tsp.gz
Normal file
Binary file not shown.
BIN
tests/data_sample/ALL_tsp/d657.tsp.gz
Normal file
BIN
tests/data_sample/ALL_tsp/d657.tsp.gz
Normal file
Binary file not shown.
BIN
tests/data_sample/ALL_tsp/dantzig42.tsp.gz
Normal file
BIN
tests/data_sample/ALL_tsp/dantzig42.tsp.gz
Normal file
Binary file not shown.
BIN
tests/data_sample/ALL_tsp/dsj1000.tsp.gz
Normal file
BIN
tests/data_sample/ALL_tsp/dsj1000.tsp.gz
Normal file
Binary file not shown.
BIN
tests/data_sample/ALL_tsp/eil101.opt.tour.gz
Normal file
BIN
tests/data_sample/ALL_tsp/eil101.opt.tour.gz
Normal file
Binary file not shown.
BIN
tests/data_sample/ALL_tsp/eil101.tsp.gz
Normal file
BIN
tests/data_sample/ALL_tsp/eil101.tsp.gz
Normal file
Binary file not shown.
BIN
tests/data_sample/ALL_tsp/eil51.opt.tour.gz
Normal file
BIN
tests/data_sample/ALL_tsp/eil51.opt.tour.gz
Normal file
Binary file not shown.
BIN
tests/data_sample/ALL_tsp/eil51.tsp.gz
Normal file
BIN
tests/data_sample/ALL_tsp/eil51.tsp.gz
Normal file
Binary file not shown.
BIN
tests/data_sample/ALL_tsp/eil76.opt.tour.gz
Normal file
BIN
tests/data_sample/ALL_tsp/eil76.opt.tour.gz
Normal file
Binary file not shown.
83
tests/data_sample/ALL_tsp/eil76.tsp
Normal file
83
tests/data_sample/ALL_tsp/eil76.tsp
Normal file
@ -0,0 +1,83 @@
|
||||
NAME : eil76
|
||||
COMMENT : 76-city problem (Christofides/Eilon)
|
||||
TYPE : TSP
|
||||
DIMENSION : 76
|
||||
EDGE_WEIGHT_TYPE : EUC_2D
|
||||
NODE_COORD_SECTION
|
||||
1 22 22
|
||||
2 36 26
|
||||
3 21 45
|
||||
4 45 35
|
||||
5 55 20
|
||||
6 33 34
|
||||
7 50 50
|
||||
8 55 45
|
||||
9 26 59
|
||||
10 40 66
|
||||
11 55 65
|
||||
12 35 51
|
||||
13 62 35
|
||||
14 62 57
|
||||
15 62 24
|
||||
16 21 36
|
||||
17 33 44
|
||||
18 9 56
|
||||
19 62 48
|
||||
20 66 14
|
||||
21 44 13
|
||||
22 26 13
|
||||
23 11 28
|
||||
24 7 43
|
||||
25 17 64
|
||||
26 41 46
|
||||
27 55 34
|
||||
28 35 16
|
||||
29 52 26
|
||||
30 43 26
|
||||
31 31 76
|
||||
32 22 53
|
||||
33 26 29
|
||||
34 50 40
|
||||
35 55 50
|
||||
36 54 10
|
||||
37 60 15
|
||||
38 47 66
|
||||
39 30 60
|
||||
40 30 50
|
||||
41 12 17
|
||||
42 15 14
|
||||
43 16 19
|
||||
44 21 48
|
||||
45 50 30
|
||||
46 51 42
|
||||
47 50 15
|
||||
48 48 21
|
||||
49 12 38
|
||||
50 15 56
|
||||
51 29 39
|
||||
52 54 38
|
||||
53 55 57
|
||||
54 67 41
|
||||
55 10 70
|
||||
56 6 25
|
||||
57 65 27
|
||||
58 40 60
|
||||
59 70 64
|
||||
60 64 4
|
||||
61 36 6
|
||||
62 30 20
|
||||
63 20 30
|
||||
64 15 5
|
||||
65 50 70
|
||||
66 57 72
|
||||
67 45 42
|
||||
68 38 33
|
||||
69 50 4
|
||||
70 66 8
|
||||
71 59 5
|
||||
72 35 60
|
||||
73 27 24
|
||||
74 40 20
|
||||
75 40 37
|
||||
76 40 40
|
||||
EOF
|
||||
BIN
tests/data_sample/ALL_tsp/eil76.tsp.gz
Normal file
BIN
tests/data_sample/ALL_tsp/eil76.tsp.gz
Normal file
Binary file not shown.
BIN
tests/data_sample/ALL_tsp/fl1400.tsp.gz
Normal file
BIN
tests/data_sample/ALL_tsp/fl1400.tsp.gz
Normal file
Binary file not shown.
BIN
tests/data_sample/ALL_tsp/fl1577.tsp.gz
Normal file
BIN
tests/data_sample/ALL_tsp/fl1577.tsp.gz
Normal file
Binary file not shown.
BIN
tests/data_sample/ALL_tsp/fl3795.tsp.gz
Normal file
BIN
tests/data_sample/ALL_tsp/fl3795.tsp.gz
Normal file
Binary file not shown.
BIN
tests/data_sample/ALL_tsp/fl417.tsp.gz
Normal file
BIN
tests/data_sample/ALL_tsp/fl417.tsp.gz
Normal file
Binary file not shown.
BIN
tests/data_sample/ALL_tsp/fnl4461.tsp.gz
Normal file
BIN
tests/data_sample/ALL_tsp/fnl4461.tsp.gz
Normal file
Binary file not shown.
BIN
tests/data_sample/ALL_tsp/fri26.opt.tour.gz
Normal file
BIN
tests/data_sample/ALL_tsp/fri26.opt.tour.gz
Normal file
Binary file not shown.
362
tests/data_sample/ALL_tsp/fri26.tsp
Normal file
362
tests/data_sample/ALL_tsp/fri26.tsp
Normal file
@ -0,0 +1,362 @@
|
||||
NAME: fri26
|
||||
TYPE: TSP
|
||||
COMMENT: 26 Staedte (Fricker)
|
||||
DIMENSION: 26
|
||||
EDGE_WEIGHT_TYPE: EXPLICIT
|
||||
EDGE_WEIGHT_FORMAT: LOWER_DIAG_ROW
|
||||
EDGE_WEIGHT_SECTION
|
||||
0
|
||||
83
|
||||
0
|
||||
93
|
||||
40
|
||||
0
|
||||
129
|
||||
53
|
||||
42
|
||||
0
|
||||
133
|
||||
62
|
||||
42
|
||||
11
|
||||
0
|
||||
139
|
||||
64
|
||||
49
|
||||
11
|
||||
9
|
||||
0
|
||||
151
|
||||
91
|
||||
59
|
||||
46
|
||||
35
|
||||
39
|
||||
0
|
||||
169
|
||||
116
|
||||
81
|
||||
72
|
||||
61
|
||||
65
|
||||
26
|
||||
0
|
||||
135
|
||||
93
|
||||
54
|
||||
65
|
||||
55
|
||||
63
|
||||
34
|
||||
37
|
||||
0
|
||||
114
|
||||
84
|
||||
44
|
||||
70
|
||||
62
|
||||
71
|
||||
52
|
||||
59
|
||||
22
|
||||
0
|
||||
110
|
||||
95
|
||||
58
|
||||
88
|
||||
82
|
||||
90
|
||||
71
|
||||
75
|
||||
39
|
||||
20
|
||||
0
|
||||
98
|
||||
98
|
||||
64
|
||||
100
|
||||
95
|
||||
103
|
||||
88
|
||||
92
|
||||
56
|
||||
36
|
||||
18
|
||||
0
|
||||
99
|
||||
89
|
||||
54
|
||||
89
|
||||
84
|
||||
92
|
||||
77
|
||||
83
|
||||
47
|
||||
26
|
||||
11
|
||||
11
|
||||
0
|
||||
95
|
||||
68
|
||||
31
|
||||
66
|
||||
62
|
||||
71
|
||||
63
|
||||
76
|
||||
40
|
||||
20
|
||||
27
|
||||
34
|
||||
23
|
||||
0
|
||||
81
|
||||
67
|
||||
36
|
||||
76
|
||||
74
|
||||
82
|
||||
78
|
||||
91
|
||||
55
|
||||
34
|
||||
32
|
||||
31
|
||||
24
|
||||
15
|
||||
0
|
||||
152
|
||||
127
|
||||
86
|
||||
102
|
||||
93
|
||||
100
|
||||
66
|
||||
54
|
||||
37
|
||||
43
|
||||
42
|
||||
56
|
||||
53
|
||||
62
|
||||
73
|
||||
0
|
||||
159
|
||||
156
|
||||
117
|
||||
142
|
||||
133
|
||||
141
|
||||
110
|
||||
98
|
||||
78
|
||||
74
|
||||
61
|
||||
63
|
||||
68
|
||||
87
|
||||
92
|
||||
44
|
||||
0
|
||||
181
|
||||
175
|
||||
135
|
||||
156
|
||||
146
|
||||
153
|
||||
119
|
||||
103
|
||||
91
|
||||
91
|
||||
80
|
||||
85
|
||||
89
|
||||
106
|
||||
112
|
||||
54
|
||||
22
|
||||
0
|
||||
172
|
||||
152
|
||||
112
|
||||
127
|
||||
117
|
||||
124
|
||||
88
|
||||
70
|
||||
62
|
||||
68
|
||||
64
|
||||
75
|
||||
74
|
||||
87
|
||||
96
|
||||
26
|
||||
34
|
||||
33
|
||||
0
|
||||
185
|
||||
165
|
||||
125
|
||||
139
|
||||
128
|
||||
135
|
||||
98
|
||||
78
|
||||
74
|
||||
82
|
||||
77
|
||||
87
|
||||
87
|
||||
100
|
||||
109
|
||||
39
|
||||
38
|
||||
29
|
||||
13
|
||||
0
|
||||
147
|
||||
160
|
||||
124
|
||||
155
|
||||
148
|
||||
156
|
||||
130
|
||||
122
|
||||
96
|
||||
86
|
||||
68
|
||||
62
|
||||
71
|
||||
93
|
||||
93
|
||||
68
|
||||
30
|
||||
46
|
||||
63
|
||||
68
|
||||
0
|
||||
157
|
||||
180
|
||||
147
|
||||
180
|
||||
173
|
||||
181
|
||||
156
|
||||
148
|
||||
122
|
||||
111
|
||||
92
|
||||
83
|
||||
93
|
||||
116
|
||||
113
|
||||
94
|
||||
53
|
||||
64
|
||||
87
|
||||
90
|
||||
26
|
||||
0
|
||||
185
|
||||
223
|
||||
193
|
||||
228
|
||||
222
|
||||
230
|
||||
206
|
||||
198
|
||||
172
|
||||
160
|
||||
140
|
||||
129
|
||||
140
|
||||
163
|
||||
158
|
||||
144
|
||||
102
|
||||
107
|
||||
135
|
||||
136
|
||||
77
|
||||
50
|
||||
0
|
||||
220
|
||||
268
|
||||
241
|
||||
278
|
||||
272
|
||||
280
|
||||
257
|
||||
250
|
||||
223
|
||||
210
|
||||
190
|
||||
178
|
||||
189
|
||||
212
|
||||
205
|
||||
196
|
||||
154
|
||||
157
|
||||
186
|
||||
186
|
||||
128
|
||||
102
|
||||
51
|
||||
0
|
||||
127
|
||||
179
|
||||
157
|
||||
197
|
||||
194
|
||||
202
|
||||
188
|
||||
188
|
||||
155
|
||||
136
|
||||
116
|
||||
100
|
||||
111
|
||||
132
|
||||
122
|
||||
139
|
||||
109
|
||||
125
|
||||
141
|
||||
148
|
||||
80
|
||||
65
|
||||
64
|
||||
93
|
||||
0
|
||||
181
|
||||
197
|
||||
161
|
||||
190
|
||||
182
|
||||
190
|
||||
160
|
||||
148
|
||||
128
|
||||
121
|
||||
103
|
||||
99
|
||||
107
|
||||
130
|
||||
130
|
||||
95
|
||||
51
|
||||
51
|
||||
81
|
||||
79
|
||||
37
|
||||
27
|
||||
58
|
||||
107
|
||||
90
|
||||
0
|
||||
EOF
|
||||
|
||||
|
||||
|
||||
BIN
tests/data_sample/ALL_tsp/fri26.tsp.gz
Normal file
BIN
tests/data_sample/ALL_tsp/fri26.tsp.gz
Normal file
Binary file not shown.
BIN
tests/data_sample/ALL_tsp/gil262.tsp.gz
Normal file
BIN
tests/data_sample/ALL_tsp/gil262.tsp.gz
Normal file
Binary file not shown.
BIN
tests/data_sample/ALL_tsp/gr120.opt.tour.gz
Normal file
BIN
tests/data_sample/ALL_tsp/gr120.opt.tour.gz
Normal file
Binary file not shown.
BIN
tests/data_sample/ALL_tsp/gr120.tsp.gz
Normal file
BIN
tests/data_sample/ALL_tsp/gr120.tsp.gz
Normal file
Binary file not shown.
BIN
tests/data_sample/ALL_tsp/gr137.tsp.gz
Normal file
BIN
tests/data_sample/ALL_tsp/gr137.tsp.gz
Normal file
Binary file not shown.
21
tests/data_sample/ALL_tsp/gr17.tsp
Normal file
21
tests/data_sample/ALL_tsp/gr17.tsp
Normal file
@ -0,0 +1,21 @@
|
||||
NAME: gr17
|
||||
TYPE: TSP
|
||||
COMMENT: 17-city problem (Groetschel)
|
||||
DIMENSION: 17
|
||||
EDGE_WEIGHT_TYPE: EXPLICIT
|
||||
EDGE_WEIGHT_FORMAT: LOWER_DIAG_ROW
|
||||
EDGE_WEIGHT_SECTION
|
||||
0 633 0 257 390 0 91 661 228 0 412 227
|
||||
169 383 0 150 488 112 120 267 0 80 572 196
|
||||
77 351 63 0 134 530 154 105 309 34 29 0
|
||||
259 555 372 175 338 264 232 249 0 505 289 262
|
||||
476 196 360 444 402 495 0 353 282 110 324 61
|
||||
208 292 250 352 154 0 324 638 437 240 421 329
|
||||
297 314 95 578 435 0 70 567 191 27 346 83
|
||||
47 68 189 439 287 254 0 211 466 74 182 243
|
||||
105 150 108 326 336 184 391 145 0 268 420 53
|
||||
239 199 123 207 165 383 240 140 448 202 57 0
|
||||
246 745 472 237 528 364 332 349 202 685 542 157
|
||||
289 426 483 0 121 518 142 84 297 35 29 36
|
||||
236 390 238 301 55 96 153 336 0
|
||||
EOF
|
||||
BIN
tests/data_sample/ALL_tsp/gr17.tsp.gz
Normal file
BIN
tests/data_sample/ALL_tsp/gr17.tsp.gz
Normal file
Binary file not shown.
BIN
tests/data_sample/ALL_tsp/gr202.opt.tour.gz
Normal file
BIN
tests/data_sample/ALL_tsp/gr202.opt.tour.gz
Normal file
Binary file not shown.
BIN
tests/data_sample/ALL_tsp/gr202.tsp.gz
Normal file
BIN
tests/data_sample/ALL_tsp/gr202.tsp.gz
Normal file
Binary file not shown.
BIN
tests/data_sample/ALL_tsp/gr21.tsp.gz
Normal file
BIN
tests/data_sample/ALL_tsp/gr21.tsp.gz
Normal file
Binary file not shown.
BIN
tests/data_sample/ALL_tsp/gr229.tsp.gz
Normal file
BIN
tests/data_sample/ALL_tsp/gr229.tsp.gz
Normal file
Binary file not shown.
BIN
tests/data_sample/ALL_tsp/gr24.opt.tour.gz
Normal file
BIN
tests/data_sample/ALL_tsp/gr24.opt.tour.gz
Normal file
Binary file not shown.
33
tests/data_sample/ALL_tsp/gr24.tsp
Normal file
33
tests/data_sample/ALL_tsp/gr24.tsp
Normal file
@ -0,0 +1,33 @@
|
||||
NAME: gr24
|
||||
TYPE: TSP
|
||||
COMMENT: 24-city problem (Groetschel)
|
||||
DIMENSION: 24
|
||||
EDGE_WEIGHT_TYPE: EXPLICIT
|
||||
EDGE_WEIGHT_FORMAT: LOWER_DIAG_ROW
|
||||
EDGE_WEIGHT_SECTION
|
||||
0 257 0 187 196 0 91 228 158 0 150 112
|
||||
96 120 0 80 196 88 77 63 0 130 167 59
|
||||
101 56 25 0 134 154 63 105 34 29 22 0
|
||||
243 209 286 159 190 216 229 225 0 185 86 124
|
||||
156 40 124 95 82 207 0 214 223 49 185 123
|
||||
115 86 90 313 151 0 70 191 121 27 83 47
|
||||
64 68 173 119 148 0 272 180 315 188 193 245
|
||||
258 228 29 159 342 209 0 219 83 172 149 79
|
||||
139 134 112 126 62 199 153 97 0 293 50 232
|
||||
264 148 232 203 190 248 122 259 227 219 134 0
|
||||
54 219 92 82 119 31 43 58 238 147 84 53
|
||||
267 170 255 0 211 74 81 182 105 150 121 108
|
||||
310 37 160 145 196 99 125 173 0 290 139 98
|
||||
261 144 176 164 136 389 116 147 224 275 178 154
|
||||
190 79 0 268 53 138 239 123 207 178 165 367
|
||||
86 187 202 227 130 68 230 57 86 0 261 43
|
||||
200 232 98 200 171 131 166 90 227 195 137 69
|
||||
82 223 90 176 90 0 175 128 76 146 32 76
|
||||
47 30 222 56 103 109 225 104 164 99 57 112
|
||||
114 134 0 250 99 89 221 105 189 160 147 349
|
||||
76 138 184 235 138 114 212 39 40 46 136 96
|
||||
0 192 228 235 108 119 165 178 154 71 136 262
|
||||
110 74 96 264 187 182 261 239 165 151 221 0
|
||||
121 142 99 84 35 29 42 36 220 70 126 55
|
||||
249 104 178 60 96 175 153 146 47 135 169 0
|
||||
EOF
|
||||
BIN
tests/data_sample/ALL_tsp/gr24.tsp.gz
Normal file
BIN
tests/data_sample/ALL_tsp/gr24.tsp.gz
Normal file
Binary file not shown.
BIN
tests/data_sample/ALL_tsp/gr431.tsp.gz
Normal file
BIN
tests/data_sample/ALL_tsp/gr431.tsp.gz
Normal file
Binary file not shown.
BIN
tests/data_sample/ALL_tsp/gr48.opt.tour.gz
Normal file
BIN
tests/data_sample/ALL_tsp/gr48.opt.tour.gz
Normal file
Binary file not shown.
BIN
tests/data_sample/ALL_tsp/gr48.tsp.gz
Normal file
BIN
tests/data_sample/ALL_tsp/gr48.tsp.gz
Normal file
Binary file not shown.
BIN
tests/data_sample/ALL_tsp/gr666.opt.tour.gz
Normal file
BIN
tests/data_sample/ALL_tsp/gr666.opt.tour.gz
Normal file
Binary file not shown.
BIN
tests/data_sample/ALL_tsp/gr666.tsp.gz
Normal file
BIN
tests/data_sample/ALL_tsp/gr666.tsp.gz
Normal file
Binary file not shown.
BIN
tests/data_sample/ALL_tsp/gr96.opt.tour.gz
Normal file
BIN
tests/data_sample/ALL_tsp/gr96.opt.tour.gz
Normal file
Binary file not shown.
BIN
tests/data_sample/ALL_tsp/gr96.tsp.gz
Normal file
BIN
tests/data_sample/ALL_tsp/gr96.tsp.gz
Normal file
Binary file not shown.
BIN
tests/data_sample/ALL_tsp/hk48.tsp.gz
Normal file
BIN
tests/data_sample/ALL_tsp/hk48.tsp.gz
Normal file
Binary file not shown.
BIN
tests/data_sample/ALL_tsp/kroA100.opt.tour.gz
Normal file
BIN
tests/data_sample/ALL_tsp/kroA100.opt.tour.gz
Normal file
Binary file not shown.
BIN
tests/data_sample/ALL_tsp/kroA100.tsp.gz
Normal file
BIN
tests/data_sample/ALL_tsp/kroA100.tsp.gz
Normal file
Binary file not shown.
BIN
tests/data_sample/ALL_tsp/kroA150.tsp.gz
Normal file
BIN
tests/data_sample/ALL_tsp/kroA150.tsp.gz
Normal file
Binary file not shown.
BIN
tests/data_sample/ALL_tsp/kroA200.tsp.gz
Normal file
BIN
tests/data_sample/ALL_tsp/kroA200.tsp.gz
Normal file
Binary file not shown.
BIN
tests/data_sample/ALL_tsp/kroB100.tsp.gz
Normal file
BIN
tests/data_sample/ALL_tsp/kroB100.tsp.gz
Normal file
Binary file not shown.
BIN
tests/data_sample/ALL_tsp/kroB150.tsp.gz
Normal file
BIN
tests/data_sample/ALL_tsp/kroB150.tsp.gz
Normal file
Binary file not shown.
BIN
tests/data_sample/ALL_tsp/kroB200.tsp.gz
Normal file
BIN
tests/data_sample/ALL_tsp/kroB200.tsp.gz
Normal file
Binary file not shown.
BIN
tests/data_sample/ALL_tsp/kroC100.opt.tour.gz
Normal file
BIN
tests/data_sample/ALL_tsp/kroC100.opt.tour.gz
Normal file
Binary file not shown.
BIN
tests/data_sample/ALL_tsp/kroC100.tsp.gz
Normal file
BIN
tests/data_sample/ALL_tsp/kroC100.tsp.gz
Normal file
Binary file not shown.
BIN
tests/data_sample/ALL_tsp/kroD100.opt.tour.gz
Normal file
BIN
tests/data_sample/ALL_tsp/kroD100.opt.tour.gz
Normal file
Binary file not shown.
BIN
tests/data_sample/ALL_tsp/kroD100.tsp.gz
Normal file
BIN
tests/data_sample/ALL_tsp/kroD100.tsp.gz
Normal file
Binary file not shown.
BIN
tests/data_sample/ALL_tsp/kroE100.tsp.gz
Normal file
BIN
tests/data_sample/ALL_tsp/kroE100.tsp.gz
Normal file
Binary file not shown.
BIN
tests/data_sample/ALL_tsp/lin105.opt.tour.gz
Normal file
BIN
tests/data_sample/ALL_tsp/lin105.opt.tour.gz
Normal file
Binary file not shown.
BIN
tests/data_sample/ALL_tsp/lin105.tsp.gz
Normal file
BIN
tests/data_sample/ALL_tsp/lin105.tsp.gz
Normal file
Binary file not shown.
BIN
tests/data_sample/ALL_tsp/lin318.tsp.gz
Normal file
BIN
tests/data_sample/ALL_tsp/lin318.tsp.gz
Normal file
Binary file not shown.
BIN
tests/data_sample/ALL_tsp/linhp318.tsp.gz
Normal file
BIN
tests/data_sample/ALL_tsp/linhp318.tsp.gz
Normal file
Binary file not shown.
BIN
tests/data_sample/ALL_tsp/nrw1379.tsp.gz
Normal file
BIN
tests/data_sample/ALL_tsp/nrw1379.tsp.gz
Normal file
Binary file not shown.
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user