## 3 The Proposed Distributed Bi-Behaviors Crow Search Algorithm
### The Standard Crow Search Algorithm  
The Crow Search Algorithm (CSA) was proposed by [PERSON] in 2016 [9] as a meta-heuristic to solve constrained engineering optimization problems. Crows are known to be a social bird with the ability to memorize and use food source positions when needed; these sources may be the result of a personal search or from the crows' social activities. The CSA algorithm mimics the crow flock's search mechanisms and uses them for optimization purposes. The search process is detailed in Algorithm 1, and begins with a random initialization of N crow's positions with d dimensional search space.  
```
Begin  Randomly initialize the position (X)of N crows  Evaluate the position of the crows  Initialize the memory of each crow  While iteration < Max-Iteration  For \(i=1\) to \(i\leq\) N do  Randomly choose one (\(i\)) crow to follow  Define the awareness probability \(AP_{i}(t)\)  Define the flight length \(Fl_{i}(t)\)  Update the crow position using Equation (1)  End For  Check the feasibility of new positions  Evaluate the new position of the crows  Update the memory (\(Mem\)) of crows using Equation (2)  End While  End
```  
**Algorithm 1** The Standard Crow Search Algorithm (CSA)  
Each crow \(i\) is characterized by a position vector \(X_{i}\), defined by: \(X_{i}=X_{1}^{i}\), \(X_{2}^{i}\), \(\dots\), \(X_{d}^{i}\) and their memory position \(Mem_{i}\) used to achieve the best food positions. All crows are flying in the search space and at each iteration we aim to optimize the fitness function \(Fit(X_{i})\) of each crow based on the updated position and their memories. While exploring the search space for new food positions, a crow needs to remember the best location in which it had its own food, and should remain aware if other rows discover this location. Assuming that the \(i\)-th crow decides to visit a previously memorized position at iteration _(t)_\((Memi,t)\), and assuming that congener _(i)_ follows the crow _(i)_, two controversial behaviors may occur, with each one represented by a particular state:  
* The first state is when the crow \(i\) ignores being followed, and simply continues its search, considering what it previously found \((Mem_{i,t})\)
* The second state is when the crow is aware of being followed; in this case, the crow will simply hide its food source and undergo a completely random search.
* These two position updates are detailed in Equation (3).  
\[X_{i}(t-1)\begin{cases}\text{//State 1}\\ \text{If }R_{j}(t)\geq AP_{j}(t)\text{then:}\\ X_{i}(t)+R_{i}(t)Fl_{i}(t)\big{(}M_{j}(t)-X_{i}(t)\big{)}\\ \text{Else:}\\ \text{//State2:}\\ \text{random update}\end{cases} \tag{3}\]  
where \(R_{i}(t)\) is a random number with uniform distribution between the interval [0, 1] at iteration \(t\), \(Fl_{i}(t)\) is the flight length of the crow \(i\), and \(AP_{i}(t)\) is the awareness probability of the crow \(i\). In the CSA algorithm, the balance between exploration and exploitation during the optimization process is achieved by the flight length (Fl) of the \(i\)th crow. However, the memory \(Mem_{i}(t+1)\) of each crow \(i\) is updated using Equation (4). All the optimization processes are executed until a predefined maximum number of iterations is reached.  
\[Mem_{i}(t-1)=\begin{cases}X_{i}(t+1)\text{ If }Fit(X_{i}(t+1))\geq Fit( Mem_{i}(t))\\ Mem_{i}(t)\text{ Otherwise}\end{cases} \tag{4}\]