Simulating orbital gravity with a prediction of trajectory (Multiple attractors)

Hello fellow programmers,
I saw this post about simulating orbital gravity :
I’m trying myself to predict more-than-two-body attractions and I don’t really know which data structure I should use to achieve this result, I wanted to know which method you used at the time.
I also tought of only using scalar (something like a ‘gravity’ tension) in a grid.

Thanks in advance for your answers

tl;dr:I’m trying to predict the trajectory of a body with multiple attractors (a static one and multiple moving ones)