@Override
    public boolean equals(Object obj) {
        if (this == obj) return true;
        if (obj == null) return false;
        if (getClass() != obj.getClass()) return false;
        Edge other = (Edge) obj;
        if (from == null) {
            if (other.from != null) return false;
        } else if (!(from==other.from)) return false;   
        if (to == null) {
            if (other.to != null) return false;
        } else if (!(to==other.to)) return false;
        return true;
    }