Skip to main content

Creating constraints that reference other decision variables

Answered

Comments

3 comments

  • Official comment
    Simranjit Kaur
    • Gurobi Staff
    This post is more than three 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 why not try our AI Gurobot?.
  • Michael Forbes
    • Gurobi-versary
    • First Comment

    Because you have three colours you will need three constraints.  For the specific violated constraint you have it looks like:

    sum(squares with yellow on top)+sum(rectangles with yellow on bottom) <= 1

    0
  • tjs
    • Gurobi-versary
    • First Comment
    • First Question

    Thank you.  This works now.

    0

Post is closed for comments.