## Abstract

*Shape formation* (or *pattern formation*) is a basic distributed problem for systems of computational mobile entities. Intensively studied for systems of autonomous mobile robots, it has recently been investigated in the realm of *programmable matter*, where entities are assumed to be small and with severely limited capabilities. Namely, it has been studied in the geometric *Amoebot* model, where the anonymous entities, called *particles*, operate on a hexagonal tessellation of the plane and have limited computational power (they have constant memory), strictly local interaction and communication capabilities (only with particles in neighboring nodes of the grid), and limited motorial capabilities (from a grid node to an empty neighboring node); their activation is controlled by an adversarial scheduler. Recent investigations have shown how, starting from a well-structured configuration in which the particles form a (not necessarily complete) triangle, the particles can form a large class of shapes. This result has been established under several assumptions: agreement on the clockwise direction (i.e., *chirality*), a *sequential* activation schedule, and *randomization* (i.e., particles can flip coins to elect a leader). In this paper we obtain several results that, among other things, provide a characterization of which shapes can be formed *deterministically* starting from any *simply connected* initial configuration of *n* particles. The characterization is constructive: we provide a *universal shape formation algorithm* that, for each feasible pair of shapes \((S_0, S_F)\), allows the particles to form the final shape \(S_F\) (given in input) starting from the initial shape \(S_0\), unknown to the particles. The final configuration will be an appropriate scaled-up copy of \(S_F\) depending on *n*. If *randomization* is allowed, then any input shape can be formed from any initial (simply connected) shape by our algorithm, provided that there are enough particles. Our algorithm works without chirality, proving that *chirality is computationally irrelevant* for shape formation. Furthermore, it works under a strong adversarial scheduler, not necessarily sequential. We also consider the complexity of shape formation both in terms of the number of rounds and the total number of moves performed by the particles executing a universal shape formation algorithm. We prove that our solution has a complexity of \(O(n^2)\) rounds and moves: this number of moves is also asymptotically worst-case optimal.

## Notes

### Acknowledgements

This research has been supported in part by the Natural Sciences and Engineering Research Council of Canada under the Discovery Grant program, by Prof. Flocchini’s University Research Chair, and by Prof. Yamauchi’s Grant-in-Aid for Scientific Research on Innovative Areas “Molecular Robotics” (No. 15H00821) of MEXT, Japan and JSPS KAKENHI Grant No. JP15K15938.

## References

