## 3 Model and Methodology
### Solution Procedure
#### 3.2.1 Discrete Artificial Bee Colony  
Based on the behavior of honey bee swarms, the artificial bee colony is a population-based optimization algorithm with several distinct features that make it a good optimization tool [48]. The main idea behind it is that the search space shared by all of the bees is based on the opinion of individual bees, which are part of a society. Out of all of the groups in a colony, this algorithm considers three groups of bees: employed, onlookers and scout bees. Furthermore, in this algorithm, every solution corresponds to a food source, and the quality of each solution is associated with the amount of nectar; the higher the quality of the solution, the more nectar in that food source. The ABC algorithm incorporates the following phases: \begin{table}
\begin{tabular}{c c c c c} \hline \hline
**Activity (i)** & **Modes (\(\mu_{i}\))** & **Duration (\(d_{il}\)\(d_{il}\)\(d_{il}\)\(d_{il}\))** & \(R_{k}^{p}\) & **Arc Weights (\(\delta\))** \\ \hline
1 & 1 & - & - & (5,3,1); (4,5,5) \\ \hline  & 1 & 3;3;4 & 2 & (4,1,4); (1,1,7) \\
2 & 2 & 2;3;4 & 3 & (2,1,4); (1,6,3) \\  & 3 & 1;1;2 & 4 & (\(-\)1,2,0); (2,3,7) \\ \hline  & 1 & 2;3;5 & 1 & (5) \\
3 & 2 & 2;2;2 & 3 & (1) \\  & 3 & 1;3;5 & 5 & (4) \\ \hline  & 1 & 3;3;4 & 3 & (1,4,9); (3) \\
4 & 2 & 2;3;4 & 3 & (7,3,2); (1) \\  & 3 & 1;2;3 & 4 & (1,2,4); (2) \\ \hline  & 1 & 2;3;3 & 4 & (1) \\
5 & 2 & 3;3;4 & 5 & (2) \\  & 3 & 1;2;2 & 7 & (3) \\ \hline
6 & 1 & - & - & - \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Illustrative data of MRCPSP/max. Figure 3: Flowchart of the 3-stage procedure. * Initialization: \(n\)-dimensional solutions are generated randomly throughout the search space. After the initialization phase, the algorithm is repeated a Maximum Number of Cycles (MNC), executing three improvement phases in each cycle:
* Employed bees phase: Each solution (food source) is assigned a bee, which thus becomes an employed bee. This bee seeks to improve the solution by applying modifications (local search operators), and the quality (nectar) of the obtained solution is later compared to that of the original solution. If the modified solution is better, the old solution is forgotten, and the new solution is memorized. The employed bee will keep modifying the assigned food source until either a better solution is found or the abandonment limit is reached. * Onlooker bees phase: After all employed bees have finished their local search cycle, they share the nectar information of their food sources with the onlookers, each of which then selects a food source for further exploration based on the following probability: \[p_{i}=\frac{f_{i}}{\sum_{i=1}^{\text{SN}}f_{i}}\] (8) The onlookers tend to choose a food source \(i\) with higher probability \(p_{i}\) among \(\text{SN}\) total food sources, each with a fitness \(f_{i}\). * Scout bees phase: If the employed and onlooker bees cannot improve a solution after a number of trials (i.e., they reach the abandonment limit), a scout bee searches for a new food source (i.e., a new solution is generated randomly), and the previous food source is abandoned. Figure 4 shows a flowchart of the ABC algorithm. However, ABC was developed to solve continuous functions, not the current combinatorial problem. Therefore, a discrete version of the ABC algorithm is developed by representing every food source in matrix form and using the swap and insert operators for the local search. Furthermore, to increase the solution search space, the local search operators are designed to affect either only the mode of execution or the order of the activities along with their execution modes. This means that an activity list can remain unaltered, in the case that just the execution mode is selected; or it can be modified if the activity is selected; the factor affected is selected randomly. If activities are selected (i.e., activity + execution mode), a solution feasibility procedure is performed by checking the precedence constraints previous to the actual swap and/or insert.