implement LatticeProblem.getNumOfRoute() method