## 4 Proposed CH Selection Algorithm Based Bacterial Foraging Paradigm
### The Proposed CH Selection Algorithm
#### 4.2.2 The Step of Chemotaxis  
The process in which bacteria move and search for food to increase energy levels is called chemotaxis. Swimming and tumbling are methods of chemotaxis, which describe the movement in two different directions [53; 54]. 1. **Swimming:** In every bacterial cell (BC) action, the bacteria numbered as {1,2,..., _i_} move and the bacteria {_i_ + 1, \(i\) + 2,..., _snnum_} do not move. This manner is much simpler than synchronous decisions regarding swimming to simulate. Algorithm 1 shows the pseudo code of the swimming step. **Illustration 1:**\(\Delta_{m}(i)\), \(m=1,2,\ldots,p\), is a random number between \(-1\) and \(1\). Here, the goal is to achieve the result of the swimming movement as seen in line 2 of the Algorithm 1. The _counter_ value in the algorithm is used to calculate the value of the swim length. Line 3 of Algorithm 1 controls that the counter variable does not exceed the maximum swim step. The lines 5, 6, and 7 of the algorithm explain the direction in which the direction of the bacteria moves in the advantageous direction when a direction more advantageous than the previous direction (\(J_{previous}\)) is detected. 2. **Tumbling:** In this sub step, each element \(\Delta_{m}(i)\), \(m=1,2,\ldots,p\) produces a random vector \(\Delta(i)\in R^{p}\). We use the formula that is given in Equation (11) for bacterial tumbling movement. \[\vartheta^{i}(j+1,k,l)=\vartheta^{i}(j,k,l)+C(i)\frac{\Delta(i)}{\sqrt{\Delta _{m}(i)\Delta(i)}} \tag{11}\] \begin{table}
\begin{tabular}{l c} \hline \hline
**Notation Symbols** & **Notation Descriptions** \\ \hline \(Problem_{size}\) & Problem space \\ \(Step_{size}\) & Random direction vector with the same number of dimensions. \\ \(sn_{num}\) & The number of bacterial cells that represents sensor node in our algorithm. \\ \(E_{max}\) & Initial energy of a sensor node \\ \(L_{max}\) & Maximum sensor node load \\ \(E_{remain}\) & Remaining energy of a sensor node \\ \(L_{node}\) & Load of a sensor node \\ \(D_{node}\) & Node degree of a CH \\ \(D_{dist}\) & Euclidean distance between a sensor node and an CH within its range \\ \(R\) & Transmission range of a sensor node \\ \(\propto\) & Used for trade-off between residual energy and node load \\ \(\beta\) & Used for trade-off between load distribution and energy consumption \\ \(\delta\) & Using for control the number of CHs \\ \(N_{neigh}\) & Neighbors of a sensor node that are within its transmission range \\ \(N_{c}\) & The number of chemotaxis steps. \\ \(N_{s}\) & The number of swim steps for a given bacterial cell \\ \(p\) & The number of dimensions on a given bacterial cells position vector. \\ \(N_{re}\) & The number of reproduction steps. \\ \(N_{ed}\) & The number of elimination-dispersal steps. \\ \(p_{ed}\) & Possibility of elimination and dispersal of a bacterial cell. \\ \(Population\) & Bacterial population \\ \(d_{attr}\) & Attraction coefficient 1 \\ \(w_{attr}\) & Attraction coefficient 2 \\ \(h_{repel}\) & The height of the repellant effect (magnitude of its effect) \\ \(w_{repel}\) & Measuring of the width of the bacterial repellant effect \\ \hline \hline \end{tabular}
\end{table} 
Table 2: The some notations used in the algorithms. The formulations in these steps represent the chemotaxis movement of the bacteria, where \(\theta^{i}(j,k,l)\) represents \(j\) th chemotactic, \(k\) th reproduction, and \(l\) th elimination-dispersal steps in the \(i\) th bacterium. \(C(i)\) is the size of the randomly dispersal steps and \(\Delta(i)\) denotes a vector in random direction between its element \([-1,1]\). In order to be able to select the appropriate CH in the proposed algorithm, we need to take into account the cost of bacteria in the foraging method, which is inspired. The cost of a bacterium is reduced by its interaction with other bacterial cells. This interaction function \(IF(sn_{k})\) is calculated in Equation (12), as follows:  
\[