@Override
    public int compareTo(Vertex v) {
        if (this == v)
            return 0;

        if (this.x != v.x)
            return ((Double) this.x).compareTo(v.x);
        if (this.y != v.y)
            return ((Double) this.y).compareTo(v.y);
        if (this.ID != v.ID)
            return ((Integer) this.ID).compareTo(v.ID);
        return 0;
    }