stop adding vertices that has distance exceeding the minimum distance, but still TLE