Reuse & Permissions

It is not necessary to obtain permission to reuse this article or its components as it is available under the terms of the Creative Commons Attribution 4.0 International license. This license permits unrestricted use, distribution, and reproduction in any medium, provided attribution to the author(s) and the published article's title, journal citation, and DOI are maintained. Please note that some figures may have been included with permission from other third parties. It is your responsibility to obtain the proper permission from the rights holder directly for these figures.

Export citation

Export citation

Choose format for download:

Download Citation
  • Open Access

Lagrangian formulation to optimize interactions in virtual environments

Andrea Afify*

Alessandro Vicini†

Andrea Bellacicca‡

  • Compai, Milan, Italy

  • *Contact author: andrea.afify@unimi.it
  • †Contact author: alessandro.vicini@unimi.it
  • ‡https://www.compai.team

Phys. Rev. E 113, 014310 – Published 16 January, 2026

DOI: https://doi.org/10.1103/b2t1-hrmx

Abstract

We study the dynamics of user-agent interactions in virtual environments through mathematical models derived in a Lagrangian formalism. The goal is to optimize the number of agents required to solve a generic predefined task while minimizing the computational cost to achieve it. Specifically, we derived Euler-Lagrange equations of motion to describe the different ways in which agents may interact with users. The main advantage of this approach lies in its peculiarity to derive a scaling law for any interaction rule one wishes to design, ensuring that the system scales while optimizing the global impact of the interactions. By specifying an action functional over interaction trajectories and enforcing its minimization, the optimal way to allocate agents emerges naturally as Euler–Lagrange equations, embedding the entire optimization strategy directly into the formalism. This intrinsic coupling of dynamics and cost yields a universal procedure to compute the scaling laws for arbitrary interaction rules, ensuring that agent populations and computational expense grow according with environmental complexity. We illustrate the methodology with two specific example. These results also offer a foundation for further research into multi-agent dynamics and their applications in virtual environments.

View figure in article

Physics Subject Headings (PhySH)

Article Text

References (21)

  1. C. M. Topaz and A. L. Bertozzi, SIAM J. Appl. Math. 65, 152 (2004).
  2. J. Toner, Y. Tu, and S. Ramaswamy, Ann. Phys. 318, 170 (2005).
  3. W. Bialek, A. Cavagna, I. Giardina, T. Mora, E. Silvestri, M. Viale, and A. M. Walczak, Proc. Natl. Acad. Sci. USA 109, 4786 (2012).
  4. G. K. Sar and D. Ghosh, Chaos 33, 123126 (2023).
  5. T. Vicsek, A. Czirók, E. Ben-Jacob, I. Cohen, and O. Shochet, Phys. Rev. Lett. 75, 1226 (1995).
  6. Y. Chen and T. Kolokolnikov, J. R. Soc. Interface 11, 20131208 (2014).
  7. M. Zheng, Y. Kashimori, O. Hoshino, K. Fujita, and T. Kambara, J. Theor. Biol. 235, 153 (2005).
  8. J. M. Jeschke and R. Tollrian, Anim. Behav. 74, 387 (2007).
  9. I. D. Couzin, J. Krause, N. R. Franks, and S. A. Levin, Nature (London) 433, 513 (2005).
  10. G. Wang, T. V. Phan, S. Li, M. Wombacher, J. Qu, Y. Peng, G. Chen, D. I. Goldman, S. A. Levin, R. H. Austin, et al., Phys. Rev. Lett. 126, 108002 (2021).
  11. S. Bolouki and R. P. Malhamé, IFAC Proc. Vol. 44, 8819 (2011).
  12. M. Durve, F. Peruani, and A. Celani, Phys. Rev. E 102, 012601 (2020).
  13. F. Lu, M. Zhong, S. Tang, and M. Maggioni, Proc. Natl. Acad. Sci. USA 116, 14424 (2019).
  14. A.-L. Barabási and R. Albert, Science 286, 509 (1999).
  15. R. D. Beer, Artif. Intell. 72, 173 (1995).
  16. D. Helbing and P. Molnar, Phys. Rev. E 51, 4282 (1995).
  17. F. Palombi, S. Ferriani, and S. Toti, Eur. Phys. J. B 93, 194 (2020).
  18. M. Brouillet and G. Y. Georgiev, Processes 12, 2937 (2024).
  19. J. Redmon, S. Divvala, R. Girshick, and A. Farhadi, in Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (IEEE, Piscataway, 2016), pp. 779–788.
  20. https://thenemesis.io/.
  21. https://decentraland.org/.

Outline

Information

Sign In to Your Journals Account

Filter

Filter

Article Lookup

Enter a citation