Efficient n-body simulations using physics informed graph neural networks
Víctor Ramos-Osuna, Alberto Díaz-Álvarez, Raúl Lara-Cabrera
TL;DR
The paper tackles the high computational cost of gravitational $N$-body simulations by combining a leapfrog-based physical data generator with a graph neural network that regresses particle accelerations on a proximity graph. It uses an EdgeConv-inspired GNN with node/edge encoders, multiple message-passing layers, and a residual update to predict accelerations in 3D, trained on 60 simulated scenarios and evaluated on 6 test cases, across $3$ to $500$ bodies for $1000$ steps. The results show extremely low stepwise losses ($\sim10^{-14}$ to $10^{-13}$) and near-constant acceleration error over rollout, with negligible accumulated errors in position and velocity, and a practical speedup of about $1.17\times$ over baseline simulations. This work demonstrates the feasibility of physics-informed graph learning to accelerate complex dynamical simulations while maintaining fidelity, and it points to scalable extensions via sparse graphs, hierarchical modeling, and specialized handling of dominant bodies for larger systems.
Abstract
This paper presents a novel approach for accelerating n-body simulations by integrating a physics-informed graph neural networks (GNN) with traditional numerical methods. Our method implements a leapfrog-based simulation engine to generate datasets from diverse astrophysical scenarios which are then transformed into graph representations. A custom-designed GNN is trained to predict particle accelerations with high precision. Experiments, conducted on 60 training and 6 testing simulations spanning from 3 to 500 bodies over 1000 time steps, demonstrate that the proposed model achieves extremely low prediction errors-loss values while maintaining robust long-term stability, with accumulated errors in position, velocity, and acceleration remaining insignificant. Furthermore, our method yields a modest speedup of approximately 17% over conventional simulation techniques. These results indicate that the integration of deep learning with traditional physical simulation methods offers a promising pathway to significantly enhance computational efficiency without compromising accuracy.
