# 5 Supplementary Results

Here, we provide additional results that provide a more detailed analysis compared to those of the main text. Specifically, we investigate in simulations:

* the influence of the number of iterations on the accuracy of the spectral swarm robotics algorithm, first in the case with 7 arenas and then focusing on the 2 most different arenas in terms of $Final\lambda_2$.

* the influence of the simulation parameters (number of agents $N$, field of perception $\sigma$) on the order of the $Final\lambda_2$ values relative to the shape of arenas.

* how the dispersion scheme used and initial position of the agents can influence the results of the algorithm, and whether having moving agents is necessary.

Supplementary Table 4 lists the simulation and experimental cases conducted in this paper. The SI present the results of the five first cases (Supplementary Figs. 8-18). The main text presents the results of the first case (Main Text Figs. 2 and 3) as well as the remaining two cases, **sim-2** and **expe-2** (Main Text Fig. 4). The parameters values used for all cases are listed in Supplementary Table 5.

<table><caption>Supplementary Table 4: List of all considered cases in simulation and experiments.</caption><thead><tr><th>Case name</th><th>Simulations or experiments</th><th>Dispersion alg.</th><th>Surface of arenas <i>S</i></th><th>Arenas</th><th>Nr. of runs</th><th>Nr. of agents <i>N</i></th><th>Lenghtscale <i>l</i></th><th>Nr. of iterations <i>I</i></th></tr></thead><tbody><tr><td>sim-large-7</td><td>Simulations</td><td>run-and-tumble</td><td>500000mm<sup>2</sup></td><td>Disk, Square, Arrow, Star, Triangle, Stop, Annulus</td><td>64</td><td>50 – 550</td><td>100.0 – 30.15</td><td>1-30</td></tr><tr><td>sim-large-2</td><td>Simulations</td><td>run-and-tumble</td><td>500000mm<sup>2</sup></td><td>Disk, Annulus</td><td>64</td><td>50 – 550</td><td>100.0 – 30.15</td><td>1-30</td></tr><tr><td>sim-small-2-dispersion</td><td>Simulations</td><td>run-and-tumble</td><td>70000mm<sup>2</sup></td><td>Disk, Annulus</td><td>64</td><td>10 – 80</td><td>83.67 – 29.58</td><td>1-10</td></tr><tr><td>sim-small-2-random</td><td>Simulations</td><td>None - immobile robots initialized at random positions</td><td>70000mm<sup>2</sup></td><td>Disk, Annulus</td><td>64</td><td>10 – 80</td><td>83.67 – 29.58</td><td>1-10</td></tr><tr><td>sim-small-2-uniform</td><td>Simulations</td><td>None - immobile robots initialized uniformly in the arenas</td><td>70000mm<sup>2</sup></td><td>Disk, Annulus</td><td>64</td><td>10 – 80</td><td>83.67 – 29.58</td><td>1-10</td></tr><tr><td>sim-2</td><td>Simulation</td><td>None - immobile robots initialized uniformly in the arena</td><td>70000mm<sup>2</sup></td><td>Disk, Annulus</td><td>64</td><td>25</td><td>52.91</td><td>1</td></tr><tr><td>expe-2</td><td>Experiments</td><td>None - immobile robots initialized uniformly in the arena</td><td>70000mm<sup>2</sup></td><td>Disk, Annulus</td><td>15</td><td>25</td><td>52.91</td><td>1</td></tr></tbody></table>

## 5.1 Simulations: arenas with surface $S = 500000mm^2$

Here, we consider in simulation the cases **sim-large-7** (with 7 arenas) and **sim-large-2** (with only 2 arenas: disk and annulus). Both cases have arenas with a surface of $S = 500000mm^2$. Main Text Figs. 2 and 3 present results from the **sim-large-7** case, after 30 iterations. That number of iterations was selected because, for all parameters considered, the algorithm needs at most 30 iterations to converge when considering arenas of that size.

Supplementary Fig. 8 compares the results with respect to accuracy after respectively 1 and 30 iterations. Both configurations show a clear impact of the simulation parameters ($N$ and $\sigma$) on the accuracy. These results validate the conclusions from Main Text Fig. 3: a higher number of iterations translate into a higher accuracy. For both 1 and 30 iterations, we observe similar regimes as in Main Text Fig. 3, with the optimal solutions found in the hyperbole $N = \alpha S/(\pi\sigma^2)$ with $\alpha = 17$.

Supplementary Figure 9 shows the influence of the parameters $N$ and $\sigma$ on the ordering of the values of $Final\lambda_2$ corresponding to all 7 arenas. This ordering (“ranking”) corresponds to the order of their associated values: the lowest value is ranked first (0), the second lowest is ranked second, and so on. The highest value is ranked last (6). On the optimal $\alpha = 17$ hyperbole (including regimes r1, r3 and r4 from Main Text Fig. 3), the ordering is generally consistent – starting from low to high: annulus, stop, triangle, star, arrow, square and disk. In the neighborhood of regime r5, this ordering is roughly inverted – it starts with the disk to finish with the annulus. In most cases, the disk and annulus are the furthest apart in terms of ranking.
We thus chose to focus on the disk and annulus arenas in subsequent cases, allowing us to investigate a more canonical scenario compared to the **sim-large-7**. Namely, Supplementary Fig. 10 presents accuracy results for the **sim-large-2** case (including rankings). Compared with the **sim-large-7** case, the accuracy results of **sim-large-2** are higher for all considered parameters. After one iteration, the best-performing parameters are only found close to the hyperbole *p*. After 30 iterations, most parameters result in high-performing solutions: optimal solutions (accuracy of 100%) are found close to the optimal $\alpha = 17$ hyperbole, close to the r5 regime, as well as for very low number of agents and short fields of perception ($N \in [50, 150]$, $\sigma \in [40, 85]$). The only solutions with lower accuracy are found on the boundaries between regimes, and corresponds to the boundaries seen in the ranking figure at the bottom.

<table><thead><tr><th></th><th>Parameter Name</th><th>sim-large-7</th><th>sim-large-2</th><th>sim-small-2-dispersion</th><th>sim-small-2-random</th><th>sim-small-2-uniform</th><th>sim-2</th><th>expe-2</th></tr></thead><tbody><tr><td rowspan="10">Base</td><td>Nr. of runs</td><td colspan="4">64</td><td colspan="3">15</td></tr><tr><td>Arena Surface <i>S</i></td><td colspan="2">500000mm<sup>2</sup></td><td colspan="4">70000mm<sup>2</sup></td></tr><tr><td>Agent diameter</td><td colspan="4">33 mm</td><td colspan="3"></td></tr><tr><td>Field of Perception <i>σ</i></td><td colspan="2">30mm-320mm</td><td colspan="4">≈ 85 mm</td></tr><tr><td>Nr. of agents <i>N</i></td><td>50-550</td><td colspan="2">10-80</td><td colspan="3">25</td></tr><tr><td>Initial <i>s</i><sup>0</sup> value</td><td colspan="8">-1 or 1. chosen randomly, uniform distribution is *not* enforced</td></tr><tr><td>τ</td><td colspan="2">1.0/15.0s</td><td colspan="4">1.0/50.0s</td></tr><tr><td>Number of iterations <i>I</i></td><td>1-30</td><td colspan="2">1-10</td><td colspan="3">1</td></tr><tr><td>Initial position of agents</td><td colspan="2">Packed in the center of the arena</td><td>Random positions</td><td colspan="4">Uniformly distributed (equidistant to neighbors)</td></tr><tr><td>Prop. of correctly received messages between neighbors</td><td colspan="4">100%</td><td colspan="3">≈ 10%</td></tr><tr><td>Number of diffusion sessions computed in parallel per it.</td><td colspan="8">3</td></tr><tr><td>Max nr. of neighbors</td><td colspan="8">20</td></tr><tr><td rowspan="10">Time</td><td>Simulation/Experiment time</td><td colspan="2">1143900 kt ≈ 615min</td><td colspan="2">257300 kt ≈ 138min</td><td colspan="2">148800 kt = 80min</td><td colspan="2">146630 kt ≈ 79min</td></tr><tr><td>Initial dispersion duration</td><td colspan="2">46500 kt = 25min</td><td colspan="4">0 kt</td></tr><tr><td>Iteration total duration</td><td colspan="2">36580 kt ≈ 20min</td><td colspan="2">21080 kt = 680s</td><td colspan="2">14880 kt = 480s</td><td colspan="2">146630 kt = 79min</td></tr><tr><td>Iteration waiting time</td><td colspan="8">930 kt = 30s</td></tr><tr><td>Iteration handshake</td><td colspan="2">310 kt = 10s</td><td colspan="4">6200 kt = 200s</td></tr><tr><td>Iteration handshake step dur.</td><td colspan="2">31 kt = 1s</td><td colspan="4">248 kt = 8s</td></tr><tr><td>Iteration dispersion duration</td><td colspan="2">6200 kt = 200s</td><td colspan="4">0 kt</td></tr><tr><td>Iteration diffusion/pre-diffusion duration</td><td colspan="2">13950 kt = 450s</td><td colspan="2">6200 kt = 200s</td><td colspan="3">54250 kt = 29min</td></tr><tr><td>Iteration diffusion/pre-diffusion nr. of steps</td><td colspan="2">450</td><td colspan="2">200</td><td colspan="3">218</td></tr><tr><td>Iteration diffusion/pre-diffusion step duration</td><td colspan="2">31 kt = 1s</td><td colspan="4">248 kt = 8s</td></tr><tr><td>Iteration diffusion burn-in</td><td colspan="2">5000 kt ≈ 161s</td><td colspan="2">620 kt = 20s</td><td colspan="3">10000 kt ≈ 323s</td></tr><tr><td>Iteration collective avg. duration</td><td colspan="8">620 kt = 20s</td></tr><tr><td>Iteration collective avg. nr. of steps</td><td colspan="8">20</td></tr><tr><td>Iteration collective avg. step dur.</td><td colspan="8">31 kt = 1s</td></tr><tr><td rowspan="4">Dispersion</td><td>Step duration</td><td colspan="2">15 kt ≈ 0.48s</td><td colspan="4">-</td></tr><tr><td>Tumble duration</td><td colspan="2">93 + N(0, 1) * 31 kt = 3 + N(0, 1) s</td><td colspan="4">-</td></tr><tr><td>Tumble duration domain</td><td colspan="2">0 - 124 kt = 0 - 4s</td><td colspan="4">-</td></tr><tr><td>Run duration</td><td colspan="2">19 kt = 0.6s</td><td colspan="4">-</td></tr></tbody></table>

