Modified routing calculation for matching algorithm.