diff --git a/run.py b/run.py index d09753e..3143b72 100644 --- a/run.py +++ b/run.py @@ -6,7 +6,7 @@ from time import time as t def run(show_plots=False): # names = [name_ for name_ in os.listdir("./problems") if "tsp" in name_] names = ["eil76.tsp"] - methods = ["random", "nearest_neighbors", "best_nn"] + methods = ["random", "nearest_neighbors", "best_nn", ] results = [] index = [] for name in names: diff --git a/src/TSP_solver.py b/src/TSP_solver.py index 55e11f1..994cb1e 100644 --- a/src/TSP_solver.py +++ b/src/TSP_solver.py @@ -11,7 +11,7 @@ class Solver_TSP: def __init__(self, method): self.available_methods = {"random": self.random_method, "nearest_neighbors": self.nn, - "best_nn": self.best_nn, "multi_fragment": lambda a: a } + "best_nn": self.best_nn, "multi_fragment": self.mf} self.method = method self.solved = False assert method in self.available_methods, f"the {method} method is not available currently."