Supplementary Table 5: List of parameter values used with all cases. One kilotick (kt) corresponds to 1/31 ≈ 0.03 seconds.
We thus chose to focus on the disk and annulus arenas in subsequent cases, allowing us to investigate a more canonical scenario compared to the **sim-large-7**. Namely, Supplementary Fig. 10 presents accuracy results for the **sim-large-2** case (including rankings). Compared with the **sim-large-7** case, the accuracy results of **sim-large-2** are higher for all considered parameters. After one iteration, the best-performing parameters are only found close to the hyperbole *p*. After 30 iterations, most parameters result in high-performing solutions: optimal solutions (accuracy of 100%) are found close to the optimal $\alpha = 17$ hyperbole, close to the r5 regime, as well as for very low number of agents and short fields of perception ($N \in [50, 150]$, $\sigma \in [40, 85]$). The only solutions with lower accuracy are found on the boundaries between regimes, and corresponds to the boundaries seen in the ranking figure at the bottom.

<table><thead><tr><th></th><th>Parameter Name</th><th>sim-large-7</th><th>sim-large-2</th><th>sim-small-2-dispersion</th><th>sim-small-2-random</th><th>sim-small-2-uniform</th><th>sim-2</th><th>expe-2</th></tr></thead><tbody><tr><td rowspan="10">Base</td><td>Nr. of runs</td><td></td><td></td><td>64</td><td></td><td></td><td></td><td>15</td></tr><tr><td>Arena Surface <i>S</i></td><td></td><td>500000mm<sup>2</sup></td><td></td><td></td><td>70000mm<sup>2</sup></td><td></td><td></td></tr><tr><td>Agent diameter</td><td></td><td></td><td></td><td>33 mm</td><td></td><td></td><td></td></tr><tr><td>Field of Perception <i>σ</i></td><td></td><td></td><td>30mm-320mm</td><td></td><td></td><td></td><td>≈ 85 mm</td></tr><tr><td>Nr. of agents <i>N</i></td><td></td><td>50-550</td><td></td><td>10-80</td><td></td><td></td><td>25</td></tr><tr><td>Initial <i>s</i><sup>0</sup> value</td><td></td><td></td><td></td><td>-1 or 1. chosen randomly, uniform distribution is *not* enforced</td><td></td><td></td><td></td></tr><tr><td>τ</td><td></td><td></td><td>1.0/15.0s</td><td></td><td></td><td>1.0/50.0s</td><td></td></tr><tr><td>Number of iterations <i>I</i></td><td></td><td>1-30</td><td></td><td>1-10</td><td></td><td></td><td>1</td></tr><tr><td>Initial position of agents</td><td></td><td>Packed in the center of the arena</td><td></td><td>Random positions</td><td>Uniformly distributed (equidistant to neighbors)</td><td></td><td></td></tr><tr><td>Prop. of correctly received messages between neighbors</td><td></td><td></td><td>100%</td><td></td><td></td><td></td><td>≈ 10%</td></tr><tr><td>Number of diffusion sessions computed in parallel per it.</td><td></td><td></td><td></td><td>3</td><td></td><td></td><td></td></tr><tr><td>Max nr. of neighbors</td><td></td><td></td><td></td><td>20</td><td></td><td></td><td></td></tr><tr><td rowspan="10">Time</td><td>Simulation/Experiment time</td><td>1143900 kt ≈ 615min</td><td>257300 kt ≈ 138min</td><td>148800 kt = 80min</td><td></td><td></td><td>146630 kt ≈ 79min</td></tr><tr><td>Initial dispersion duration</td><td></td><td>46500 kt = 25min</td><td></td><td></td><td>0 kt</td><td></td><td></td></tr><tr><td>Iteration total duration</td><td>36580 kt ≈ 20min</td><td>21080 kt = 680s</td><td>14880 kt = 480s</td><td></td><td></td><td>146630 kt = 79min</td></tr><tr><td>Iteration waiting time</td><td></td><td></td><td>930 kt = 30s</td><td></td><td></td><td></td><td></td></tr><tr><td>Iteration handshake</td><td></td><td></td><td>310 kt = 10s</td><td></td><td></td><td>6200 kt = 200s</td></tr><tr><td>Iteration handshake step dur.</td><td></td><td></td><td>31 kt = 1s</td><td></td><td></td><td>248 kt = 8s</td></tr><tr><td>Iteration dispersion duration</td><td></td><td>6200 kt = 200s</td><td></td><td></td><td>0 kt</td><td></td><td></td></tr><tr><td>Iteration diffusion/pre-diffusion duration</td><td></td><td>13950 kt = 450s</td><td></td><td>6200 kt = 200s</td><td></td><td></td><td>54250 kt = 29min</td></tr><tr><td>Iteration diffusion/pre-diffusion nr. of steps</td><td></td><td>450</td><td></td><td>200</td><td></td><td></td><td>218</td></tr><tr><td>Iteration diffusion/pre-diffusion step duration</td><td></td><td></td><td>31 kt = 1s</td><td></td><td></td><td></td><td>248 kt = 8s</td></tr><tr><td>Iteration diffusion burn-in</td><td></td><td>5000 kt ≈ 161s</td><td></td><td>620 kt = 20s</td><td></td><td></td><td>10000 kt ≈ 323s</td></tr><tr><td>Iteration collective avg. duration</td><td></td><td></td><td></td><td>620 kt = 20s</td><td></td><td></td><td>15500 kt = 500s</td></tr><tr><td>Iteration collective avg. nr. of steps</td><td></td><td></td><td></td><td>20</td><td></td><td></td><td>62</td></tr><tr><td>Iteration collective avg. step dur.</td><td></td><td></td><td></td><td>31 kt = 1s</td><td></td><td></td><td>248 kt = 8s</td></tr><tr><td rowspan="4">Dispersion</td><td>Step duration</td><td></td><td>15 kt ≈ 0.48s</td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Tumble duration</td><td></td><td>93 + N(0, 1) * 31 kt = 3 + N(0, 1) s</td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Tumble duration domain</td><td></td><td>0 - 124 kt = 0 - 4s</td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Run duration</td><td></td><td>19 kt = 0.6s</td><td></td><td></td><td></td><td></td><td></td></tr></tbody></table>

Supplementary Table 5: List of parameter values used with all cases. One kilotick (kt) corresponds to 1/31 ≈ 0.03 seconds.
<figure><img src="image_10.png" /><figcaption>sim-large-7, only 1 iteration</figcaption></figure>

<figure><img src="image_11.png" /><figcaption>sim-large-7, 30 iterations</figcaption></figure>

Supplementary Figure 8: Evolution of the accuracy with respect to the field of perception of each agent and the number of agents, for the case **sim-large-7**. Here, we consider 7 arenas with a surface $S = 500000mm^2$. All results are computed over 64 simulation runs. We adjust the accuracy score to only show results where the simulated diffusion sessions in the swarm did not diverge: empty bins correspond to results where there are more than 50% of runs exhibiting divergences. **Top:** results obtained after only 1 iteration. **Bottom:** results obtained after 30 iterations.
<figure><img src="image_9.png" /><figcaption>sim-large-7, only 1 iteration</figcaption></figure>

<figure><img src="image_10.png" /><figcaption>sim-large-7, 30 iterations</figcaption></figure>

Supplementary Figure 8: Evolution of the accuracy with respect to the field of perception of each agent and the number of agents, for the case **sim-large-7**. Here, we consider 7 arenas with a surface $S = 500000mm^2$. All results are computed over 64 simulation runs. We adjust the accuracy score to only show results where the simulated diffusion sessions in the swarm did not diverge: empty bins correspond to results where there are more than 50% of runs exhibiting divergences. **Top:** results obtained after only 1 iteration. **Bottom:** results obtained after 30 iterations.
<figure><img src="image_12.png" /><figcaption>sim-large-7, 30it, disk</figcaption></figure>

<figure><img src="image_13.png" /><figcaption>sim-large-7, 30it, square</figcaption></figure>

<caption>sim-large-7, 30it, arrow</caption>

<caption>sim-large-7, 30it, star</caption>

<caption>sim-large-7, 30it, triangle</caption>

<caption>sim-large-7, 30it, stop</caption>

<caption>sim-large-7, 30it, annulus</caption>

Supplementary Figure 9: Ranking of the values of the Finalλ₂ centroids for all arenas in the **sim-large-7** case, after 30 iterations.
<figure><img src="image_11.png" /><figcaption>sim-large-7, 30it, disk</figcaption></figure>

<figure><img src="image_12.png" /><figcaption>sim-large-7, 30it, square</figcaption></figure>

<caption>sim-large-7, 30it, arrow</caption>

<caption>sim-large-7, 30it, star</caption>

<caption>sim-large-7, 30it, triangle</caption>

<caption>sim-large-7, 30it, stop</caption>

<caption>sim-large-7, 30it, annulus</caption>

Supplementary Figure 9: Ranking of the values of the Finalλ₂ centroids for all arenas in the **sim-large-7** case, after 30 iterations.
<figure><img src="image_14.png" /></figure>

<figure><img src="image_15.png" /></figure>

<figure><img src="image_16.png" /><figcaption>Supplementary Figure 10: Evolution of the accuracy with respect to the field of perception of each agent and the number of agents, for the case **sim-large-2**. With this case, we consider 2 arenas (disk vs annulus) of surface $S = 500000mm^2$. All results are computed over 64 simulation runs. We adjust the accuracy score to only show results when the simulated diffusion sessions in the swarm did not diverge: empty bins correspond to results where more than 50% of runs failed to converge. **Top:** results obtained after only 1 iteration. **Middle:** results obtained after 30 iterations. **Bottom:** Ranking of the values of the Final$\lambda_2$ centroids for the disk arena.</figcaption></figure>
<figure><img src="image_13.png" /></figure>

