Skip to main content

Getting non trivial solution from homogeneous system of equation

Answered

Comments

3 comments

  • Official comment
    Simranjit Kaur
    • Gurobi Staff
    This post is more than three years old. Some information may not be up to date. For current information, please check the Gurobi Documentation or Knowledge Base. If you need more help, please create a new post in the community forum. Or why not try our AI Gurobot?.
  • Eli Towle
    • 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

Post is closed for comments.