## 2 Materials and Methods
### The Optimization Method of the Multi-Unit Project Discussed in the Article
#### 2.4.1 Simulated Annealing Algorithm  
Simulated annealing (SA) algorithm has been proposed in the work of [PERSON] [65]. This algorithm uses analogous to the thermodynamic process of cooling the solid in order to introduce the trajectory of the search of the local extremum. States of solid matter are seen analogously as individual solutions to the problem, whereas the energy of the body as the value of the objective function. During the physical process of cooling the temperature is reduced slowly in order to maintain energy balance. The SA algorithm starts with the initial solution (usually chosen at random). Then, in each iteration, according to established rules or randomly, there is solution \(\pi^{*}\) selected from the base neighborhood \(\pi\). It becomes the base solution in the next iteration, if the value of the objective function is better than the current base solution or if it otherwise may become the base solution with the probability of (Boltzmann function):  
\[p=\exp(-\Delta/T_{i}), \tag{26}\]  
where \(\Delta=c(\pi)-c(\pi^{*})\), \(T_{i}\)--the temperature of the current iteration \(i\), and \(c\)--the objective function. In each iteration there are \(m\) draws from the neighborhood of the current basic solution performed. The parameter called the temperature decreases in the same way as in the natural process of annealing. The most frequently adopted patterns of cooling are geometrical or logarithmic ones. Below is the general algorithm of the SA method (Algorithm 1) used to solve flow problems, which will be used to solve the problem under consideration. ```
Step 0. Determine the initial solution \(\pi\in\Pi\). Substitute \(\pi_{SA}=\pi^{0}\), \(k=0\), \(T=T_{0}\). Step 1. Perform steps 1.1-1.3 \(x\) times. Step 1.1. Substitute \(k\): \(k=k+1\). Choose at random \(\pi\in N(V,\pi^{k-1})\). Step 1.2. If \(c(\pi)>c(\pi_{SA})\) then substitute \(\pi_{SA}=\pi\). Step 1.3. If \(c(\pi)>c(\pi_{k\text{-}1})\) then substitute \(\pi_{k}=\pi\). Otherwise, accept solution \(\pi\) with a probability of \(p=\exp((c(\pi)-c(\pi_{k\text{-}1}))/T\), where \(\pi_{k}=\pi^{\prime}\). If solution \(\pi\) was accepted, and \(\pi_{k}=\pi_{k\text{-}1}\) if solution \(\pi\) was not accepted. Step 2. Change the temperature \(T\) according to the defined pattern of cooling. Step 3. If \(T>T_{N}\) return to the step 1; otherwise, STOP. ```  
**Algorithm 1**SA  
SA algorithms are used to solve many optimization problems, including flow shop problems which are considered in the context of discrete optimization problems. 4.2 The Algorithm for Solving the Optimization Problem in the Presented Model of a Multi-Unit Project  
Due to the existence of two different decision variables for the solution of the optimization task in the presented model of a multi-unit project, it is proposed to solve the optimization problem with the help of the following algorithm created by the authors, using the SA metaheuristic:  
Let \(\pi\in\Pi\) be any random permutation (\(\pi^{*}\) the best solution found so far, \(\pi^{*}=\pi\) to start with), let \(R\) be a randomly determined set of methods for performing activities (\(R^{*}\) the best solution found so far, \(R^{*}=R\) to start with), and let \(MaxIter\) be the accepted maximum number of iterations of the algorithm. **Step 1**. Find the solution of the optimization problem using the SA metaheuristic (permutation \(\delta\)) minimizing the cost of the project with the assumption of \(R\) as a set of methods for the implementation of activities. **Step 2**. Find the solution of the optimization problem using the SA metaheuristic (set of \(\rho\) methods of carrying out activities) minimizing the cost of the project with the assumption of the order of implementation of the units expressed by the permutation \(\rho\). **Step 3**. If \(U(\delta,\rho)\leq U(\tau^{*},R^{*})\), to \(\pi^{*}=\delta\), \(R^{*}=\rho\). Assume that \(R=\rho\). **Step 4**. If Termination_Condition, then STOP;  
otherwise, go to Step 1.