<figure><img src="image_14.png" /></figure>

<figure><img src="image_15.png" /><figcaption>Supplementary Figure 10: Evolution of the accuracy with respect to the field of perception of each agent and the number of agents, for the case **sim-large-2**. With this case, we consider 2 arenas (disk vs annulus) of surface $S = 500000mm^2$. All results are computed over 64 simulation runs. We adjust the accuracy score to only show results when the simulated diffusion sessions in the swarm did not diverge: empty bins correspond to results where more than 50% of runs failed to converge. **Top:** results obtained after only 1 iteration. **Middle:** results obtained after 30 iterations. **Bottom:** Ranking of the values of the Final$\lambda_2$ centroids for the disk arena.</figcaption></figure>
<figure><img src="image_17.png" /><figcaption>Supplementary Figure 11: **Top:** Mean number of neighbors of agents (i.e., mean degree of the communication graphs), and **Bottom:** mean number of connected graph components in the **sim-large-7** case, after 30 iterations.</figcaption></figure>
<figure><img src="image_16.png" /><figcaption>Supplementary Figure 11: **Top:** Mean number of neighbors of agents (i.e., mean degree of the communication graphs), and **Bottom:** mean number of connected graph components in the **sim-large-7** case, after 30 iterations.</figcaption></figure>
## 5.2 Simulations: influence of the dispersion algorithm

We want to study how the dispersion algorithm and the initial position of the agents influence the behavior of the spectral swarm robotics algorithm and associated results in terms of shape classification accuracy. We consider the following three cases:

**sim-small-2-dispersion** where agents are initially packed at the center of the arena and move according to a run-and-tumble motion during both the “seeding” and the “short random walk” stages of the spectral swarm robotics algorithm. As such, agents first disperse throughout the arena and then move at the beginning of each iteration of the algorithm to change their neighbors.

**sim-small-2-random** where agents are initially placed at random positions of the arena and where they remain static: the “seeding” stage of the spectral swarm robotics algorithm is skipped and agent do not move during the “short random walk” stage. As such, they always keep the same neighbors for all iterations.

**sim-small-2-uniform** where agents are initially optimally distributed throughout the arena so that the distance between each pair of neighboring agents is the same across the entire swarm. This ensures that all parts of the arena are identically discretized by the communication graph of the agents. The optimal positions of the agents are found by using K-Means to find *N* clusters from a large (100000) number of points randomly placed in a space with the boundaries as the arenas.

All three cases are performed in simulation, with two arenas (disk and annulus) of surface $S = 70000\text{mm}^2$ – in turn, we will use a smaller number of agents compared to the cases of the previous section (Supplementary Table 4).

While cases **sim-small-2-dispersion** and **sim-small-2-random** do not assume any prior knowledge about the geometry of the arenas, the **sim-small-2-uniform** case assumes that it is possible to distribute uniformly the agent in the arenas before the start of the algorithm. In experiments with Kilobots, this can be achieved by having the human experimenter positioning the robots so that they are evenly distributed before starting the experiment.

Supplementary Figure 12 shows the densities of agents after the seeding stage over 64 runs. In all cases, for both arenas, the agents reach all parts of the arenas, with no visible gap.

Supplementary Figure 13 shows representative examples of agents position after the “initial seeding” stage for the three cases.

Supplementary Figure 14 characterizes the spacial distribution of agents after the seeding stage for the three cases considered here. We consider the following three complementary statistics and assess their distribution using violin plots:

**Degrees** The distribution of degrees in the communication graphs. This metric only takes into account the communication graph $\mathcal{G}$ itself, without considering the distance between agents.

$d_{\min}/\sigma$ The distance between the focal agent and its closest neighbors divided by $\sigma$, the field of perception of the agents. This metric only takes into account the distance to one neighbor, without involving the communication graph $\mathcal{G}$.

**Cell Surface of Voronoi tessellation** The area of each cells obtained by computing a Voronoi tessellation of the positions of the agents in the arena (constrained by the geometry of the arena). This metric only takes into account the spatial size of neighborhoods, without involving the communication graph $\mathcal{G}$. The Voronoi tessellation is computed in our Python scripts using the Geopandas and shapely packages [62,63].

In both configurations, the results of cases **sim-small-2-dispersion** and **sim-small-2-random** are generally similar for the degrees and cell surface metrics and differ from the results of case **sim-small-2-uniform**. The results of the $d_{\min}/\sigma$ metric suggest that agents tend to be more packed together in the **sim-small-2-dispersion** and **sim-small-2-random** cases compared to the **sim-small-2-uniform** – this matches the examples of Supplementary Fig. 13. The cell surfaces in the uniform case has generally less variability compared to the other cases (at least for the annulus): indeed all agents are equidistant to their neighbors in this case. In turn, the discretization of the shape is more uniform in the **sim-small-2-uniform** case.

