Add computation of the neighbourhood function