メインコンテンツへスキップ

Can a Gurobi Produce Solve this non-linear binary integer problem?

回答済み

コメント

4件のコメント

  • Riley Clement
    • Gurobi Staff Gurobi Staff

    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
  • Jack Keefer
    • Gurobi-versary
    • Curious
    • First Comment

    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
  • Riley Clement
    • Gurobi Staff Gurobi Staff

    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
  • Jack Keefer
    • Gurobi-versary
    • Curious
    • First Comment

    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

サインインしてコメントを残してください。