Skip to main content

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

Answered

Comments

1 comment

  • Jaromił Najman
    Gurobi Staff 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

Please sign in to leave a comment.