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