NAN function

Natural Neighbor (NAN) algorithm to return the self-adaptive neighborhood