First of all, the overall code structure of the two files appears to be very clear, readable, and well-organized, which allowed me to quickly understand what you wanted to implement. The clarity of the README, the concise comments, and the clear presentation of the final results are also very helpful.
Overall, as for the outputs of your implementation, it seems to be a very good work.
However, a self-adaptive approach to the cooling rate could be a way to improve the results, as other colleagues have also suggested to me.
What I appreciated the most was the part inside set-cover-threads.ipynb in the way you have created an automated process of selecting the best initial temperature, avoiding the need to do it manually by trial and error, speeding up the search for the optimal value for each instance.
def run_simulations(initial_solution, num_simulations=4):
"""Run simulated annealing in parallel"""
results = []
with ThreadPoolExecutor() as executor:
futures = [executor.submit(simulated_annealing, initial_solution, TEMPS[i])
for i in range(num_simulations)]
# as_completed(future) is responsible for result management
for future in tqdm(as_completed(futures), total=num_simulations):
results.append(future.result())
# Choose the best solution from all simulations
best_run = min(results, key=lambda x: x[1]) # Assuming we're minimizing the cost
return best_run
In conclusion, I really liked your overall approach. It will certainly be useful for my future labs, especially due to the clarity with which you demonstrated your implementation. I encourage you to continue in this direction!
First of all, the overall code structure of the two files appears to be very clear, readable, and well-organized, which allowed me to quickly understand what you wanted to implement. The clarity of the README, the concise comments, and the clear presentation of the final results are also very helpful.
Overall, as for the outputs of your implementation, it seems to be a very good work. However, a self-adaptive approach to the cooling rate could be a way to improve the results, as other colleagues have also suggested to me.
What I appreciated the most was the part inside set-cover-threads.ipynb in the way you have created an automated process of selecting the best initial temperature, avoiding the need to do it manually by trial and error, speeding up the search for the optimal value for each instance.
In conclusion, I really liked your overall approach. It will certainly be useful for my future labs, especially due to the clarity with which you demonstrated your implementation. I encourage you to continue in this direction!
Thank you, and have a great weekend!