Skip to main content

Why "constraint has no bool value (are you trying "lb <= expr <= ub"?)"

Answered

Comments

2 comments

  • Jaromił Najman
    • Gurobi Staff

    Your first constraint

    mdl.addConstrs(quicksum(x[0,i,k] for i in N) == (y[j,0,k] for j in N) <= 1 for k in K)

    reads \(\sum_{i \in N} x_{0,i,k} = y_{j,0,k} \forall j \in N \leq 1 \forall k \in K\). As you can see there is definitely at least one (in)equality too many.

    For additional details, please refer to the Knowledge Base article Constraint has no bool value (are you trying "lb <= expr <= ub"?).

    Best regards, 
    Jaromił

    Best regards, 
    Jaromił

    0
  • MA MENGYUAN
    • Gurobi-versary
    • First Question
    • First Comment

    Dear Jaromil,

    Thanks a lot. 

    Best regards,

    Ma

    0

Please sign in to leave a comment.