[Coin-symphony] Best form for constraints

Mark Williams mark at stretchinc.com
Wed Jan 16 18:14:34 EST 2008


I have a program which is generating models using sym_explicit_load_problem, and then trying to solve them.

Some of the models take a long time to solve, and I was trying to figure out why.

I picked a model that was taking around 1000s to solve, wrote it out using sym_write_lp, and tried solving it using the symphony executable. It solved in around 5 seconds.

I checked (in the debugger) that all the parameters were setup identically, but then noticed that the number of rows in the initial lp model was different.

It turns out that a constraint of the form "lb <= sum ai xi <= ub" gets written out as two constraints in the lpt format, and that those constraints dont get combined when the model is read in again.

So I changed the way I generate the models, and always generate two constraints, rather than a range constraint. This helped in a lot of cases (and didnt make anything significantly worse).

It looks like a systematic problem, in that separating the constraints often helps a lot, and never hurts much - but I realize it may just be noise, and my problems happen to do better.

I've also discovered that if I turn on lift-and-project cuts, the problems solve quickly (for the most part) either way; but Im still seeing slightly better performance (user time, nodes created, and nodes visited) when I separate the constraints.

Any insight into why this might be, and if I really should be generating two constraints, rather than one?

Mark Williams



More information about the Symphony mailing list