Can a Gurobi Produce Solve this non-linear binary integer problem?
回答済みHello,
I am attempting to solve this problem where all variables, besides the Xi and Yi choice variables, are fixed/observed in data. Note than equation (43) and (44) are the same, simply reformulated so that the non-linear part is redefined as its own function in (44). For every i, Xi + Yi <=1 and Xi and Yi are binary equal to 0 or 1. The problem I have is that many of the variables are multiplied by each other and then I am dividing by a weighted sum of all the X variables. My concern is primarily with the function that I redefined as F(.,.,.) in the second equation.
Thank you for any help you can provide!
-Jack
Edit: There is a typo in what I typed up for (44). The function \(F\) should actually be a function of \(\mathbf{\lambda}, \mathbf{X}, \mathbf{N} \), ie the vectors of the Xs, \(\lambda\)s, and Ns, as the numerator and denominator involve the sum of all of the respective variables
-
Hi Jack,
To model \(F\) you will need to define 2 variables for each \(i\), to equal the linear expressions in numerator and denominator. You will then need to link them together with a "F variable" for each \(i\). To simplify, consider the objective function
\[\max \frac{a \cdot b}{c}\]We can write this as \(\max z\) where
\[\begin{eqnarray}z = \frac{a \cdot b}{c} &&\\
\Leftrightarrow z \cdot c - a \cdot b = 0
\end{eqnarray}\]The latter form can be used with your Gurobi model.
The following articles, related to your question, contain useful tips and will be a quick and worthwhile read.
How do I divide by a variable in Gurobi?
How do I model multilinear terms in Gurobi?- Riley
1 -
Hello,
Thank you very much for your timely and helpful reply. I rewrote the problem, but wanted to confirm that I understood your instructions. For the function referred to a \(F(X_{i}, \lambda_{i}, N_{i})\) in (44) above, I rewrote it by denoting the numerator as "a", the denominator as "b", and \(F = \frac{a}{b}\). Then, I defined a variable \(Z_{i} = F \cdot X_{i}\). In the optimization problem, I would then optimize over \(Z_{i}\) and \(Y_{i}\) instead of \(X_{i}\) and \(Y_{i}\). Is this correct or am I misunderstanding what you were referring to by "To model \(F\) you will need to define 2 variables for each i, to equal the linear expressions in numerator and denominator."
0 -
Hi Jack,
Looks good to me. I misunderstood \(F(X_i, \lambda_i, N_i)\) as meaning there was a different value of \(F\) for each \(i\) - apologies for any confusion - but re-reading I see that is not the case.- Riley
0 -
That was probably my mistake as there was a typo in what I typed up in question (44) as I wrote it pretty quickly to post here. Function \(F\) should really be a function of \(\mathbf{\lambda}, \mathbf{X}, \mathbf{N} \), ie the vector of X, \(\lambda\), and N values. I will edit my original question to clarify!
Thank you for your help!
0
サインインしてコメントを残してください。
コメント
4件のコメント