Create nearestNlinks.m