Skip to main content

Linear expression with MAX

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.
  • Simranjit Kaur
    • Gurobi Staff

    Hi Shesha,

    This can be done with the help of some auxiliary variables.

    • Define auxiliary variables Z[i][j], add constraints Z[i][j] = XXX[i][j] +YYY[i][j] *W[i].
    • Define another auxiliary variable ZZZ, and set it to max of Z[i][j]  variables using the general constraint helper functions max_()
    • If you want the max value to be at most KEYWIDTH, set the upper bound of the ZZZ variable to KEYWIDTH.

    Best regards,
    Simran

    0
  • Shesha Sreenivasamurthy
    • Gurobi-versary
    • Curious
    • Conversationalist

    Thanks a lot for the information

    0

Post is closed for comments.