v.3.5  Added option to ignore edges when calculating nearest neighbors