Is it better to split nonlinear expressions into auxiliary variables or keep them in a single constraint?
回答済みWhen dealing with nonlinear expressions, is it better to keep a single constraint with multiple bilinear and/or quadratic terms, or to introduce auxiliary variables to break it into smaller parts?
For example, consider
t = xy + yz + zw + r^2
Option 1: keep it as one constraint with several bilinear and quadratic terms.
Option 2: introduce auxiliary variables for each term:
a = xy
b = yz
c = zw
d = r^2
and then write:
t = a + b + c + d
Does introducing these auxiliary variables generally improve performance, or does it make the model larger without much benefit?
More generally, is it better to reduce the number of nonlinear terms in each constraint by adding variables, or to keep fewer variables and allow more complex expressions in a single constraint?
-
Hi Huan,
Just to keep the information in one place, I'm quoting my response from your other post below in case it's useful for future readers:
Yes, your observation can be correct for your particular model. A manually introduced bilinear reformulation could sometimes solve faster than modeling the nonlinear relationship directly.
However, I would not interpret this as a general rule. Both formulations are nonconvex, so solving them to global optimality generally relies on the same techniques. The two formulations can nevertheless lead to different internal representations, presolve reductions, branching decisions, and numerical behavior. As a result, either formulation may be faster for a given model or instance.
For a fair comparison, I recommend testing with the latest Gurobi version, currently 13.0.1. Gurobi 13.0 introduced performance improvements across several model families. I would also compare the two formulations over several Seed values rather than relying on a single run. Changing the Seed parameter typically leads to different solution paths. This is a useful way to account for performance variability when comparing formulations.
0
サインインしてコメントを残してください。
コメント
1件のコメント