## 4 Solution Approach
```
1:\(initSol\leftarrow\) genInitSol(inputs,\(\alpha\), \(\beta\) )
2:\(baseSol\leftarrow\)initSol
3:\(bestSol\leftarrow\)baseSol
4:fastSimulation(baseSol) % Fuzzy and Monte Carlo Simulation
5:T \(\leftarrow\)\(T_{0}\)
6:while (time \(\leq t_{max}\)) do % ILS stage
7:k \(\leftarrow\)\(K_{min}\)
8: perturbationSol \(\leftarrow\) perturbation(baseSol, \(k\), \(\alpha\), \(\beta\))
9: newSol \(\leftarrow\) localSearch(perturbationSol)
10:if (detCost(newSol) \(<\) detCost(baseSol)) then
11:fastSimulation(newSol) % Fuzzy and Monte Carlo simulation
12:if (expCost(newSol) \(<\) expCost(baseSol)) then
13: baseSol \(\leftarrow\) newSol
14:if (expCost(newSol) \(<\) expCost(bestSol)) then
15: bestSol \(\leftarrow\) newSol
16: insertt(poolBestSol,bestSol)
17:endif
18:k \(\leftarrow\)\(K_{min}\)
19:endif
20:else % SA-based acceptance criterion
21: temperature \(\leftarrow\) updateTemperature(detCost(newSol), detCost(baseSol), T)
22:if (\(\mathcal{U}\)(0,1) \(\leq\) temperature) then
23: baseSol \(\leftarrow\) newSol
24: k \(\leftarrow\)\(K_{min}\)
25:else
26: k \(\leftarrow\) min(k * Inc,\(K_{max}\))
27:endif
28:endif
29: T \(\leftarrow\)\(\Lambda\)T
30:endwhile
31:for (sol \(\in\) poolBestSol) do % Refinement stage - Fuzzy and Monte Carlo simulation
32:longSimulation(sol)
33:if (expCost(sol) \(<\) expCost(bestSol)) then
34: bestSol \(\leftarrow\) sol
35:endif
36:endfor
37:return bestSol
```  
**Algorithm 2** ILS-based Fuzzy Simheuristic (\(inputs\), \(\alpha\), \(\beta\), \(\lambda\), \(Inc\), \(T_{0}\), \(K_{min}\), \(K_{max}\), \(I_{0}\), \(t_{max}\))
Afterwards, the algorithm starts a local search around the perturbed solution in order to improve it (line 9). This stage consists in a _two-opt inter-route_ operator, which interchanges two chains of randomly selected customers between different facilities. A _newSol_ is returned whenever no more improvements are achieved. Later, whenever the deterministic cost of the _baseSol_ is improved (line 10), the _newSol_ is processed by the simulation and the fuzzy components to deal with the uncertainty of the proposed problem, using a low number of runs to compute the expected cost of the solution (line 11). Notice that this procedure does not only provide estimated values to the expected cost associated with the solutions generated by our approach, but it also reports feedback to the metaheuristic search process. If the _newSol_ is also able to improve the expected cost of the _baseSol_ (line 12), the latter is updated. In the same way, if the expected cost of the _newSol_ improves the cost of the best solution (_bestSol_) found so far (line 14), the latter is updated and added to the pool of elite solutions (line 16). This pool contains the best stochastic/fuzzy solutions found so far. The number of solutions in this pool is a known parameter that depends on the available computational time. Moreover, by limiting the size of this pool we ensure that we only keep track of the top solutions as the algorithm evolves. In order to further diversify the search, the algorithm might occasionally accept nonimproving solutions following an acceptance criterion (lines 20-28). Specifically, we have used a simulated-annealing acceptance criterion, which contains a decaying probability that is regulated by a dynamic temperature parameter (\(T\)). Finally, a refinement procedure using a larger number of simulation runs is executed in the third stage for each elite solution (lines 31-36). Hence, a more accurate summary of output variables can be obtained. As before, both probability distributions and fuzzy functions are employed in this simulation, depending on whether the element has a stochastic or fuzzy nature. Finally, the \"best\" solution (or pull of best alternative solutions) is returned, considering that the decision maker might be not only interested in the average value associated with a solution but also in its variability level. Particularly, the main output variables in our experiments are: the opening and routing costs, the cost incurred whenever a route fails and the safety stock.