# A Swarm-Based Approach to Generate Challenging Mazes
## 3 Swarm Movements to Generate Challenging Mazes
### Proposed Methodology to Generate a Challenging Maze
The best values of maze's complexity obtained during selected runs, depending on the population size, are gathered in Table 1.

Table 1 is organized as follows: the first column contains selected run of our approach. The columns \"Initial\", \"Output\", and \"Number\" contain information on the value of the complexity of the best initial maze, the highest complexity of a maze obtained through each run of our approach, and the iteration number with the best solution, respectively. The last column \"Improve\" shows the improvement of the results obtained by mentioned method. It needs to be pointed out that such an improvement was calculated by dividing the difference between the results of the \"Output\" and \"Initial\" columns by the corresponding results of the \"Initial\" column, then multiplying by 100%. A selected run process of the implemented algorithm for the maze of 25-by-25 cells is illustrated in Figure 2. We have seen the progress towards higher complexity with our algorithm, relating to various sizes of the population. The results show that more individuals in the population improves its ability to explore the space of solutions and find mazes with higher complexity. Among the results \begin{table}
\begin{tabular}{r c c c c} \hline \hline \multirow{2}{*}{**Trial**} & \multicolumn{4}{c}{**5 Individuals**} \\ \cline{2-5}  & **Initial** & **Output** & **Number** & **Improve [\%]** \\ \hline
1 & 5202 & 9295 & 26 & 78.68 \\
2 & 7567 & 9295 & 12 & 22.84 \\
3 & 3069 & 9381 & 19 & 205.67 \\
4 & 4407 & 9065 & 22 & 105.7 \\
5 & 3007 & 6768 & 18 & 125.08 \\ \hline \hline \multirow{2}{*}{**Trial**} & \multicolumn{4}{c}{**15 Individuals**} \\ \cline{2-5}  & **Initial** & **Output** & **Number** & **Improve [\%]** \\ \hline
1 & 4598 & 13,325 & 15 & 189.8 \\
2 & 4212 & 14,322 & 13 & 240.03 \\
3 & 5289 & 13,376 & 31 & 152.9 \\
4 & 7693 & 14,421 & 16 & 87.46 \\
5 & 8478 & 16,875 & 30 & 99.05 \\ \hline \hline \multirow{2}{*}{**Trial**} & \multicolumn{4}{c}{**25 Individuals**} \\ \cline{2-5}  & **Initial** & **Output** & **Number** & **Improve [\%]** \\ \hline
1 & 8478 & 19,039 & 40 & 124.60 \\
2 & 4235 & 17,175 & 37 & 305.55 \\
3 & 11,194 & 17,459 & 21 & 55.97 \\
4 & 4598 & 16,946 & 25 & 268.55 \\
5 & 7301 & 16,614 & 28 & 127.56 \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Results for five selected independent runs. obtained through 100 independent runs of our method, the complexity of the maze amounted to 19,039 was found for the population size equalling 25 solutions (see the first trial in Table 1). It needs to be pointed out that for this solution it yields an improvement about 124.6%. The obtained statistics over 100 runs of the algorithm are summarized in Table 2. It displays the best and worst solutions found by the implemented algorithm (columns \"max\" and \"min\", respectively) for the complexity and improvement measures, the average solutions of 100 independent runs (column \"average\") and the standard deviations of the found solutions (column \"STD\"). As one can see, in all cases we have the percentage relative improvement between the best value of the objective function value found by the algorithm and the best initial value. As expected, the increasing population improved the chance of finding the most complicated solution over all runs for the test maze. Our tests showed differences of the results obtained between the population size equalling 25 individuals (the average improvement was 241.09%) and other sizes. Therefore, one of the findings of our preliminary study is that increasing the population size seems to improve the performance of the algorithm. In turn, in Figure 3 above, the best individual in the initial population of an example run of the implemented approach is shown. In this particular trial (the fifth trial in Table 1), a swarm of 15 individuals was employed to generate the more complicated maze of 25-by-25 cells.