## 4 The Experiments
### Experiment B: Borderline Identification  
Borderline or frontier identification of a swarm of robots is the problem of detecting which nodes in a cluster surround the others. Given a set of points \(P\), the aim is to find the subset of these points \(P_{B}\) such that there is a closed polygon joining all elements in \(P_{B}\subset P\) whose area contains all the other points in \(P\setminus P_{B}\). This boundary is approximated, for randomly generated node distributions, using the alpha shape algorithm, as a generalization of convex hulls (see [43]). Figure 2 shows the alpha shape of a randomly generated set of 100 points with the parameter \(\alpha=15\). We heuristically concluded that this value is suitable for our application. The borderline points (\(P_{B}\)) are those points belonging to the obtained alpha shape. The interior points are the remaining nodes in the swarm, that are not considered extremities. Only those agents belonging to the alpha shape of the swarm should identify themselves as borderline. Robots can identify themselves as borderline members by turning their LED on. At each simulation cycle, the experiment can be understood as a binary classification problem in which agents have to decide if they belong to the boundary or not. Alpha shape is used to generate target values that increase the fitness of the swarm if the classification is correct. In the experiment proposed here, the target alpha shape is the same during the entire simulation period because of the stationarity of the swam. In practice, the lack of a large number of points, in our case robots, leads to highly probable scenarios where the borderline polygon is not closed (for instance, a swarm forming a line or a V-shape). In this case, all the robots in the swarm would belong to the frontier (\(P_{B}=P\)). The swarm topology graph and the robot's orientation are randomly initialized as in Experiment A. At each time step, the instantaneous fitness function will be higher as the number of correct LED decisions increase. A correct decision means that either a borderline member activates its LED (true positive) or that an interior robot turns off its LED (true negative). Let \(\mathcal{R}_{B}\subset\mathcal{R}\) be the subset of robots belonging to the swarm borderline or frontier (note that there is a bijective correspondence between the elements of \(\mathcal{R}_{B}\) and \(P_{B}\)). On the contrary, the subset of robots belonging to the interior of the swarm is denoted as \(\mathcal{R}_{I}=\mathcal{R}\setminus\mathcal{R}_{B}\). The instantaneous fitness function is displayed in Equation (14). The function has two terms that are combined as a product. The first term corresponds to the number of borderline robots successfully identified divided by the number of borderline members. The second part is the number of correct classifications of interior agents divided by the number of interior robots. \(R_{B}\) and \(R_{I}\) denote the cardinality of the sets \(\mathcal{R}_{B}\) and \(\mathcal{R}_{I}\), respectively. \[f_{B}(\mathcal{G},k)=\frac{1}{R_{B}\,R_{I}}\Bigg{(}\sum_{r\in\mathcal{R}_{B}} \textbf{a}_{r,LED}(t)\Bigg{)}\cdot\Bigg{(}R_{I}-\sum_{r\in\mathcal{R}_{I}} \textbf{a}_{r,LED}(t)\Bigg{)} \tag{14}\]  
From a different perspective, the terms measure separately the true positive rate (TPR) and the true negative rate (TNR) instead of computing directly the total accuracy of the swarm. This fitness breakup is principally performed because the number of borderline and interior agents (\(R_{B}\) and \(R_{I}\)) are highly unbalanced in most of the random initializations of the swarm topology. This leads to naive and utterly suboptimal solutions in which all robots identify themselves as interior or borderline due to the high overall accuracy. Figure 2: Example of alpha shape algorithm with \(\alpha=15\) and 100 points.