Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Introduce a new variable for each $\max$, say, $m_i$ and constraints that it is $\geq$ each argument of $\max$. For you example you get:

$$\begin{cases} m_1\geq r_0 + s_0\ m_1\geq 0\ m_2 \geq r_0 + s_1\ m_2\geq r_1 + s_0\ m_2\geq 0\ \dots\ m_1 + m_2 + m_3 + m_4 + m_5\quad \rightarrow\quad\max \end{cases} $$ This is solved via MILP - https://doc.sagemath.org/html/en/reference/numerical/sage/numerical/mip.html

Introduce a new variable for each $\max$, say, $m_i$ and constraints that it is $\geq$ each argument of $\max$. For you example you get:

$$\begin{cases} m_1\geq r_0 + s_0\ s_0\\ m_1\geq 0\ 0\\ m_2 \geq r_0 + s_1\ s_1\\ m_2\geq r_1 + s_0\ s_0\\ m_2\geq 0\ \dots\ 0\\ \dots\\ m_1 + m_2 + m_3 + m_4 + m_5\quad \rightarrow\quad\max \end{cases} $$ This is solved via MILP - https://doc.sagemath.org/html/en/reference/numerical/sage/numerical/mip.html

Introduce a new variable for each $\max$, say, $m_i$ and constraints that it is $\geq$ each argument of $\max$. For you example you get:

$$\begin{cases} m_1\geq r_0 + s_0\\ m_1\geq 0\\ m_2 \geq r_0 + s_1\\ m_2\geq r_1 + s_0\\ m_2\geq 0\\ \dots\\ m_1 + m_2 + m_3 + m_4 + m_5\quad \rightarrow\quad\max m_5\ \rightarrow\ \min \end{cases} $$ This is solved via MILP - https://doc.sagemath.org/html/en/reference/numerical/sage/numerical/mip.html

Introduce a new variable for each $\max$, say, $m_i$ say $m_i$, and constraints that it is $\geq$ each argument of $\max$. $\max$, and in the objective function replace each $\max$ with the corresponding $m_i$. For you your example you we get:

$$\begin{cases} m_1\geq r_0 + s_0\\ m_1\geq 0\\ m_2 \geq r_0 + s_1\\ m_2\geq r_1 + s_0\\ m_2\geq 0\\ \dots\\ m_1 + m_2 + m_3 + m_4 + m_5\ \rightarrow\ \min \end{cases} $$ This is solved via MILP - https://doc.sagemath.org/html/en/reference/numerical/sage/numerical/mip.html

Introduce a new variable for each $\max$, say $m_i$, and constraints that it is $\geq$ each argument of $\max$, and $\max$. Then in the objective function replace each $\max$ with the corresponding $m_i$. For your example we get:

$$\begin{cases} m_1\geq r_0 + s_0\\ m_1\geq 0\\ m_2 \geq r_0 + s_1\\ m_2\geq r_1 + s_0\\ m_2\geq 0\\ \dots\\ m_1 + m_2 + m_3 + m_4 + m_5\ \rightarrow\ \min \end{cases} $$ This is solved via MILP - https://doc.sagemath.org/html/en/reference/numerical/sage/numerical/mip.html

Introduce a new variable for each $\max$, say $m_i$, and constraints that it is $\geq$ each argument of $\max$. Then in the objective function replace each $\max$ with the corresponding $m_i$. For your example we get:

$$\begin{cases} m_1\geq r_0 + s_0\\ m_1\geq 0\\ m_2 \geq r_0 + s_1\\ m_2\geq r_1 + s_0\\ m_2\geq 0\\ \dots\\ m_1 + m_2 + m_3 + m_4 + m_5\ \rightarrow\ \min \end{cases} $$ This is Since all constraints here are linear, such a problem can be solved via MILP - https://doc.sagemath.org/html/en/reference/numerical/sage/numerical/mip.html