# Why is the boundary of friends-of-friends (FOF) halo corresponding to iso-density contour?

The friends-of-friends algorithm (hereafter FOF) is commonly used to find halos in cosmological simulations. (For more information, please refer to here and here)

I found that some literature argues that the boundary of the FOF halo is corresponding to an iso-density surface. For example, Springel et al 2001 states

It places any two particles with a separation less than some linking length $$b$$ into the same group. In this way, particle groups are formed that correspond to regions approximately enclosed by isodensity contours with threshold value $$\rho\propto1/b^3$$.

More et al 2011 says

One could expect that for a given value of $$b$$, the FOF algorithm defines the boundary of a halo as corresponding to a certain isodensity surface, at least in the limit of large number of particles.

However, I can't understand the connection between the boundary of the FOF group of particles and iso-density contour. How to derive this connection in formula form? Does this connection need other hypotheses?

If you have enough particles to sample your field, then a given (local) density corresponds to the same mean distance between your particles. The FOF algorithm keeps linking particles to a halo until a particle is farther away than the linking length. That means that the halo boundary will be ~exactly on the border between regions of interparticle distances smaller and larger than the linking length, corresponding to a boundary between larger and smaller densities, respectively. That is, an iso-density surface.

In contrast, a halo finder using the spherical overdensity (SO) algorithm will always result in a spherical boundary, which will only be an iso-density surface in the case of a completely symmetrical halo.

This is the reason that FOF halo finders tend to include more filaments outside the region identified by SO halo finder. This may or may not be desired.

• In your statement which says "If you have enough particles to sample your field, then a given density corresponds to the same mean distance between your particles", What does "a given density" refers to, local density or mean density? Jan 29 '21 at 2:28
• @WangYun I mean a given local density. I just meant that, if your field is not well-sampled, then a given local density of 1 g/cm³ or 1 M☉/pc³ or whatever, may be represented by a slightly different number of particles in two different regions. Maybe a bit superfluous statement, but it was to address what More+ 11 said: "at least in the limit of large number of particles". I edited the answer to include the word local.
– pela
Jan 29 '21 at 10:33
• @WangYun Although the positions of the particles are well-defined points in space, the field that they represent is continuous, by assuming the particles be "smoothed" over space by some kernel. But the surface found by the FOF algorithm is a polyhedron with particles at the vertices. Going from one particle to its nearest neighbor along the FOF surface, the density field decreases as you leave one particle until you're midway between the two, after which it increase again until you reach the neighbor. Hence, it's not exactly an isodensity surface, but with enough particles the difference →0.
– pela
Jan 29 '21 at 14:23