# Facility Layout Problem with Alternative Facility Variants
## Appendix A Pseudocode of the Evolutionary Algorithms  
```
Input:PopSize... population size \(G\)... maximum number of generations \(P_{C}\)... crossover rate \(P_{M}\)... mutation rate \(EliteSize\)... number of elite individuals Output: Floorplan represented by the best individual
1 init(population)
2 evaluate(population) # NSGA-II specific \(g\gets 0\)
3 while\(g<G\)do
4\(tempPop\leftarrow\{\}\)while\(|tempPop|<PopSize\)do
5\(part\leftarrow\)select(population) # NSGA-II specific ifrand\(<P_{C}\)then
6\(par2\leftarrow\)select(population) # NSGA-II specific \(child\leftarrow\) crossover(\(par1\), \(par2\))
7 ifrand()\(<P_{M}\)then
8\(mult(child)\)
9 else
10\(child\leftarrow par1\)
11\(\text{mutate(child)}\)
12 evaluate(child) # NSGA-II specific \(tempPop\leftarrow tempPop+child\)
13\(tempPop\leftarrow tempPop\cup\text{\}\text{\}\text{\}\text{\}\text{\} \text{\}\text{\}\text{\}\text{\}\text{\}\text{\}\text{\}\text{\}\text{\} \text{\}\text{\}\text{\}\text{\}\) # NSGA-II specific
14\(population\leftarrow\)getUnique(tempPop,PopSize) # NSGA-II specific \(g\gets g+1\)
15 returnbeatOf(population) # NSGA-II specific
```  
**Algorithm 1**Single-objective evolutionary algorithm, EA  
## Appendix A Pseudocode of the Evolutionary Algorithms  
```
Input:PopSize... population size \(G\)... maximum number of generations \(P_{C}\)... crossover rate \(P_{M}\)... mutation rate \(EliteSize\)... number of elite individuals Output: Floorplan represented by the best individual
1 init(population)
2 evaluate(population) # NSGA-II specific \(g\gets 0\)
3 while\(g<G\)do
4\(tempPop\leftarrow\{\}\)while\(|tempPop|<PopSize\)do
5\(part\leftarrow\)select(population) # NSGA-II specific ifrand\(<P_{C}\)then
6\(par2\leftarrow\)select(population) # NSGA-II specific \(child\leftarrow\) crossover(\(par1\), \(par2\))
7 ifrand()\(<P_{M}\)then
8\(mult(child)\)
9 else
10\(child\leftarrow par1\)
11\(\text{mutate(child)}\)
12 evaluate(child) # NSGA-II specific \(tempPop\leftarrow tempPop+child\)
13\(tempPop\leftarrow tempPop\cup\text{\}\text{\}\text{\}\text{\}\text{\} \text{\}\text{\}\text{\}\text{\}\text{\}\text{\}\text{\}\text{\} \text{\}\text{\}\text{\}\text{\}\) # NSGA-II specific
14\(population\leftarrow\)getUnique(tempPop,PopSize) # NSGA-II specific
15\(g\gets g+1\)
16 returnbeatOf(population) # NSGA-II specific
```  
**Algorithm 2**Pseudocode of the Evolutionary Algorithm
The EA starts with a random initialization and evaluation of the initial population of individuals. Evaluation of an individual means that, first, the individual's priority list is mapped to the actual floor plan, and then the quality measure of the floor plan is calculated. Then, the algorithm iterates through \(G\) generations, lines 4-20. In each generation, a new population is created as follows. A population \(tempPop\) is created through a standard evolutionary process using selection, crossover, and mutation. When the \(tempPop\) of size \(PopSize\) has been generated, a number of \(EliteSize\) top best unique individuals from the previous generation are added to \(tempPop\), line 18. Finally, the best \(PopSize\) unique individuals from \(tempPop\) are selected to the new \(population\), line 19. In the end, the best floor plan of the last population is returned. Multi-objective evolutionary algorithm, MOEA, implements the NSGA-II algorithm [40]. The pseudocode of the EA algorithm applies to MOEA as well, with only a few modifications listed below:  
* Floor plan's quality assessment, line 2 and line 16: contrary to EA, in MOEA, multiple quality measures are calculated for each solution. * Parental selection, line 7 and line 9: the EA uses a standard tournament selection that chooses the best competitor solution with respect to the single objective. In MOEA, the _crowded-comparison operator_ is used within the tournament selection. It guides the selection process towards a uniformly-spread-out Pareto-optimal front by considering both the quality and uniqueness of the solutions; see [40].