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

Super slow "heuristic" solution injection

回答済み

コメント

4件のコメント

  • 3RiverResearcher
    Gurobi-versary
    First Question
    First Comment

    I noticed one flaw in my approach: The models were run on two different threads, but not in a thread safe way. So I added one distinct gp.Env() to each thread.

    If I only set a partial solution of x and y variables, the solution setting seems to work. Now the time is also acceptable. But I still do not understand, why gurobi does not accept the complete solution? The "z" and "bz" variables depend on the x variables.

    0
  • Ryuta Tamura
    Gurobi Staff Gurobi Staff

    Hi,

     But I still do not understand, why gurobi does not accept the complete solution?

    Have you checked the return value of cbUseSolution?  If the given solution is not accepted, the value will be GRB.INFINITY (very large value). In your case, partial solutions are accepted, so which means that the solution by all variables may violate some constraint.

    Thanks,
    Ryuta

    0
  • 3RiverResearcher
    Gurobi-versary
    First Question
    First Comment

    Hi Ryuta,

     

    thank you very much for your reply! I did not know about the return Value of cbUseSolution.

    Indeed, if I provide the partial solution I will get the improved objective, if it is the "full" solution I get GRB.INFINITY. It seems that just the continous variables, which depends on the integer solution values are problematic.

    Any easy way to debug it? Should I try to provide it as a MIPStart to my model?

    Or is it in general better to provide partial solutions?

     

    Best Regards

    3RiverResearcher

     

    0
  • Ryuta Tamura
    Gurobi Staff Gurobi Staff

    Any easy way to debug it?

    For example, you can do it by fixing ub and lb of all variables to their values and then use computeIIS to see which parts are violated.  This article might be helpful.

    Or is it in general better to provide partial solutions?

    Sometimes this approach is recommended. The values for a continuous variables may contain numeric errors that cause it to be Infeasible. Also, if integer variables are fixed, Gurobi can compute the value of the corresponding continuous variable relatively fast.

    Thanks,
    Ryuta

    0

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