@Override
  public List<Integer> getHops(Integer start, Integer target)
  {
    NodePair pair = NodePair.get(getNode(start), getNode(target));
    if(!distances.containsKey(pair) || distances.get(pair).isNonterminating())
      return null;
    List<Integer> hops = new ArrayList<Integer>();
    Integer current = start;
    while (!current.equals(target))
    {
      hops.add(current);
      current = rule.getNextValue(current, target);
    }
    hops.add(target);
    return hops;
  }