Skip to main content

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

Answered

Comments

3 comments

  • Official comment
    Simranjit Kaur
    • Gurobi Staff
    This post is more than two years old. Some information may not be up to date. For current information, please check the Gurobi Documentation or Knowledge Base. If you need more help, please create a new post in the community forum, or try Gurobot, our chatbot interface offering instant, expert-level support.
  • 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

Post is closed for comments.