Add nearestNH (nearest neighborhood) in common.cpp/h