|
@@ -210,7 +210,7 @@ def beck_weathers(cities, opt):
|
|
|
# 1 = hill climbing, 2 = tabu/sideways allowed, 3 = random restarts, 4 = annealing
|
|
|
# x represents the optional parameters for 3 and 4
|
|
|
# specifically, the # of restarts and the annealing schedule, respectively
|
|
|
-def solver(problem, algo, x):
|
|
|
+def solver(problem, algo, *x):
|
|
|
# import map
|
|
|
prob = problem
|
|
|
with open(prob) as file:
|
|
@@ -251,7 +251,6 @@ def solver(problem, algo, x):
|
|
|
def main():
|
|
|
plt.ioff()
|
|
|
plt.switch_backend('agg')
|
|
|
- solver("instance_10.txt", 1, 0)
|
|
|
solution_steps = []
|
|
|
solution_scores = []
|
|
|
|
|
@@ -285,7 +284,7 @@ def main():
|
|
|
axis_twin.plot(range(1, 11), solution_scores[i], label = "Solution Cost/Distance")
|
|
|
axis_twin.set_ylabel("Distance in units")
|
|
|
|
|
|
- axes.legend()
|
|
|
+ #axes.legend()
|
|
|
plt.savefig("hill_climbing.pdf")
|
|
|
|
|
|
main()
|