code: static boolean singletonIntersect(final int[] p, final int[] q) {
          int n = p.length;
          for (int i = 1; i < n; i++)
              if (p[i] == q[i]) return false;
          return true;
      }
docs: Given two paths from a common start vertex <i>r</i> check whether there
  are any intersects. If the paths are different length the shorter of the
  two should be given as <i>p</i>.
  
  @param p a path from <i>r</i>
  @param q a path from <i>r</i>
  @return whether the only intersect is <i>r</i>