nearest() using time_gap to predict better solution