A halo is a structure of dark matter which is roughly spherical and is oftentimes home to many or one galaxies. Studying the properties of halos is essential to understanding the nature of dark matter and also the formation and evolution of galaxies. Over time, halos merge into each other and form larger halos with subhalos inside of them.
A big challange for N-body simulations nowadays is the question of how to define halos in an efficient and accurate way.
There are many such algorithms. Here we will concentrate on the Friends-of-Friends (FoF) and ROCKSTAR halo finders.
FoF is a widely used halo finder in many N-body simulations. While it is a very efficient algorithm, there are also many disadvantages to using it. Learn more about it here.