Modeling issue of dealing with fractions of variables and computation issues of solving the model
AnsweredDear whom it may concern,
I am writing this to request some help in modeling my formulation and resolving computation issues of solving my model in Gurobi.
I have a set of constraints that I have to model with a fraction of discrete integer variables (y) and a set of binary variables as follows:
Since my y can be 0, I had to introduce additional sets of variables as follows to make the constraints work:
,where lambda's are binary variables and mu's are continuous
My model with this reformulation is able to handle some small cases within 1-2% optimality gap but as the instance gets twice as big as the small cases, the model is not able to solve and the gap is not decreasing and stuck at some % like 10 hours. I understand this model is hard to solve as it's nonconvex. I was wondering if my reformulation was actually done so redundantly or inefficiently
Any feedback will be highly appreciated.
-
You say that you allow \(y\) to attain the value \(0\), i.e., you theoretically allow for the term \(\frac{1}{0}\). If I understand your formulation correctly, if \(y=0\), then \(\mu\) can attain any value, also \(0\), which is fine if your problem allows for it.
Does your integer variable have finite bounds \(y \in \{0,\dots,y^U\}\)? If not, then you definitely should define a tight variable bound for your integer variable \(y\). Note that just setting the bound to some big value will most likely not help. Please note that because of the division, your model is nonlinear and finite variable bounds are required to construct relaxations of these models.
Your binary variable \(\lambda\) equals \(0\) if \(y = 0\). You could use indicator constraints to formulate
\[\begin{align*}
\lambda &= 0 \rightarrow \mu = 0\\
\lambda &= 1 \rightarrow z = 1\\
z &= \mu \cdot y
\end{align*}\]and then use \(\mu\) in your sum as you already do.
Best regards,
Jaromił0
Please sign in to leave a comment.
Comments
1 comment