filter out pairs of neighbors with high degree difference