Note however, when the number of agents is sufficiently low, it is very possible to obtain a graph of agents with multiple graph components (cf Supplementary Fig. 13, i.e., a graph that is not fully connected. This will have a different set of consequences depending on the case:

**sim-small-2-dispersion** The agents move and change their neighbors every iteration. Consequently, the graph components do not stay static over iterations: they may sometimes merge together or split; some agents may go from one component to another. In turn, the estimations of $\lambda_2$ will be periodically transferred from component to component, making the system able to correctly (but imprecisely) estimate $\lambda_2$ while sometimes having more than one graph component. That means that it is still possible to have a classification
## 5.2 Simulations: influence of the dispersion algorithm

We want to study how the dispersion algorithm and the initial position of the agents influence the behavior of the spectral swarm robotics algorithm and associated results in terms of shape classification accuracy. We consider the following three cases:

**sim-small-2-dispersion** where agents are initially packed at the center of the arena and move according to a run-and-tumble motion during both the “seeding” and the “short random walk” stages of the spectral swarm robotics algorithm. As such, agents first disperse throughout the arena and then move at the beginning of each iteration of the algorithm to change their neighbors.

**sim-small-2-random** where agents are initially placed at random positions of the arena and where they remain static: the “seeding” stage of the spectral swarm robotics algorithm is skipped and agent do not move during the “short random walk” stage. As such, they always keep the same neighbors for all iterations.

**sim-small-2-uniform** where agents are initially optimally distributed throughout the arena so that the distance between each pair of neighboring agents is the same across the entire swarm. This ensures that all parts of the arena are identically discretized by the communication graph of the agents. The optimal positions of the agents are found by using K-Means to find *N* clusters from a large (100000) number of points randomly placed in a space with the boundaries as the arenas.

All three cases are performed in simulation, with two arenas (disk and annulus) of surface $S = 70000\text{mm}^2$ – in turn, we will use a smaller number of agents compared to the cases of the previous section (Supplementary Table 4).

While cases **sim-small-2-dispersion** and **sim-small-2-random** do not assume any prior knowledge about the geometry of the arenas, the **sim-small-2-uniform** case assumes that it is possible to distribute uniformly the agent in the arenas before the start of the algorithm. In experiments with Kilobots, this can be achieved by having the human experimenter positioning the robots so that they are evenly distributed before starting the experiment.

Supplementary Figure 12 shows the densities of agents after the seeding stage over 64 runs. In all cases, for both arenas, the agents reach all parts of the arenas, with no visible gap.

Supplementary Figure 13 shows representative examples of agents position after the “initial seeding” stage for the three cases.

Supplementary Figure 14 characterizes the spacial distribution of agents after the seeding stage for the three cases considered here. We consider the following three complementary statistics and assess their distribution using violin plots:

**Degrees** The distribution of degrees in the communication graphs. This metric only takes into account the communication graph $\mathcal{G}$ itself, without considering the distance between agents.

$d_{\min}/\sigma$ The distance between the focal agent and its closest neighbors divided by $\sigma$, the field of perception of the agents. This metric only takes into account the distance to one neighbor, without involving the communication graph $\mathcal{G}$.

**Cell Surface of Voronoi tessellation** The area of each cells obtained by computing a Voronoi tessellation of the positions of the agents in the arena (constrained by the geometry of the arena). This metric only takes into account the spatial size of neighborhoods, without involving the communication graph $\mathcal{G}$. The Voronoi tessellation is computed in our Python scripts using the Geopandas and shapely packages [62,63].

In both configurations, the results of cases **sim-small-2-dispersion** and **sim-small-2-random** are generally similar for the degrees and cell surface metrics and differ from the results of case **sim-small-2-uniform**. The results of the $d_{\min}/\sigma$ metric suggest that agents tend to be more packed together in the **sim-small-2-dispersion** and **sim-small-2-random** cases compared to the **sim-small-2-uniform** – this matches the examples of Supplementary Fig. 13. The cell surfaces in the uniform case has generally less variability compared to the other cases (at least for the annulus): indeed all agents are equidistant to their neighbors in this case. In turn, the discretization of the shape is more uniform in the **sim-small-2-uniform** case.

Note however, when the number of agents is sufficiently low, it is very possible to obtain a graph of agents with multiple graph components (cf Supplementary Fig. 13, i.e., a graph that is not fully connected. This will have a different set of consequences depending on the case:

**sim-small-2-dispersion** The agents move and change their neighbors every iteration. Consequently, the graph components do not stay static over iterations: they may sometimes merge together or split; some agents may go from one component to another. In turn, the estimations of $\lambda_2$ will be periodically transferred from component to component, making the system able to correctly (but imprecisely) estimate $\lambda_2$ while sometimes having more than one graph component. That means that it is still possible to have a classification
<figure><img src="image_18.png" /><figcaption>Supplementary Figure 12: Density of agents in the arenas after the initial seeding, for cases with arena surface $S = 70000\text{mm}^2$ and for two different configurations (either 25 or 45 agents). Results were obtained over 64 runs.</figcaption></figure>

with high-performing accuracy even if there are more than one component. Of course, if the number of components is too high (i.e., the number of agents is too low), such computation will be impossible: the diffusion sessions will diverge, and/or the information from one component to another won't be transferred, resulting in an inaccurate classification.

**sim-small-2-random** The agents are immobile and always keep the same neighbors. Therefore, isolated agents will always remain isolated and graph components will not be able to communicate with each other over multiple iterations. This will result in each component doing its own independent estimation of $\lambda_2$. As this estimation assumes that the agents are distributed across the entire arena, this process will almost always result in an incorrect (rather than imprecise) estimation, only taking into account the spaces covered by each component.

**sim-small-2-uniform** The agents are immobile and equidistributed in the arena. As such, if there are several components, it follows that there are actually *N* components, that is, the agents are all too distant from each other to communicate. In this case, all agents are isolated and the diffusion stages cannot be computed, resulting in undecided classification results.

These findings are corroborated by Supplementary Fig. 15, showing the difference in accuracy scores between the three cases after 10 iterations (the number of 10 iterations was selected so that $\text{Final}\lambda_2$ estimations have converged for all settings). The case **sim-small-2-dispersion** has generally higher (or at least equivalent) accuracy than the **sim-small-2-random** case: as explained before, it may be attributed to the capacity of the former to have agents that change neighbors across iterations. In particular, that is the case when $\sigma$ is small ($\le 85\text{mm}$, i.e., the realistic range for Kilobots), placing the system below the optimal $\alpha = 17$ hyperbole or to the right of this hyperbole: in these settings, the dispersion case having far higher scores than the random case.

Both the **sim-small-2-dispersion** and **sim-small-2-uniform** cases have similar (100%) accuracy scores close to the optimal $\alpha = 17$ hyperbole (1). The latter has better scores than the former immediately below *p* (2), while the dispersion case outperforms the uniform case above and to the right of *p* (3), and with settings with low values of *N* ($\le 40$) and $\sigma$ ($\le 85\text{mm}$) (4). The good results of the uniform case in (1) and (2) can be explained by considering an uniform distribution of agents in the arena: it both ensures that the graph is connected (except for settings where the agents are too far from each other) and that the discretization of the shape is uniform (each point occupies a Voronoi cell that all have similar size). However, the agents in
<figure><img src="image_17.png" /><figcaption>Supplementary Figure 12: Density of agents in the arenas after the initial seeding, for cases with arena surface $S = 70000\text{mm}^2$ and for two different configurations (either 25 or 45 agents). Results were obtained over 64 runs.</figcaption></figure>

with high-performing accuracy even if there are more than one component. Of course, if the number of components is too high (i.e., the number of agents is too low), such computation will be impossible: the diffusion sessions will diverge, and/or the information from one component to another won't be transferred, resulting in an inaccurate classification.

**sim-small-2-random** The agents are immobile and always keep the same neighbors. Therefore, isolated agents will always remain isolated and graph components will not be able to communicate with each other over multiple iterations. This will result in each component doing its own independent estimation of $\lambda_2$. As this estimation assumes that the agents are distributed across the entire arena, this process will almost always result in an incorrect (rather than imprecise) estimation, only taking into account the spaces covered by each component.

**sim-small-2-uniform** The agents are immobile and equidistributed in the arena. As such, if there are several components, it follows that there are actually *N* components, that is, the agents are all too distant from each other to communicate. In this case, all agents are isolated and the diffusion stages cannot be computed, resulting in undecided classification results.

These findings are corroborated by Supplementary Fig. 15, showing the difference in accuracy scores between the three cases after 10 iterations (the number of 10 iterations was selected so that $\text{Final}\lambda_2$ estimations have converged for all settings). The case **sim-small-2-dispersion** has generally higher (or at least equivalent) accuracy than the **sim-small-2-random** case: as explained before, it may be attributed to the capacity of the former to have agents that change neighbors across iterations. In particular, that is the case when $\sigma$ is small ($\le 85\text{mm}$, i.e., the realistic range for Kilobots), placing the system below the optimal $\alpha = 17$ hyperbole or to the right of this hyperbole: in these settings, the dispersion case having far higher scores than the random case.

Both the **sim-small-2-dispersion** and **sim-small-2-uniform** cases have similar (100%) accuracy scores close to the optimal $\alpha = 17$ hyperbole (1). The latter has better scores than the former immediately below *p* (2), while the dispersion case outperforms the uniform case above and to the right of *p* (3), and with settings with low values of *N* ($\le 40$) and $\sigma$ ($\le 85\text{mm}$) (4). The good results of the uniform case in (1) and (2) can be explained by considering an uniform distribution of agents in the arena: it both ensures that the graph is connected (except for settings where the agents are too far from each other) and that the discretization of the shape is uniform (each point occupies a Voronoi cell that all have similar size). However, the agents in
<figure><img src="image_19.png" /><figcaption>Supplementary Figure 13: Examples of position of the agents after the initial seeding, for cases with arena surface $S = 70000\text{mm}^2$ and for two different configurations (either 25 or 45 agents).</figcaption></figure>

the uniform case do not move and always keep the same neighbors at each iteration; while this lowers the variability in $Final\lambda_2$ estimations, it also makes the estimation less resilient to graph artifacts that could bias such estimations (e.g., small number of agents diverging, affecting their entire neighborhood). This may also be the case in the (3) settings where the uniform case may have graphs that are too dense, increasing the probability of divergences and computation anomalies during the diffusion stages; this is alleviated in the dispersion case by changing neighbors at each iteration. In the (4) settings, the uniform distribution will have agents that are too far apart from each other to be able to communicate, while the dispersion case would still have clusters of agents sufficiently close to each other to estimate $Final\lambda_2$, possibly using only the local geometry, as the graph will be too small to match the entire surface of the arenas with those settings.

Finally, Supplementary Figs. 16, 17 and 18 show the results in accuracy after 1 and 10 iterations respectively for cases **sim-small-2-dispersion**, **sim-small-2-random** and **sim-small-2-uniform**. They also show the influence of the parameters *N* and *σ* on the ordering of the values of $Final\lambda_2$ corresponding to the two arenas (cf Sec. 5.1 for details). The results are consistent with our previous analysis in Supplementary Fig. 15, with rankings showing demarcation lines between regimes.

In the end, the **sim-small-2-dispersion** and **sim-small-2-uniform** are complementary and may be selected depending on *N* and *σ*. They exhibit similar results on the optimal *α* = 17 hyperbole.
<figure><img src="image_18.png" /><figcaption>Supplementary Figure 13: Examples of position of the agents after the initial seeding, for cases with arena surface $S = 70000\text{mm}^2$ and for two different configurations (either 25 or 45 agents).</figcaption></figure>

the uniform case do not move and always keep the same neighbors at each iteration; while this lowers the variability in $Final\lambda_2$ estimations, it also makes the estimation less resilient to graph artifacts that could bias such estimations (e.g., small number of agents diverging, affecting their entire neighborhood). This may also be the case in the (3) settings where the uniform case may have graphs that are too dense, increasing the probability of divergences and computation anomalies during the diffusion stages; this is alleviated in the dispersion case by changing neighbors at each iteration. In the (4) settings, the uniform distribution will have agents that are too far apart from each other to be able to communicate, while the dispersion case would still have clusters of agents sufficiently close to each other to estimate $Final\lambda_2$, possibly using only the local geometry, as the graph will be too small to match the entire surface of the arenas with those settings.

Finally, Supplementary Figs. 16, 17 and 18 show the results in accuracy after 1 and 10 iterations respectively for cases **sim-small-2-dispersion**, **sim-small-2-random** and **sim-small-2-uniform**. They also show the influence of the parameters *N* and *σ* on the ordering of the values of $Final\lambda_2$ corresponding to the two arenas (cf Sec. 5.1 for details). The results are consistent with our previous analysis in Supplementary Fig. 15, with rankings showing demarcation lines between regimes.

In the end, the **sim-small-2-dispersion** and **sim-small-2-uniform** are complementary and may be selected depending on *N* and *σ*. They exhibit similar results on the optimal *α* = 17 hyperbole.
<figure><img src="image_20.png" /><figcaption>Supplementary Figure 14: Statistical analysis of the different types of agent dispersion in arenas of surface S = 70000mm². We consider the **sim-small-2-dispersion**, **sim-small-2-random**, and **sim-small-2-uniform** cases – named in the figure “dispersion”, “random” and “uniform” respectively. Two configurations are considered, using 25 and 45 agents respectively. Statistical significance is computed using the two-sided Mann-Whitney-Wilcoxon test with Bonferroni correction. Significant pairs are designated as follows: ns: 0.05 < *p* ≤ 1.00, *: 0.01 < *p* ≤ 0.05, **: 0.001 < *p* ≤ 0.01, ***: 0.0001 < *p* ≤ 0.001, ****: *p* ≤ 0.0001.</figcaption></figure>
<figure><img src="image_19.png" /><figcaption>Supplementary Figure 14: Statistical analysis of the different types of agent dispersion in arenas of surface S = 70000mm². We consider the **sim-small-2-dispersion**, **sim-small-2-random**, and **sim-small-2-uniform** cases – named in the figure “dispersion”, “random” and “uniform” respectively. Two configurations are considered, using 25 and 45 agents respectively. Statistical significance is computed using the two-sided Mann-Whitney-Wilcoxon test with Bonferroni correction. Significant pairs are designated as follows: ns: 0.05 < *p* ≤ 1.00, *: 0.01 < *p* ≤ 0.05, **: 0.001 < *p* ≤ 0.01, ***: 0.0001 < *p* ≤ 0.001, ****: *p* ≤ 0.0001.</figcaption></figure>
<figure><img src="image_21.png" /><figcaption>Supplementary Figure 15: Difference in accuracy scores between cases **sim-small-2-dispersion**, **sim-small-2-random** and **sim-small-2-uniform**, depending on the number of agents and their field of perception. All results are obtained in simulations over 10 iterations and over 64 runs. Each bin of the 2D histograms corresponds to the difference between the accuracy score of the **sim-small-2-dispersion** with the scores of either the **sim-small-2-random** (top) or the **sim-small-2-uniform** case (bottom). We adjust the accuracy score to only show results where the simulated diffusion sessions in the swarm do not diverge: empty bins correspond to results where there are more than 50% of the runs exhibiting divergences.</figcaption></figure>
<figure><img src="image_20.png" /></figure>

Supplementary Figure 15: Difference in accuracy scores between cases **sim-small-2-dispersion**, **sim-small-2-random** and **sim-small-2-uniform**, depending on the number of agents and their field of perception. All results are obtained in simulations over 10 iterations and over 64 runs. Each bin of the 2D histograms corresponds to the difference between the accuracy score of the **sim-small-2-dispersion** with the scores of either the **sim-small-2-random** (top) or the **sim-small-2-uniform** case (bottom). We adjust the accuracy score to only show results where the simulated diffusion sessions in the swarm do not diverge: empty bins correspond to results where there are more than 50% of the runs exhibiting divergences.
<figure><img src="image_22.png" /></figure>

<figure><img src="image_23.png" /></figure>

<figure><img src="image_24.png" /><figcaption>Supplementary Figure 16: Evolution of the accuracy depending on the number of agents and their field of perception, for the case in simulation **sim-small-2-dispersion**. In this case, we consider 2 arenas (disk vs annulus) of surface $S = 70000mm^2$ and the robots use the run-and-tumble dispersion algorithm to move throughout the arenas between each iteration. All results are computed over 64 runs of simulation. We adjust the accuracy score to only show results where the simulated diffusion sessions in the swarm do not diverge: empty bins correspond to results where there are more than 50% of runs exhibiting divergences. **Top:** results with only 1 iteration. **Middle:** results obtained after 10 iterations. **Bottom:** Ranking of the order of values of the Final$\lambda_2$ centroids for the disk arena.</figcaption></figure>
<figure><img src="image_21.png" /></figure>

<figure><img src="image_22.png" /></figure>

<figure><img src="image_23.png" /><figcaption>Supplementary Figure 16: Evolution of the accuracy depending on the number of agents and their field of perception, for the case in simulation **sim-small-2-dispersion**. In this case, we consider 2 arenas (disk vs annulus) of surface $S = 70000mm^2$ and the robots use the run-and-tumble dispersion algorithm to move throughout the arenas between each iteration. All results are computed over 64 runs of simulation. We adjust the accuracy score to only show results where the simulated diffusion sessions in the swarm do not diverge: empty bins correspond to results where there are more than 50% of runs exhibiting divergences. **Top:** results with only 1 iteration. **Middle:** results obtained after 10 iterations. **Bottom:** Ranking of the order of values of the Final$\lambda_2$ centroids for the disk arena.</figcaption></figure>
<figure><img src="image_25.png" /></figure>

<figure><img src="image_26.png" /></figure>

<figure><img src="image_27.png" /><figcaption>Supplementary Figure 17: Evolution of the accuracy depending on the number of agents and their field of perception, for the case in simulation **sim-small-2-random**. In this case, we consider 2 arenas (disk vs annulus) of surface $S = 70000mm^2$ and the robots always stay immobile during the simulation. The initial position of the robots inside the arenas are random (2D uniform distribution). All results are computed over 64 runs of simulation. We adjust the accuracy score to only show results where the simulated diffusion sessions in the swarm do not diverge: empty bins correspond to results where there are more than 50% of runs exhibiting divergences. **Top:** results after 1 iteration. **Middle:** results after 10 iterations. **Bottom:** Ranking of the values of the Final$\lambda_2$ centroids for the disk arena.</figcaption></figure>
<figure><img src="image_24.png" /></figure>

<figure><img src="image_25.png" /></figure>

<figure><img src="image_26.png" /><figcaption>Supplementary Figure 17: Evolution of the accuracy depending on the number of agents and their field of perception, for the case in simulation **sim-small-2-random**. In this case, we consider 2 arenas (disk vs annulus) of surface $S = 70000mm^2$ and the robots always stay immobile during the simulation. The initial position of the robots inside the arenas are random (2D uniform distribution). All results are computed over 64 runs of simulation. We adjust the accuracy score to only show results where the simulated diffusion sessions in the swarm do not diverge: empty bins correspond to results where there are more than 50% of runs exhibiting divergences. **Top:** results after 1 iteration. **Middle:** results after 10 iterations. **Bottom:** Ranking of the values of the Final$\lambda_2$ centroids for the disk arena.</figcaption></figure>
<figure><img src="image_28.png" /></figure>

<figure><img src="image_29.png" /></figure>

<figure><img src="image_30.png" /><figcaption>Supplementary Figure 18: Evolution of the accuracy with respect to the number of agents and their field of perception, for the case in simulation **sim-small-2-uniform**. In this case, we consider 2 arenas (disk vs annulus) of surface $S = 70000mm^2$ and the robots always stay immobile during the simulation. Robots are distributed uniformly in the arenas, so that they are equidistant to their neighbors (obtained through Voronoi tessellation). All results are computed over 64 runs of simulation. We adjust the accuracy score to only show results where the simulated diffusion sessions in the swarm do not diverge: empty bins correspond to results where there are more than 50% of runs exhibiting divergences. **Top:** results after one iteration. **Middle:** results after 10 iterations. **Bottom:** Ranking of the values of the Finalλ₂ centroids for the disk arena.</figcaption></figure>
<figure><img src="image_27.png" /></figure>

<figure><img src="image_28.png" /></figure>

<figure><img src="image_29.png" /><figcaption>Supplementary Figure 18: Evolution of the accuracy with respect to the number of agents and their field of perception, for the case in simulation **sim-small-2-uniform**. In this case, we consider 2 arenas (disk vs annulus) of surface $S = 70000mm^2$ and the robots always stay immobile during the simulation. Robots are distributed uniformly in the arenas, so that they are equidistant to their neighbors (obtained through Voronoi tessellation). All results are computed over 64 runs of simulation. We adjust the accuracy score to only show results where the simulated diffusion sessions in the swarm do not diverge: empty bins correspond to results where there are more than 50% of runs exhibiting divergences. **Top:** results after one iteration. **Middle:** results after 10 iterations. **Bottom:** Ranking of the values of the Finalλ₂ centroids for the disk arena.</figcaption></figure>
## 5.3 Experimental runs with Kilobots & Supplementary Videos

All Kilobots experiments involve the experimental case **expe-2** described in Supplementary Table 4. Individual runs and obtained classification results are listed in Supplementary Table 6. The raw video files of all experiments are made available at the following link: https://e.pcloud.link/publink/show?code=kZY21SZoia38Rb7tFj0mXK4jwqqmJe18Kmk.

Additionally, we provide three explanatory videos as supplementary materials, described as follow:

Video **SI1** (https://e.pcloud.link/publink/show?code=XZdVJjZKeAay878b8ysf33nFmRnP7mJy80X) presents the results of the **expe-2** case, involving experiments with 25 robots in arenas of surface equals to $S = 70000mm^2$. First, we display the observed behavior of the DDSA algorithm on one experimental run with the disk and annulus arenas. This is illustrated by a time-lapse showing the active LED colors of each robots, both in the “diffusion” and “$\lambda_2$ estimation” stages of the algorithm. Then, we concurrently present the results obtained through all experimental runs of Supplementary Table 6.

Video **SI2** (https://e.pcloud.link/publink/show?code=XZIVJjZ3UkDoIU0aKkwMOVJxz00WSFHAi77) compares experimental results of case **expe-2** with simulation results of case **sim-2**. Both experimental and simulated agents are driven by the same controllers implementing the spectral swarm robotics algorithm on a Kilobot architecture. In either cases, we observe similar dynamics, for the “diffusion” (swarm exhibit a correct partitioning) and “$\lambda_2$ estimation” (swarm correctly classify arenas) stages.

Video **SI3** (https://e.pcloud.link/publink/show?code=XZGVJjZ7701LvCtiY7URffCtgVCq88zhwXV) showcases swarm behavior in the **sim-large-7** case, with parameters of regime r3 (shown in Main Text Figs. 2 and 3). It involves 300 agents with a field of perception of 85mm and 7 arenas of surface equals to $S = 500000mm^2$. This video presents a time lapse similar to the one in Main Text Fig. 2, both for the “diffusion” and “$\lambda_2$ estimation” stages of the algorithm.

<table><thead><tr><th>Exp. number</th><th>Associated video file</th><th>Disk classification</th><th>Annulus classification</th><th>Additional notes</th></tr></thead><tbody><tr><td>0</td><td>2022-07-21_14-16-04.mp4</td><td>Disk</td><td>Annulus</td><td>Disk LED color is orange instead of cyan (early version of the color set), code, parameters, centroids are the same as other experiments.</td></tr><tr><td>1</td><td>2022-07-21_15-47-12.mp4</td><td>Disk</td><td>Annulus</td><td>-</td></tr><tr><td>2</td><td>2022-07-22_10-18-21.mp4</td><td>Disk</td><td>Annulus</td><td>-</td></tr><tr><td>3</td><td>2022-07-22_11-50-10.mp4</td><td>Annulus</td><td>Annulus</td><td>-</td></tr><tr><td>4</td><td>2022-07-22_13-33-07.mp4</td><td>Disk</td><td>Disk</td><td>-</td></tr><tr><td>5</td><td>2022-07-22_15-25-54.mp4</td><td>Disk</td><td>Annulus</td><td>-</td></tr><tr><td>6</td><td>2022-07-22_17-06-29.mp4</td><td>Disk</td><td>Disk</td><td>-</td></tr><tr><td>7</td><td>2022-09-15_15-45-26.mp4</td><td>Disk</td><td>Disk</td><td>-</td></tr><tr><td>8</td><td>2022-09-16_10-38-16.mp4</td><td>Disk</td><td>Annulus</td><td>-</td></tr><tr><td>9</td><td>2022-09-16_12-42-32.mp4</td><td>Annulus</td><td>Annulus</td><td>-</td></tr><tr><td>10</td><td>2022-09-19_10-41-44.mp4</td><td>Annulus</td><td>Annulus</td><td>-</td></tr><tr><td>11</td><td>2022-09-19_12-14-47.mp4</td><td>Disk</td><td>Annulus</td><td>-</td></tr><tr><td>12</td><td>2022-09-19_13-43-33.mp4</td><td>Disk</td><td>Disk</td><td>-</td></tr><tr><td>13</td><td>2022-09-19_15-24-21.mp4</td><td>Disk</td><td>Annulus</td><td>-</td></tr><tr><td>14</td><td>2022-09-19_16-58-24.mp4</td><td>Annulus</td><td>Annulus</td><td>-</td></tr></tbody></table>

Supplementary Table 6: List of experimental runs and names of associated video files. Each experiment involved two arenas: Disk (color code: cyan) and Annulus (color code: violet). Correctly detected arenas are in bold. Note that experiment 0 used the color code “orange” rather than cyan, as we initially intended to use the former to indicate a disk arena. We changed the color code to violet to ease visualization. However, the results of this experiment remain correct, as they used the same code, parameters and centroids as the other 14 experiments. Raw video files can be found at https://e.pcloud.link/publink/show?code=kZY21SZoia38Rb7tFj0mXK4jwqqmJe18Kmk

## References

[1] M Rubenstein, C Ahler, and R Nagpal. Kilobot: A low cost scalable robot system for collective behaviors. In *2012 IEEE international conference on robotics and automation*, pages 3293–3298. IEEE, 2012.

[2] M Rubenstein, A Cornejo, and R Nagpal. Programmable self-assembly in a thousand-robot swarm. *Science*, 2014.
## 5.3 Experimental runs with Kilobots & Supplementary Videos

All Kilobots experiments involve the experimental case **expe-2** described in Supplementary Table 4. Individual runs and obtained classification results are listed in Supplementary Table 6. The raw video files of all experiments are made available at the following link: https://e.pcloud.link/publink/show?code=kZY21SZoia38Rb7tFj0mXK4jwqqmJe18Kmk.

Additionally, we provide three explanatory videos as supplementary materials, described as follow:

Video **SI1** (https://e.pcloud.link/publink/show?code=XZdVJjZXeAay878b8ysf33nFmRnP7mJy80X) presents the results of the **expe-2** case, involving experiments with 25 robots in arenas of surface equals to $S = 70000mm^2$. First, we display the observed behavior of the DDSA algorithm on one experimental run with the disk and annulus arenas. This is illustrated by a time-lapse showing the active LED colors of each robots, both in the “diffusion” and “$\lambda_2$ estimation” stages of the algorithm. Then, we concurrently present the results obtained through all experimental runs of Supplementary Table 6.

Video **SI2** (https://e.pcloud.link/publink/show?code=XZIVJjZ3UkDoIU0aKkwMOVJxz0OWSFHAi77) compares experimental results of case **expe-2** with simulation results of case **sim-2**. Both experimental and simulated agents are driven by the same controllers implementing the spectral swarm robotics algorithm on a Kilobot architecture. In either cases, we observe similar dynamics, for the “diffusion” (swarm exhibit a correct partitioning) and “$\lambda_2$ estimation” (swarm correctly classify arenas) stages.

Video **SI3** (https://e.pcloud.link/publink/show?code=XZGVJjZ7701LvCtiY7URffCtgVCq88zhwXV) showcases swarm behavior in the **sim-large-7** case, with parameters of regime r3 (shown in Main Text Figs. 2 and 3). It involves 300 agents with a field of perception of 85mm and 7 arenas of surface equals to $S = 500000mm^2$. This video presents a time lapse similar to the one in Main Text Fig. 2, both for the “diffusion” and “$\lambda_2$ estimation” stages of the algorithm.

<table><thead><tr><th>Exp. number</th><th>Associated video file</th><th>Disk classification</th><th>Annulus classification</th><th>Additional notes</th></tr></thead><tbody><tr><td>0</td><td>2022-07-21_14-16-04.mp4</td><td>Disk</td><td>Annulus</td><td>Disk LED color is orange instead of cyan (early version of the color set), code, parameters, centroids are the same as other experiments.</td></tr><tr><td>1</td><td>2022-07-21_15-47-12.mp4</td><td>Disk</td><td>Annulus</td><td>-</td></tr><tr><td>2</td><td>2022-07-22_10-18-21.mp4</td><td>Disk</td><td>Annulus</td><td>-</td></tr><tr><td>3</td><td>2022-07-22_11-50-10.mp4</td><td>Annulus</td><td>Annulus</td><td>-</td></tr><tr><td>4</td><td>2022-07-22_13-33-07.mp4</td><td>Disk</td><td>Disk</td><td>-</td></tr><tr><td>5</td><td>2022-07-22_15-25-54.mp4</td><td>Disk</td><td>Annulus</td><td>-</td></tr><tr><td>6</td><td>2022-07-22_17-06-29.mp4</td><td>Disk</td><td>Disk</td><td>-</td></tr><tr><td>7</td><td>2022-09-15_15-45-26.mp4</td><td>Disk</td><td>Disk</td><td>-</td></tr><tr><td>8</td><td>2022-09-16_10-38-16.mp4</td><td>Disk</td><td>Annulus</td><td>-</td></tr><tr><td>9</td><td>2022-09-16_12-42-32.mp4</td><td>Annulus</td><td>Annulus</td><td>-</td></tr><tr><td>10</td><td>2022-09-19_10-41-44.mp4</td><td>Annulus</td><td>Annulus</td><td>-</td></tr><tr><td>11</td><td>2022-09-19_12-14-47.mp4</td><td>Disk</td><td>Annulus</td><td>-</td></tr><tr><td>12</td><td>2022-09-19_13-43-33.mp4</td><td>Disk</td><td>Disk</td><td>-</td></tr><tr><td>13</td><td>2022-09-19_15-24-21.mp4</td><td>Disk</td><td>Annulus</td><td>-</td></tr><tr><td>14</td><td>2022-09-19_16-58-24.mp4</td><td>Annulus</td><td>Annulus</td><td>-</td></tr></tbody></table>

Supplementary Table 6: List of experimental runs and names of associated video files. Each experiment involved two arenas: Disk (color code: cyan) and Annulus (color code: violet). Correctly detected arenas are in bold. Note that experiment 0 used the color code “orange” rather than cyan, as we initially intended to use the former to indicate a disk arena. We changed the color code to violet to ease visualization. However, the results of this experiment remain correct, as they used the same code, parameters and centroids as the other 14 experiments. Raw video files can be found at https://e.pcloud.link/publink/show?code=kZY21SZoia38Rb7tFj0mXK4jwqqmJe18Kmk

## References

[1] M Rubenstein, C Ahler, and R Nagpal. Kilobot: A low cost scalable robot system for collective behaviors. In *2012 IEEE international conference on robotics and automation*, pages 3293–3298. IEEE, 2012.

[2] M Rubenstein, A Cornejo, and R Nagpal. Programmable self-assembly in a thousand-robot swarm. *Science*, 2014.
[3] H Hamann. *Swarm robotics: A formal approach*, volume 221. Springer, 2018.

[4] CR Kube and H Zhang. Collective robotics: From social insects to robots. *Adaptive Behavior*, 1993.

[5] R Pfeifer, M Lungarella, and F Iida. Self-organization, embodiment, and biologically inspired robotics. *Science*, 2007.

[6] J Werfel, K Petersen, and R Nagpal. Designing collective behavior in a termite-inspired robot construction team. *Science*, 2014.

[7] I Slavkov, D Carrillo-Zapata, N Carranza, X Diego, F Jansson, J Kaandorp, S Hauert, and J Sharpe. Morphogenesis in robot swarms. *Science Robotics*, 2018.

[8] C Virágh, G Vásárhelyi, N Tarcai, T Szörényi, G Somorjai, T Nepusz, and T Vicsek. Flocking algorithm for autonomous flying robots. *Bioinspiration & biomimetics*, 9(2):025012, 2014.

[9] M Coppola, KN McGuire, C De Wagter, and G De Croon. A survey on swarming with micro air vehicles: Fundamental challenges and constraints. *Frontiers in Robotics and AI*, 7:18, 2020.

[10] N Bredeche and N Fontbonne. Social learning in swarm robotics. *Philosophical Transactions of the Royal Society B*, 2022.

[11] JF Boudet, J Lintuvuori, C Lacouture, T Barois, A Deblais, K Xie, S Cassagnere, B Tregon, DB Brückner, JC Baret, et al. From collections of independent, mindless robots to flexible, mobile, and directional superstructures. *Science Robotics*, 6(56):eabd0272, 2021.

[12] A Reina, E Ferrante, and G Valentini. Collective decision-making in living and artificial systems. *Swarm Intelligence*, 15(1-2):1-6, 2021.

[13] CW Reynolds. Flocks, herds and schools: A distributed behavioral model. In *SIGGRAPH*, 1987.

[14] T Vicsek, A Czirók, E Ben-Jacob, I Cohen, and O Shochet. Novel type of phase transition in a system of self-driven particles. *Physical review letters*, 1995.

[15] T Vicsek and A Zafeiris. Collective motion. *Physics Reports*, 2012.

[16] C Detrain and JL Deneubourg. Collective decision-making and foraging patterns in ants and honeybees. *Advances in insect physiology*, 2008.

[17] JW Bradbury, SL Vehrencamp, et al. Principles of animal communication. 132, 1998.

[18] EO Wilson. *Sociobiology: The New Synthesis, Twenty-Fifth Anniversary Edition*. Harvard University Press, 2000.

[19] A Attanasii, A Cavagna, L Del Castello, I Giardina, TS Grigera, A Jelić, S Melillo, L Parisi, O Pohl, E Shen, et al. Information transfer and behavioural inertia in starling flocks. *Nature Physics*, 2014.

[20] S Camazine, JL Deneubourg, NR Franks, J Sneyd, G Theraula, and E Bonabeau. Self-organization in biological systems. In *Self-organization in biological systems*. Princeton university press, 2020.

[21] AM Turing. The chemical basis of morphogenesis. *Bulletin of mathematical biology*, 52(1-2):153-197, 1990.

[22] LC Evans. *Partial differential equations*, volume 19. American Mathematical Society, 2022.

[23] W Arendt, R Nittka, W Peter, and F Steiner. Weyl's law: Spectral properties of the laplacian in mathematics and physics. *Mathematical analysis of evolution, information, and complexity*, pages 1-71, 2009.

[24] D Spielman. Spectral graph theory. *Combinatorial scientific computing*, 18, 2012.

[25] FRK Chung. *Spectral graph theory*, volume 92. American Mathematical Society, 1997.

[26] M Kac. Can one hear the shape of a drum? *The American Mathematical Monthly*, 1966.

[27] KF Riley, MP Hobson, and SJ Bence. Mathematical methods for physics and engineering, 1999.

[28] M Reuter, FE Wolter, and N Peinecke. Laplace–beltrami spectra as ‘Shape-DNA’ of surfaces and solids. *Computer-Aided Design*, 2006.

[29] M Belkin, P Niyogi, and V Sindhwani. Manifold regularization: A geometric framework for learning from labeled and unlabeled examples. *Journal of Machine Learning Research*, 2006.
[3] H Hamann. *Swarm robotics: A formal approach*, volume 221. Springer, 2018.

[4] CR Kube and H Zhang. Collective robotics: From social insects to robots. *Adaptive Behavior*, 1993.

[5] R Pfeifer, M Lungarella, and F Iida. Self-organization, embodiment, and biologically inspired robotics. *Science*, 2007.

[6] J Werfel, K Petersen, and R Nagpal. Designing collective behavior in a termite-inspired robot construction team. *Science*, 2014.

[7] I Slavkov, D Carrillo-Zapata, N Carranza, X Diego, F Jansson, J Kaandorp, S Hauert, and J Sharpe. Morphogenesis in robot swarms. *Science Robotics*, 2018.

[8] C Virágh, G Vásárhelyi, N Tarcai, T Szörényi, G Somorjai, T Nepusz, and T Vicsek. Flocking algorithm for autonomous flying robots. *Bioinspiration & biomimetics*, 9(2):025012, 2014.

[9] M Coppola, KN McGuire, C De Wagter, and G De Croon. A survey on swarming with micro air vehicles: Fundamental challenges and constraints. *Frontiers in Robotics and AI*, 7:18, 2020.

[10] N Bredeche and N Fontbonne. Social learning in swarm robotics. *Philosophical Transactions of the Royal Society B*, 2022.

[11] JF Boudet, J Lintuvuori, C Lacouture, T Barois, A Deblais, K Xie, S Cassagnere, B Tregon, DB Brückner, JC Baret, et al. From collections of independent, mindless robots to flexible, mobile, and directional superstructures. *Science Robotics*, 6(56):eabd0272, 2021.

[12] A Reina, E Ferrante, and G Valentini. Collective decision-making in living and artificial systems. *Swarm Intelligence*, 15(1-2):1-6, 2021.

[13] CW Reynolds. Flocks, herds and schools: A distributed behavioral model. In *SIGGRAPH*, 1987.

[14] T Vicsek, A Czirók, E Ben-Jacob, I Cohen, and O Shochet. Novel type of phase transition in a system of self-driven particles. *Physical review letters*, 1995.

[15] T Vicsek and A Zafeiris. Collective motion. *Physics Reports*, 2012.

[16] C Detrain and JL Deneubourg. Collective decision-making and foraging patterns in ants and honeybees. *Advances in insect physiology*, 2008.

[17] JW Bradbury, SL Vehrencamp, et al. Principles of animal communication. 132, 1998.

[18] EO Wilson. *Sociobiology: The New Synthesis, Twenty-Fifth Anniversary Edition*. Harvard University Press, 2000.

[19] A Attanasii, A Cavagna, L Del Castello, I Giardina, TS Grigera, A Jelić, S Melillo, L Parisi, O Pohl, E Shen, et al. Information transfer and behavioural inertia in starling flocks. *Nature Physics*, 2014.

[20] S Camazine, JL Deneubourg, NR Franks, J Sneyd, G Theraula, and E Bonabeau. Self-organization in biological systems. In *Self-organization in biological systems*. Princeton university press, 2020.

[21] AM Turing. The chemical basis of morphogenesis. *Bulletin of mathematical biology*, 52(1-2):153-197, 1990.

[22] LC Evans. *Partial differential equations*, volume 19. American Mathematical Society, 2022.

[23] W Arendt, R Nittka, W Peter, and F Steiner. Weyl's law: Spectral properties of the laplacian in mathematics and physics. *Mathematical analysis of evolution, information, and complexity*, pages 1-71, 2009.

[24] D Spielman. Spectral graph theory. *Combinatorial scientific computing*, 18, 2012.

[25] FRK Chung. *Spectral graph theory*, volume 92. American Mathematical Society, 1997.

[26] M Kac. Can one hear the shape of a drum? *The American Mathematical Monthly*, 1966.

[27] KF Riley, MP Hobson, and SJ Bence. Mathematical methods for physics and engineering, 1999.

[28] M Reuter, FE Wolter, and N Peinecke. Laplace–beltrami spectra as ‘Shape-DNA’ of surfaces and solids. *Computer-Aided Design*, 2006.

[29] M Belkin, P Niyogi, and V Sindhwani. Manifold regularization: A geometric framework for learning from labeled and unlabeled examples. *Journal of Machine Learning Research*, 2006.
[30] RM Rustamov et al. Laplace-beltrami eigenfunctions for deformation invariant shape representation. In *Symposium on geometry processing*, volume 257, pages 225–233, 2007.

[31] A Ng, M Jordan, and Y Weiss. On spectral clustering: Analysis and an algorithm. *Advances in neural information processing systems*, 14, 2001.

[32] U Von Luxburg. A tutorial on spectral clustering. *Statistics and computing*, 17:395–416, 2007.

[33] M Fiedler. Laplacian of graphs and algebraic connectivity. *Banach Center Publications*, 1(25):57–70, 1989.

[34] Y Wang and J Solomon. Intrinsic and extrinsic operators for shape analysis. In *Handbook of numerical analysis*, volume 20, pages 41–115. Elsevier, 2019.

[35] MS Talamali, A Saha, JAR Marshall, and A Reina. When less is more: Robot swarms adapt better to changes with constrained communication. *Science Robotics*, 6(56):eabf1416, 2021.

[36] M Gauci, ME Ortiz, M Rubenstein, and R Nagpal. Error cascades in collective behavior: a case study of the gradient algorithm on 1000 physical agents. In *Proceedings of the 16th Conference on Autonomous Agents and MultiAgent Systems*, pages 1404–1412, 2017.

[37] H Wang and M Rubenstein. A fast, accurate, and scalable probabilistic sample-based approach for counting swarm size. In *2020 IEEE International Conference on Robotics and Automation (ICRA)*, pages 7180–7185. IEEE, 2020.

[38] C Gordon, DL Webb, and S Wolpert. One cannot hear the shape of a drum. *Bulletin of the American Mathematical Society*, 27(1):134–138, 1992.

[39] MY Ben Zion, J Fersula, N Bredeche, and O Dauchot. Morphological computation and decentralized learning in a swarm of sterically interacting robots. *Science Robotics*, 8(75):eabo6140, 2023.

[40] DI Shuman, SK Narang, P Frossard, A Ortega, and P Vandergheynst. The emerging field of signal processing on graphs: Extending high-dimensional data analysis to networks and other irregular domains. *IEEE signal processing magazine*, 30(3):83–98, 2013.

[41] M Divband Soorati, P Zahadat, J Ghofrani, and H Hamann. Adaptive path formation in self-assembling robot swarms by tree-like vascular morphogenesis. In *Distributed Autonomous Robotic Systems: The 14th International Symposium*, pages 299–311. Springer, 2019.

[42] F Pratissoli, A Reina, Y Kaszubowski Lopes, C Pinciroli, G Miyauchi, L Sabattini, and R Groß. Coherent movement of error-prone individuals through mechanical coupling. *Nature Communications*, 14(1):4063, 2023.

[43] M Raoufi, P Romanczuk, and H Hamann. Estimation of continuous environments by robot swarms: Correlated networks and decision-making. *arXiv preprint arXiv:2302.13629*, 2023.

[44] JR Baxter and RV Chacon. The equivalence of diffusions on networks to brownian motion. *Contemporary Mathematics*, 26(33-47):0546–60080, 1984.

[45] MI Freidlin and AD Wentzell. Diffusion processes on graphs and the averaging principle. *The Annals of probability*, pages 2215–2245, 1993.

[46] JJ Molitierno. *Applications of combinatorial matrix theory to Laplacian matrices of graphs*. CRC Press, 2016.

[47] P Holme and J Saramäki. Temporal networks. *Physics reports*, 519(3):97–125, 2012.

[48] B Lévy. Laplace-beltrami eigenfunctions towards an algorithm that “understands” geometry. In *IEEE SMI*, 2006.

[49] AJ Chaudhari, RM Leahy, BL Wise, NE Lane, RD Badawi, and AA Joshi. Global point signature for shape analysis of carpal bones. *Phys. Med. Biol.*, 2014.

[50] H Zhang, O Van Kaick, and R Dyer. Spectral mesh processing. In *Computer graphics forum*, volume 29, pages 1865–1894. Wiley Online Library, 2010.

[51] S Melzi, E Rodolà, U Castellani, and MM Bronstein. Localized manifold harmonics for spectral shape analysis. In *Computer Graphics Forum*, volume 37, pages 20–34. Wiley Online Library, 2018.
[30] RM Rustamov et al. Laplace-beltrami eigenfunctions for deformation invariant shape representation. In *Symposium on geometry processing*, volume 257, pages 225–233, 2007.

[31] A Ng, M Jordan, and Y Weiss. On spectral clustering: Analysis and an algorithm. *Advances in neural information processing systems*, 14, 2001.

[32] U Von Luxburg. A tutorial on spectral clustering. *Statistics and computing*, 17:395–416, 2007.

[33] M Fiedler. Laplacian of graphs and algebraic connectivity. *Banach Center Publications*, 1(25):57–70, 1989.

[34] Y Wang and J Solomon. Intrinsic and extrinsic operators for shape analysis. In *Handbook of numerical analysis*, volume 20, pages 41–115. Elsevier, 2019.

[35] MS Talamali, A Saha, JAR Marshall, and A Reina. When less is more: Robot swarms adapt better to changes with constrained communication. *Science Robotics*, 6(56):eabf1416, 2021.

[36] M Gauci, ME Ortiz, M Rubenstein, and R Nagpal. Error cascades in collective behavior: a case study of the gradient algorithm on 1000 physical agents. In *Proceedings of the 16th Conference on Autonomous Agents and MultiAgent Systems*, pages 1404–1412, 2017.

[37] H Wang and M Rubenstein. A fast, accurate, and scalable probabilistic sample-based approach for counting swarm size. In *2020 IEEE International Conference on Robotics and Automation (ICRA)*, pages 7180–7185. IEEE, 2020.

[38] C Gordon, DL Webb, and S Wolpert. One cannot hear the shape of a drum. *Bulletin of the American Mathematical Society*, 27(1):134–138, 1992.

[39] MY Ben Zion, J Fersula, N Bredeche, and O Dauchot. Morphological computation and decentralized learning in a swarm of sterically interacting robots. *Science Robotics*, 8(75):eabo6140, 2023.

[40] DI Shuman, SK Narang, P Frossard, A Ortega, and P Vandergheynst. The emerging field of signal processing on graphs: Extending high-dimensional data analysis to networks and other irregular domains. *IEEE signal processing magazine*, 30(3):83–98, 2013.

[41] M Divband Soorati, P Zahadat, J Ghofrani, and H Hamann. Adaptive path formation in self-assembling robot swarms by tree-like vascular morphogenesis. In *Distributed Autonomous Robotic Systems: The 14th International Symposium*, pages 299–311. Springer, 2019.

[42] F Pratissoli, A Reina, Y Kaszubowski Lopes, C Pinciroli, G Miyauchi, L Sabattini, and R Groß. Coherent movement of error-prone individuals through mechanical coupling. *Nature Communications*, 14(1):4063, 2023.

[43] M Raoufi, P Romanczuk, and H Hamann. Estimation of continuous environments by robot swarms: Correlated networks and decision-making. *arXiv preprint arXiv:2302.13629*, 2023.

[44] JR Baxter and RV Chacon. The equivalence of diffusions on networks to brownian motion. *Contemporary Mathematics*, 26(33-47):0546–60080, 1984.

[45] MI Freidlin and AD Wentzell. Diffusion processes on graphs and the averaging principle. *The Annals of probability*, pages 2215–2245, 1993.

[46] JJ Molitierno. *Applications of combinatorial matrix theory to Laplacian matrices of graphs*. CRC Press, 2016.

[47] P Holme and J Saramäki. Temporal networks. *Physics reports*, 519(3):97–125, 2012.

[48] B Lévy. Laplace-beltrami eigenfunctions towards an algorithm that “understands” geometry. In *IEEE SMI*, 2006.

[49] AJ Chaudhari, RM Leahy, BL Wise, NE Lane, RD Badawi, and AA Joshi. Global point signature for shape analysis of carpal bones. *Phys. Med. Biol.*, 2014.

[50] H Zhang, O Van Kaick, and R Dyer. Spectral mesh processing. In *Computer graphics forum*, volume 29, pages 1865–1894. Wiley Online Library, 2010.

[51] S Melzi, E Rodolà, U Castellani, and MM Bronstein. Localized manifold harmonics for spectral shape analysis. In *Computer Graphics Forum*, volume 37, pages 20–34. Wiley Online Library, 2018.
[52] Y Aflalo, H Brezis, and R Kimmel. On the optimality of shape and data representation in the spectral domain. *SIAM Journal on Imaging Sciences*, 8(2):1141–1160, 2015.

[53] Y Choukroun, A Shtern, A Bronstein, and R Kimmel. Hamiltonian operator for spectral shape analysis. *IEEE transactions on visualization and computer graphics*, 26(2):1320–1331, 2018.

[54] A Singer. From graph to manifold laplacian: The convergence rate. *Applied and Computational Harmonic Analysis*, 21(1):128–134, 2006.

[55] HC Berg and DA Brown. Chemotaxis in escherichia coli analysed by three-dimensional tracking. *Nature*, 239:500–504, 1972.

[56] SH Larsen, RW Reader, EN Kort, WW Tso, and J Adler. Change in direction of flagellar rotation is the basis of the chemotactic response in escherichia coli. *Nature*, 249(5452):74–77, 1974.

[57] F Jansson, M Hartley, M Hinsch, I Slavkov, N Carranza, TSG Olsson, RM Dries, JH Grönqvist, AFM Marée, J Sharpe, et al. Kilombo: a kilobot simulator to enable effective research in swarm robotics. *arXiv preprint arXiv:1511.04285*, 2015.

[58] CR Harris, KJ Millman, SJ van der Walt, R Gommers, P Virtanen, D Cournapeau, E Wieser, J Taylor, S Berg, NJ Smith, R Kern, M Picus, S Hoyer, MH van Kerkwijk, M Brett, A Haldane, J Fernández del Río, M Wiebe, P Peterson, P Gérard-Marchant, K Sheppard, T Reddy, W Weckesser, H Abbasi, C Gohlke, and TE Oliphant. Array programming with NumPy. *Nature*, 585(7825):357–362, September 2020.

[59] W McKinney et al. Data structures for statistical computing in python. In *Proceedings of the 9th Python in Science Conference*, volume 445, pages 51–56. Austin, TX, 2010.

[60] A Hagberg and D Conway. Networkx: Network analysis with python. URL: https://networkx.github.io, 2020.

[61] P Virtanen, R Gommers, TE Oliphant, M Haberland, T Reddy, D Cournapeau, E Burovski, P Peterson, W Weckesser, J Bright, SJ van der Walt, M Brett, J Wilson, KJ Millman, N Mayorov, ARJ Nelson, E Jones, R Kern, E Larson, CJ Carey, I Polat, Y Feng, EW Moore, J VanderPlas, D Laxalde, J Perktold, R Cimrman, I Henriksen, EA Quintero, CR Harris, AM Archibald, AH Ribeiro, F Pedregosa, P van Mulbregt, and SciPy 1.0 Contributors. SciPy 1.0: Fundamental Algorithms for Scientific Computing in Python. *Nature Methods*, 17:261–272, 2020.

[62] K Jordahl, J Van den Bossche, M Fleischmann, J Wasserman, J McBride, J Gerard, J Tratner, M Perry, AG Badaracco, C Farmer, GA Hjelle, AD Snow, M Cochran, S Gillies, L Culbertson, M Bartos, N Eubank, A Bilogur, S Rey, C Ren, D Arribas-Bel, L Wasser, LJ Wolf, M Journois, J Wilson, A Greenhall, C Holdgraf, and F Leblanc. Geopandas: v0.8.1, July 2020.

[63] S Gillies et al. Shapely: Manipulation and analysis of geometric objects, 2007–.

[64] JD Hunter. Matplotlib: A 2D graphics environment. *Computing in Science & Engineering*, 9(3):90–95, 2007.

[65] ML Waskom. Seaborn: Statistical data visualization. *Journal of Open Source Software*, 6(60):3021, 2021.
[52] Y Aflalo, H Brezis, and R Kimmel. On the optimality of shape and data representation in the spectral domain. *SIAM Journal on Imaging Sciences*, 8(2):1141–1160, 2015.

[53] Y Choukroun, A Shtern, A Bronstein, and R Kimmel. Hamiltonian operator for spectral shape analysis. *IEEE transactions on visualization and computer graphics*, 26(2):1320–1331, 2018.

[54] A Singer. From graph to manifold laplacian: The convergence rate. *Applied and Computational Harmonic Analysis*, 21(1):128–134, 2006.

[55] HC Berg and DA Brown. Chemotaxis in escherichia coli analysed by three-dimensional tracking. *Nature*, 239:500–504, 1972.

[56] SH Larsen, RW Reader, EN Kort, WW Tso, and J Adler. Change in direction of flagellar rotation is the basis of the chemotactic response in escherichia coli. *Nature*, 249(5452):74–77, 1974.

[57] F Jansson, M Hartley, M Hinsch, I Slavkov, N Carranza, TSG Olsson, RM Dries, JH Grönqvist, AFM Marée, J Sharpe, et al. Kilombo: a kilobot simulator to enable effective research in swarm robotics. *arXiv preprint arXiv:1511.04285*, 2015.

[58] CR Harris, KJ Millman, SJ van der Walt, R Gommers, P Virtanen, D Cournapeau, E Wieser, J Taylor, S Berg, NJ Smith, R Kern, M Picus, S Hoyer, MH van Kerkwijk, M Brett, A Haldane, J Fernández del Río, M Wiebe, P Peterson, P Gérard-Marchant, K Sheppard, T Reddy, W Weckesser, H Abbasi, C Gohlke, and TE Oliphant. Array programming with NumPy. *Nature*, 585(7825):357–362, September 2020.

[59] W McKinney et al. Data structures for statistical computing in python. In *Proceedings of the 9th Python in Science Conference*, volume 445, pages 51–56. Austin, TX, 2010.

[60] A Hagberg and D Conway. Networkx: Network analysis with python. URL: https://networkx.github.io, 2020.

[61] P Virtanen, R Gommers, TE Oliphant, M Haberland, T Reddy, D Cournapeau, E Burovski, P Peterson, W Weckesser, J Bright, SJ van der Walt, M Brett, J Wilson, KJ Millman, N Mayorov, ARJ Nelson, E Jones, R Kern, E Larson, CJ Carey, I Polat, Y Feng, EW Moore, J VanderPlas, D Laxalde, J Perktold, R Cimrman, I Henriksen, EA Quintero, CR Harris, AM Archibald, AH Ribeiro, F Pedregosa, P van Mulbregt, and SciPy 1.0 Contributors. SciPy 1.0: Fundamental Algorithms for Scientific Computing in Python. *Nature Methods*, 17:261–272, 2020.

[62] K Jordahl, J Van den Bossche, M Fleischmann, J Wasserman, J McBride, J Gerard, J Tratner, M Perry, AG Badaracco, C Farmer, GA Hjelle, AD Snow, M Cochran, S Gillies, L Culbertson, M Bartos, N Eubank, A Bilogur, S Rey, C Ren, D Arribas-Bel, L Wasser, LJ Wolf, M Journois, J Wilson, A Greenhall, C Holdgraf, and F Leblanc. Geopandas: v0.8.1, July 2020.

[63] S Gillies et al. Shapely: Manipulation and analysis of geometric objects, 2007–.

[64] JD Hunter. Matplotlib: A 2D graphics environment. *Computing in Science & Engineering*, 9(3):90–95, 2007.

[65] ML Waskom. Seaborn: Statistical data visualization. *Journal of Open Source Software*, 6(60):3021, 2021.