## 2 Methodology  
### Optimum Solution Search Methodology  
In this section, the proposed methodology for searching the optimum solution is presented. In its original condition the case study building does not have thermal insulation on the facade walls, roof or the slab on ground, and windows are single-glazed with high thermal transmittance. This results in the building presenting a high global heating demand and a significant difference in the heating demand among different dwellings, some requiring substantial improvement while others require much less intervention. It is this difference that arouses the interest of the authors for which this work focuses. A retrofitting aimed exclusively at reducing the total heating demand of the building would not only reduce the demand for the worst dwellings but would also reduce that of those with a low demand that did not require improvement. This strategy could then involve the unnecessary use of thermal insulation and replacement of windows where it was not really required, resulting in unjustified extra costs in the building renovation. A strategy focused on reducing and leveling the demand of the worst dwellings could be more appropriate, with the solution not being the same for each dwelling of the building. Therefore, this study proposes that the desired optimum solutions are those that result in the lowest total annual heating demand of the building and the smallest differences in the annual demand between the building's dwellings, quantified by the standard deviation. In this study, the building elements that are to be modified to find the optimal solutions are those that define the thermal envelope of the building (a more detailed explanation on the case study is presented in Section 3). Thus, the parameters and values that were considered include the following, where for each parameter the chosen values come from the existing practices of the Spanish regulations [30]:  
1. The insulation thickness of the facade walls: 2, 4, and 8 cm of an expanded polystyrene insulation with a thermal conductivity of 0.036 W/m\(\cdot\)K, commonly used as exterior insulation. A distinction was made between the ground floor and the upper floors and, moreover, between the south orientation and the others because the main orientations of the building are North-South. 2. The insulation thickness of the roof: 2, 4, and 8 cm of a polyurethane foam insulation with a thermal conductivity of 0.036 W/m\(\cdot\)K.
3. The insulation thickness of the slab on ground: 2, 4, and 8 cm of an extruded polystyrene insulation with a thermal conductivity of 0.034 W/m\(\cdot\)K.
4. The thermal transmittance (U-value) of glazing: The building contains windows from 0.55 to 1.64 m\({}^{2}\), and balconies from 1.39 to 7.18 m\({}^{2}\) in all orientations, so a distinction was made between the former and the latter and between those facing south and north or east and west. The glass types and the corresponding U-values considered were:  
A double 4-mm low-emissivity glass (\(\varepsilon<0.03\)) with 12-mm air gap (4/12/4): U-value = 1.66 W/m\({}^{2}\)K.  
A double 4-mm glass with 16-mm air gap and thermal break aluminum frame (4/16/4): U-value = 2.74 W/m\({}^{2}\)K.  
A double 4 mm glazing with 8 mm air gap and thermal break aluminum frame (4/8/4): U-value = 3.19 W/m\({}^{2}\)K.  
Table 1 shows the three different values of U corresponding to each building construction element considered. As a result of 3 levels of insulation for 4 different facade walls, 3 for the roof, 3 for the slab on the ground, and 3 thermal transmitances values for 6 different windows, the total possible building designs are 3 raised to the 12 th power, that is 531,441. To find the desired optimum solution, a methodology based on a bootstrap resampling technique with a set of different design combinations was used. This methodology enables different design parameters to be combined simultaneously with many input values.