Skip to main content

Formulate a constraint considering T as a set rather than a parameter

Answered

Comments

2 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

    Hi,

    I don't know whether it makes sense for your application, but you could define everything over each element of \(T\).

    \[\begin{align*}
    Y_{i,t} &\in \{0,1\} &&\quad \forall i \in \{1,\dots,t\},\, t \in T\\
    y_{i,t} &\in \{0,1\} &&\quad \forall i \in \{1,\dots,t\},\, t \in T\\
    Y_{i,t} &+ y_{i,t} + (Y_{i,t}+1) + (y_{i,t}+1) \leq 1 &&\quad \forall i \in \{1,\dots,t-1\},\, t \in T \text{ if } t > 1
    \end{align*}\]

    Best regards, 
    Jaromił

    1

Post is closed for comments.