- 1.Ando, H., Suzuki, I., Yamashita, M.: Formation and agreement problems for synchronous mobile robots with limited visibility. In: Proceedings of the 10th IEEE Symposium on Intelligent Control, pp. 453–460 (1995)Google Scholar
- 2.Arbuckle, D., Requicha, A.: Self-assembly and self-repair of arbitrary shapes by a swarm of reactive robots: algorithms and simulations. Auton. Robots
**28**(2), 197–211 (2010)CrossRefGoogle Scholar - 3.Cannon, S., Daymude, J.J., Randall, D., Richa, A.W.: A Markov chain algorithm for compression in self-organizing particle systems. In: Proceedings of the 35th ACM Symposium on Principles of Distributed Computing, pp. 279–288 (2016)Google Scholar
- 4.Chirikjian, G.: Kinematics of a metamorphic robotic system. In: Proceedings of the 11th IEEE International Conference on Robotics and Automation, pp. 1:449–1:455 (1994)Google Scholar
- 5.Das, S., Flocchini, P., Santoro, N., Yamashita, M.: Forming sequences of geometric patterns with oblivious mobile robots. Distrib. Comput.
**28**(2), 131–145 (2015)MathSciNetCrossRefzbMATHGoogle Scholar - 6.Daymude, J.J., Derakhshandeh, Z., Gmyr, R., Porter, A., Richa, A.W., Scheideler, C., Strothmann, T.: On the runtime of universal coating for programmable matter. In: Proceedings of 22nd International Conference on DNA Computing and Molecular Programming, pp. 148–164 (2016)Google Scholar
- 7.Daymude, J.J., Gmyr, R., Richa, A.W., Scheideler, C., Strothmann, T.: Improved leader election for self-organizing programmable matter (2017). arXiv:1701.03616
- 8.Demaine, E.D., Patitz, M.J., Schweller, R.T., Summers, S.M.: Self-assembly of arbitrary shapes using RNAse enzymes: meeting the Kolmogorov bound with small scale factor (extended abstract). In: Proceedings of the 28th Symposium on Theoretical Aspects of Computer Science, pp. 201–212 (2011)Google Scholar
- 9.Derakhshandeh, Z., Gmyr, R., Richa, A.W., Scheideler, C., Strothmann, T.: An algorithmic framework for shape formation problems in self-organizing particle systems. In: Proceedings of the 2nd International Conference on Nanoscale Computing and Communication, pp. 21:1–21:2 (2015)Google Scholar
- 10.Derakhshandeh, Z., Gmyr, R., Richa, A.W., Scheideler, C., Strothmann, T.: Universal shape formation for programmable matter. In: Proceedings of the 28th ACM Symposium on Parallelism in Algorithms and Architectures, pp. 289–299 (2016)Google Scholar
- 11.Derakhshandeh, Z., Gmyr, R., Richa, A.W., Scheideler, C., Strothmann, T.: Universal coating for programmable matter. Theor. Comput. Sci.
**671**, 56–68 (2017)MathSciNetCrossRefzbMATHGoogle Scholar - 12.Derakhshandeh, Z., Gmyr, R., Strothmann, T., Bazzi, R.A., Richa, A.W., Scheideler, C.: Leader election and shape formation with self-organizing programmable matter. In: Proceedings of 21st International Conference on DNA Computing and Molecular Programming, pp. 117–132 (2015)Google Scholar
- 13.Di Luna, G.A., Flocchini, P., Prencipe, G., Santoro, N., Viglietta, G.: Line recovery by programmable particles. In: Proceedings of the 19th International Conference on Distributed Computing and Networking (ICDCN) (to appear)Google Scholar
- 14.Dolev, S., Frenkel, S., Rosenbli, M., Narayanan, P., Venkateswarlu, K.M.: In-vivo energy harvesting nano robots. In: the 3rd IEEE International Conference on the Science of Electrical Engineering, pp. 1–5 (2016)Google Scholar
- 15.Flocchini, P., Prencipe, G., Santoro, N., Widmayer, P.: Arbitrary pattern formation by asynchronous, anonymous, oblivious robots. Theor. Comput. Sci.
**407**(1), 412–447 (2008)MathSciNetCrossRefzbMATHGoogle Scholar - 16.Fujinaga, N., Yamauchi, Y., Ono, H., Kijima, S., Yamashita, M.: Pattern formation by oblivious asynchronous mobile robots. SIAM J. Comput.
**44**(3), 740–785 (2016)MathSciNetCrossRefzbMATHGoogle Scholar - 17.Li, K., Thomas, K., Torres, C., Rossi, L, Shen, C.-C.: Slime mold inspired path formation protocol for wireless sensor networks. In: Proceedings of the 7th International Conference on Swarm Intelligence, pp. 299–311 (2010)Google Scholar
- 18.Michail, O.: Terminating distributed construction of shapes and patterns in a fair solution of automata. Distrib. Comput. (2018). https://doi.org/10.1007/s00446-017-0309-z MathSciNetzbMATHGoogle Scholar
- 19.Michail, O., Skretas, G., Spirakis, P.G.: On the transformation capability of feasible mechanisms for programmable matter. In: Proceedings of the 44th International Colloquium on Automata, Languages, and Programming, pp. 136:1–136:15 (2017)Google Scholar
- 20.Naz, A., Piranda, B., Bourgeois, J., Goldstein, S.C.: A distributed self-reconfiguration algorithm for cylindrical lattice-based modular robots. In: Proceedings of the 15th IEEE International Symposium on Network Computing and Applications, pp. 254–263 (2016)Google Scholar
- 21.Patitz, M.J.: An introduction to tile-based self-assembly and a survey of recent results. Nat. Comput.
**13**(2), 195–224 (2014)MathSciNetCrossRefzbMATHGoogle Scholar - 22.Rothemund, P.W.: Folding DNA to create nanoscale shapes and patterns. Nature
**440**(7082), 297–302 (2006)CrossRefGoogle Scholar - 23.Rubenstein, M., Cornejo, A., Nagpal, R.: Programmable self-assembly in a thousand-robot swarm. Science
**345**(6198), 795–799 (2014)CrossRefGoogle Scholar - 24.Schiefer, N., Winfree, E.: Universal computation and optimal construction in the chemical reaction network-controlled tile assembly model. In: Proceedings of the 21st DNA Computing and Molecular Programming, pp. 34–54 (2015)Google Scholar
- 25.Suzuki, I., Yamashita, M.: Distributed anonymous mobile robots: formation of geometric patterns. SIAM J. Comput.
**28**(4), 1347–1363 (1999)MathSciNetCrossRefzbMATHGoogle Scholar - 26.Toffoli, T., Margolus, N.: Programmable matter: concepts and realization. Physica D: Nonlinear Phenom.
**47**(1), 263–272 (1991)MathSciNetCrossRefGoogle Scholar - 27.Walter, J.E., Welch, J.L., Amato, N.M.: Distributed reconfiguration of metamorphic robot chains. Distrib. Comput.
**17**(2), 171–189 (2004)CrossRefzbMATHGoogle Scholar - 28.Woods, D., Chen, H.-L., Goodfriend, S., Dabby, N., Winfree, E., Yin, P.: Active self-assembly of algorithmic shapes and patterns in polylogarithmic time. In: Proceedings of the 4th Conference on Innovations in Theoretical Computer Science, pp. 353–354 (2013)Google Scholar
- 29.Yamashita, M., Suzuki, I.: Characterizing geometric patterns formable by oblivious anonymous mobile robots. Theor. Comput. Sci.
**411**(26–28), 2433–2453 (2010)MathSciNetCrossRefzbMATHGoogle Scholar