Is there any way to model the big M method for continuous variables? Something similar to this but $B, C \in \mathbb{R}_{\geq 0}$ and $A\in\{0,1\}$.

Due to the precision problem, when the $B$ and $C$ are close I do not get the correct answer.

Let $p_{i,j} \in \mathbb{R}_{\geq 0}$, for $i=1,\dots, n, j=1, \dots, m$. As one of the constraints of my problem, I am looking for $h$ such that $$ g_i(h) := \sum_{j=1}^h p_{i,j} < 1. $$ To find $h$, I defined $a_{i,j} \in \{0,1\}$ such that $$ a_{i,h} = \begin{cases} 1 \qquad \text{if } g_i(h) < 1 \quad h=1, \dots, m, \\ 0 \qquad \text{otherwise}. \end{cases} $$

To implement the if condition above, I used the big-M method, but the problem is that the big-M method works well for ILPs while the variable, here $p$, is non-integer. When $g_i(h)$ is very close to 1 but not absolutely 1 due to the precision of the number, say $ g_i(h)=1-10^{-16}$, then $g_i(h)$ which actually is 1 will not be assumed as 1 by the program, and the program does not return the correct value for $h$. I was wondering if there is a trick for this issue.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.