# Search on an NK Landscape with Swarm Intelligence: Limitations and Future Research Opportunities
## 3 Swarm Intelligence Algorithms
### Mathematical Development of Swarm
\begin{split}\phi(x_{1},\cdots,x_{6})=\phi_{1}(x_{1},x_{2},x_{6})+ \phi_{2}(x_{2},x_{1},x_{3})&+\phi_{3}(x_{3},x_{2},x_{4})+\phi_{4 }(x_{4},x_{2},x_{3})\\ &+\phi_{5}(x_{5},x_{4},x_{6})+\phi_{6}(x_{6},x_{1},x_{5})\end{split}  \tag{13}\]

While (14) is computed as follows (where each component is affected by all other 5 components):

\[\phi(x_{1},\cdots,x_{6})=\sum_{i=1}^{6}\phi_{i}(x_{1},\cdots,x_{6}) \tag{14}\]

Hence, in each of the sub-fitness tables, there will be \(2^{3}=8\) values, each of which is randomly drawn from a uniform distribution. For (15), they are:

\[ \begin{split}\phi_{1}(0,0,0)=u_{1,1}&\phi_{2}(0,0, 0)=u_{2,1}&\phi_{6}(0,0,0)=u_{6,1}\\ \phi_{1}(0,0,1)=u_{1,2}&\phi_{2}(0,0,1)=u_{2,2}& \phi_{6}(0,0,1)=u_{6,2}\\ \phi_{1}(0,1,0)=u_{1,3}&\phi_{2}(0,1,0)=u_{2,3}& \phi_{6}(0,1,0)=u_{6,3}\\ \phi_{1}(0,1,1)=u_{1,4}&\phi_{2}(0,1,1)=u_{2,4}& \cdots&\phi_{6}(0,1,1)=u_{6,4}\\ \phi_{1}(1,0,0)=u_{1,5}&\phi_{2}(1,0,0)=u_{2,5}& \cdots&\phi_{6}(1,0,0)=u_{6,5}\\ \phi_{1}(1,0,1)=u_{1,6}&\phi_{2}(1,0,1)=u_{2,6}& \phi_{6}(1,0,1)=u_{6,6}\\ \phi_{1}(1,1,0)=u_{1,7}&\phi_{2}(1,1,0)=u_{2,7}& \phi_{1}(1,1,0)=u_{6,7}\\ \phi_{1}(1,1,1)=u_{1,8}&\phi_{2}(1,1,1)=u_{2,8}& \phi_{1}(1,1,1)=u_{6,8}\end{split}  \tag{15}\]

where \(u_{i,j}\) is a uniform number for function \(i\) and the order of binary \(j\). Given a binary number, say 011, we can translate it to a decimal number of 3, which is the 4 th random number. We use a fixed seed, and all the random numbers are precalculated. For (16), there are \(2^{6}=64\) values as follows:

\[ \begin{split}\phi_{1}(0,0,0,0,0,0)=u_{1,1}&\phi_{6}( 0,0,0,0,0)=u_{6,1}\\ \phi_{1}(0,0,0,0,0,1)=u_{1,2}&\phi_{6}(0,0,0,0,0,1)=u_{6,2}\\ \vdots&\cdots&\vdots\\ \phi_{1}(1,1,1,1,1,1)=u_{1,64}&\phi_{6}(1,1,1,1,1,1)=u_{6,64}\end{split}  \tag{16}\]

As mentioned earlier, it is common to collapse the hypercube into a three-dimensional graph. We follow [PERSON] and [PERSON] (2009) to plot the result in Figure 5.

As argued by [PERSON] (2014), there is no clear systematic way to perform this task. As we can see, [PERSON] and [PERSON] (2009) simply randomly arrange the \(x\)-axis to be the first three variables (\(x_{1}\sim x_{3}\)) and \(y\)-axis the last three variables (\(x_{4}\sim x_{6}\)) with no particular order. As a consequence, it is difficult to see the smoothness and ruggedness. Panel A of Figure 5 is \(N=6\) and \(K=2\) (smooth), and Panel B of Figure 5 is \(N=6\) and \(K=5\) (rugged). ### Global Search

Now we start our swarm simulations. In the first set of simulations, we allow for large jumps (i.e., global search). Each firm can see all the positions (hence fitness values) of other firms. In other words, all firms can see the entire landscape. The NK landscape is simulated as described in the previous section. The sorted values are plotted in Figure 6. The global peak is 1.279608, positioned at {0, 1, 0, 1, 1, 0}. We also note that the 95 th percentile (roughly the 4 th highest observation) is 1.229603 positioned at {1, 0, 0, 1, 0, 1}, and the 90 th percentile (roughly the 7 th highest observation) is 1.189652 positioned at {1, 1, 1, 0, 0, 0}. The maximum value (global peak) is 1.279608. The 95 th percentile (roughly the 61 st observation) is 1.229603, and the 90 th percentile (roughly the 58 th observation) is 1.189652. Figure 5: An example of a binary 3-dimensional NK landscape. Figure 6: Sorted simulated fitness values (\(N=6\) and \(K=2\)). Seeing the entire landscape, each firm then decides how to move. There are three possible choices for moving. One, the firm can follow the global best position of the other firms, which we call pure exploitation as the firm is purely exploiting its information gained from the environment. Two, the firm can forge its own path by exploring the landscape on its own, which we call exploration. Third, the firm can randomly toggle between exploration and exploitation, like in a multiarmed bandit model. We use 20 firms and stop after 16 iterations. The initial position of each firm is randomly generated, and the fitness value is calculated.