public Edge[] nodeConnectionHelper(Node parent, Node from, Node to) {
    if (from == to)
      return new Edge[0];

    for (Node n : from.adjNodes()) {
      if (n != parent) {
        Edge[] temp = nodeConnectionHelper(from, n, to);
        if (temp != null) {
          Edge[] ret = new Edge[temp.length + 1];
          ret[0] = from.edgeTo(n);
          for (int i = 0; i<temp.length; i++) {
            ret[i+1] = temp[i];
          }
          return ret;
        }
      }
    }
    return null;
  }