Uses the Barnes-Hut algorithm to avoid O( n^2 ) force calculations in favor of O(n log n). Simple nearest neighbor tracking cannot be use in gravity simulations as gravity has an effective infinite ranged potential. <a href="https://en.wikipedia.org/wiki/Barnes%E2%80%93Hut_simulation" rel="nofollow">https://en.wikipedia.org/wiki/Barnes%E2%80%93Hut_simulation</a>