Skip to main content

How to improve optimization speed (quadratic + general constraints)

Comments

1 comment

  • Igor Ganapolsky

    A few things from your log that usually explain slow bound movement here.

     

    1) Nearly all your constraints are equalities defining auxiliary products/powers (u1_sq = u1^2, c1_1_sq = c1_1^2, d1_c1_1_sq = c1_1_sq * x, …). Each bilinear equality gets spatial branching, and the relaxation of a product is only as tight as the bounds on its factors. If x, y, z, u1, r1, r2, c1_* have loose or infinite bounds, the McCormick relaxation is nearly useless: heuristics find incumbents fast but the dual bound crawls. Putting tight finite lower/upper bounds on every variable appearing inside a product is by far the highest-leverage fix, often orders of magnitude.

     

    2) You chain products (c1_1 → c1_1_sq → d1_c1_1_sq). Each extra auxiliary level adds relaxation gap. Substitute out a level where you can, or express the composite term as one general constraint instead of two nested bilinears.

     

    3) Parameters, in order:

    - MIPGapAbs 0.01 with an objective near 0.93 is roughly a 1% absolute tolerance, so it is competing with your MIPGap; one of the two is doing nothing. Pick one.

    - FuncNonlinear=1 for the pow/abs general constraints (Gurobi 11+) gives exact handling instead of a fine piecewise approximation that bloats the model.

    - Try Presolve=2 and Cuts=2. Also try Heuristics=0.05: your log has a lot of H-lines, i.e. time spent in heuristics that are not helping the bound.

    - Method=2 at the root is fine, but barrier at every node on a small model is often slower than dual simplex; check NodeMethod.

     

    4) Coefficient ranges look clean (1e+00), but check bound ranges too: “big enough” bounds like 1e+6 behave like infinite bounds for the relaxation.

     

    If the gap is still stuck after tightening bounds, write the model out (model.write("m.lp")) and post it - it is much easier to see where the relaxation is weak.

    0

Please sign in to leave a comment.