public int compareTo(Object o) {
        Node.Path p = (Node.Path)o;
        int min = Math.min(this.depth(), p.depth());
        int[]  i1 = this.indices();
        int[]  i2 = p.indices();
        for(int k=0; k<min; k++) {
            if (i1[k]>i2[k]) return +1;
            else if (i1[k]<i2[k]) return -1;
        }
        if (this.depth()>p.depth()) return +1;
        else if (this.depth()<p.depth()) return -1;
        return 0;
    }