Scalable $k$-NN graph construction