Skip to main content

Getting non trivial solution from homogeneous system of equation

Answered

Comments

2 comments

  • Eli Towle
    Gurobi Staff Gurobi Staff

    Hi Regina,

    By default, variables added using Model.addVars() are nonnegative. Perhaps this is the problem, since the solution to the system \( Hq = 0 \) is restricted to the set \( \{ q \colon q \geq 0 \} \). You can remove the lower bound on the \( q \) variables by adding \( \texttt{lb=-GRB.INFINITY} \) as a keyword argument to Model.addVars(). Could you try this?

    Also, note that you can use \( \texttt{x.sum()} \) to generate the objective function \( \sum_{i \in E} x_i \). This is a bit more concise. See tupledict.sum() for more information about this method.

    Thanks,

    Eli

    0
  • Regina Charisty Kurnia
    Gurobi-versary
    First Comment
    First Question

    Hi Eli,

     

    I tried your solution and it works just as I expected. Thank you very much!

     

     

    Kind regards,

    Regina

    0

Please sign in to leave a comment.