Tree-less 3d friends-of-friends using spatial hashing
Abstract
I describe a fast algorithm for the identification of connected sets of points where the point-wise connections are determined by a fixed spatial distance - a task commonly referred to in the cosmological simulation community as Friends-of-Friends (FOF) group finding. This technique sorts particles into fine cells sufficiently compact to guarantee their cohabitants are linked, and uses locality sensitive hashing to search for neighbouring (blocks of) cells. Tests on N-body simulations of up to a billion particles exhibit speed increases of factors up to 20 × compared with FOF via trees (a factor around 8 is typical), and are consistently complete in less than the time of a k-d tree construction, giving it an intrinsic advantage over tree-based methods. The code is open-source and available online at https://github.com/pec27/hfof.
- Publication:
-
Astronomy and Computing
- Pub Date:
- October 2018
- DOI:
- 10.1016/j.ascom.2018.09.010
- arXiv:
- arXiv:1805.04911
- Bibcode:
- 2018A&C....25..159C
- Keywords:
-
- Methods: N-body simulations;
- Methods: Data analysis;
- Cosmology: Dark matter;
- Cosmology: Large-scale structure of universe;
- Methods numerical;
- Astrophysics - Cosmology and Nongalactic Astrophysics
- E-Print:
- Accepted in Astronomy and Computing. 11 pages, 5 figures, updated to match accepted version