diff --git a/run.py b/run.py index 39153e3..e729c22 100644 --- a/run.py +++ b/run.py @@ -3,7 +3,8 @@ import os def run(show_plots=False): - names = [name_ for name_ in os.listdir("./problems") if "tsp" in name_] + # names = [name_ for name_ in os.listdir("./problems") if "tsp" in name_] + names = ["ch130.tsp"] for name in names: print("\n\n#############################") filename = f"problems/{name}" @@ -22,4 +23,4 @@ def run(show_plots=False): if __name__ == '__main__': - run() + run(show_plots=True) diff --git a/src/TSP_solver.py b/src/TSP_solver.py index d17c2a7..93316ed 100644 --- a/src/TSP_solver.py +++ b/src/TSP_solver.py @@ -53,6 +53,7 @@ class Solver_TSP: plt.title(self.instance.name) ordered_points = self.instance.points[self.solution] plt.plot(ordered_points[:, 1], ordered_points[:, 2], 'b-') + plt.show() def check_if_solution_is_valid(self, solution): rights_values = np.sum([self.check_validation(i, solution[:-1]) for i in np.arange(self.instance.nPoints)])