# Design Optimization of a District Heating Network Expansion, a Case Study for the Town of Kiruna
## 3 Methodology
### The Optimization Algorithm  
The multi-objective optimization problem defined in the previous section was performed by the evolutionary optimization algorithm proposed in [13], which was particularly suitable to distribute the population of solutions along the optimal Pareto front, thanks to its original diversity-preserving mechanism.  
The flowchart of the multi-objective evolutionary algorithm was sketched in Figure 5. A set (old population) of design solutions is available at the beginning of each iteration (generation) of the algorithm (the old population is randomly initialized before the first iteration). A pool of parent pairs that are selected at random from the old population is formed, and genetic mathematical operators (crossover and mutation) are applied to the decision variables of the pairs in this pool to create a new set of candidate design solutions (offspring population).  
It is worth noting that in this specific application of the algorithm, the design solutions that were apparently unfeasible (e.g., there are pipes with dead ends, or user areas not served), were automatically removed from the offspring population in order to avoid their evaluation and, therefore, save computational time.  
The investment and operating costs associated with a given candidate solution were evaluated by simulating the expanded network model with the piping configuration and the capacity of the new bio-oil boiler that are defined by the values of its decision variables. The simulation identified key quantities to determine the pumping power at the heat production sites and the heat output at the TVAB site (note that this must be equal to the difference between the overall user demand and the output of the other sites, plus the thermal losses along the network). The cost for generating the heat requested from the TVAB site was determined by solving a nested mixed integer linear programming (MILP) optimization subproblem that distributed in the most convenient way the thermal load among the boilers in the TVAB site. After this post-processing step all the information required to evaluate the operating cost was available, whereas all the information required to evaluate the investment cost was already available from the knowledge of the decision variable values.  
The iteration of the algorithm ended with a selection of set of design solutions (new population) that was passed to the next iteration (in which it became the old population). All the design solutions of the old population and those of the offspring population were considered according to their objective function values (Pareto ranking), but also according to their genetic diversity, in order to avoid a premature convergence to a limited region of the true Pareto front.  
The number of individuals was set at 100 in order to have a sufficient variety of features within the population to be evolved by the algorithm, given the number of decision variables. The iterative search procedure was terminated after 250 generations, when it was clear that the population of design solutions had converged to the Pareto front of the best possible compromises between the two objectives.