Quantcast
Channel: Active questions tagged python - Stack Overflow
Viewing all articles
Browse latest Browse all 23160

How does Gurobi handle the Piecewise Linear constraints inside its core program?

$
0
0

I am using gurobi to solve a Mixed Integer Linear Programming problem. Well, to be precise, the model is linear except a large number of piecewise linear constraints, which I know can be linearized using some other techniques. Knowing that gurobi supports this feature, I used m.addGenConstrPWL to code the constraint. But I noticed that it is not solved as a MILP. Instead, it shows logging information below with SOS constraints:

Optimize a model with 41360 rows, 27097 columns and 102646 nonzerosModel fingerprint: 0xf9a5a2ddModel has 5702 general constraintsVariable types: 22818 continuous, 4279 integer (4279 binary)Coefficient statistics:  Matrix range     [1e-05, 3e+07]  Objective range  [1e+00, 1e+05]  Bounds range     [1e+00, 1e+05]  RHS range        [1e-05, 4e+04]  PWLCon x range   [3e+01, 8e+04]  PWLCon y range   [3e-02, 8e+01]Warning: Model contains large matrix coefficient range

Compared with another MILP model I implemented using gurobi:

Optimize a model with 22818 rows, 8559 columns and 55590 nonzerosModel fingerprint: 0x04ea8c4bVariable types: 4280 continuous, 4279 integer (4279 binary)Coefficient statistics:  Matrix range     [1e-05, 3e+07]  Objective range  [1e+00, 1e+00]  Bounds range     [1e+00, 4e+02]  RHS range        [1e-05, 1e+04]Warning: Model contains large matrix coefficient range
  • My question is about how Gurobi handles piecewise linear constraints. If it uses the SOS (Special Ordered Sets) method, is there a way to directly convert these constraints into additional variables and other constraints? This would allow me to avoid extensive supplementary modeling and reduce the amount of work required when coding (such as dealing with a large number of variables and constraints).
  • and also, is it faster to use the built-in addGenConstrPWL or implement your own linearized version of SOS2 method?

Viewing all articles
Browse latest Browse all 23160

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>