The statement

Given a set of power plants and clients, we had to optimize the profit. Power gets drained depending on the distance it needs to travel, clients don’t pay the same (not all of them are requiered to be served) and power plants costs depend on their size.

To solve the problem, we were asked to use Hill Climbing and Simulated Annealing.

The full statement below (in Spanish).

Our solution

Together with @JCasahuga and @XBLOYT, we used AIMA library and we determined the initial state, the operands as well as the heuristic function.

During the projects we saw how the initial states and operands could effect the reached states and therefore the results of our program. Also creating a good heuristic function was important in order to improve the final earnings of our fictional company.

In the end starting with a lot of different initial states and applying bot Hill Climbing and Simulated Annealing with an heuristic function based on the profit (which needed to be optimally updated across the steps) was what gave us the best result.

Final report (in Catalan).

Project’s code on Github