Distance finder based on neighborhood