|
@@ -285,17 +285,21 @@ def main():
|
|
|
scores.append(prob_scores / 100.0)
|
|
|
good_sols.append(good_solutions)
|
|
|
|
|
|
- figure, axes = plt.subplots(3, 1, True)
|
|
|
+ figure, axes = plt.subplots(3, 2, True)
|
|
|
|
|
|
for i in range(0, 3):
|
|
|
- axes[i].plot(range(1, 11), solution_steps[i], label = "Steps to Solution", color = 'b')
|
|
|
- axes[i].set_xlabel("Problem Instance w/ " + str(i + 14) + " cities")
|
|
|
- axes[i].set_ylabel("Steps Taken", color = 'b')
|
|
|
+ axes[i][0].plot(range(1, 11), solution_steps[i], label = "Steps to Solution", color = 'b')
|
|
|
+ axes[i][0].set_xlabel("Problem Instance w/ " + str(i + 14) + " cities")
|
|
|
+ axes[i][0].set_ylabel("Steps Taken", color = 'b')
|
|
|
axis_twin = axes[i].twinx()
|
|
|
axis_twin.plot(range(1, 11), solution_scores[i], label = "Solution Quality", color = 'r')
|
|
|
axis_twin.set_ylabel("Solution Quality", color = 'r')
|
|
|
|
|
|
|
|
|
+ for i in range(0, 3):
|
|
|
+ axes[i][1].plot(range(1, 11), good_sol_counts[i], color = 'b')
|
|
|
+ axes[i][1].set_xlabel("Problem Instance w/ " + str(i + 14) + " cities")
|
|
|
+ axes[i][1].set_ylabel("% of runs <= NEOS", color = 'b')
|
|
|
|
|
|
plt.savefig("hill_climbing.pdf")
|
|
|
|