Skip to main content

Gurobi providing non-optimal and worse solution that a simple greedy algorithm for MIQCP problem?

Awaiting user input



  • Riley Clement
    Gurobi Staff Gurobi Staff

    Hi Francesco,

    Perhaps Gurobi is running into numerical or convergence difficulties, it is hard to tell without reproducing it.

    Can I suggest the alternative formulation to your problem:

    min (x/y)*z
    st. (x,y,z) \in D

    Introduce a free variable p, and move the objective function into constraints:

    min p
    p >= (x/y)*z
    st. (x,y,z) \in D, p free

    then multiply through by y to get the final form:

    min p
    y*p >= x*z
    st. (x,y,z) \in D, p free

    This formulation has less variables, and avoids equality constraints, so it may perform better.  Can you give it a try and see if you still encounter an error?

    It would also be useful to take your solution from the greedy algorithm, and use it to fix the variables in your problem, via lower and upper bounds, and optimize to see if the solution is accepted by Gurobi.

    - Riley




  • Gwyneth Butera
    Gurobi Staff Gurobi Staff

    Additionally, have you had a chance to review the Knowledge Base article How do I diagnose a wrong result? There are a number of troubleshooting suggestions there that may help you. -G


Please sign in to leave a comment.