Conversation
|
MTZ is a weakened form of the existing decomposition (happy to show the derivation) that assumes the circuit is at top level. In other words, the decomposition is not a "top level definition" + local constraints. There is a way to use these, but right now it will be incorrect under negation. |
|
(nonetheless, kudos for being on the lookout out for the most efficient decomposition!) |
|
I think it's weird to decompose in other places than decompose_globals, I know we discussed this a bit elsewhere as well but if a global has multiple decompositions the right place for those decompositions are in the global itself (so a decompose_linear which defaults to the normal decomposition making it backwards compatibel) |
|
So I did some testing, and this decomposition is indeed about 3x faster for gurobi, but only works in the non reified case. |
|
Made some tests with room assignment problems that have many alldifferents. What you say seems true in small problems with just a few alldifferent constraints, but when I created a larger problem (with 88 alldifferent constraints). I have the following results: With linear decomposition of alldifferent constraints:
With the normal decomposition of alldifferent constraints:
Thus, the linear decomposition is much more efficient in solving (which is the important part) and even faster in the transformations. |
|
This should be reconsidered as part of, or after #836 |
Ok, so I could not help myself and implement a custom decomposition for the
Circuitconstraint inlinearize_constraint.Its inspired by TSP models for MIP: https://how-to.aimms.com/Articles/332/332-Miller-Tucker-Zemlin-formulation.html
This allows us to run all of the examples with gurobi within 20s, so I think its a nice quality of life improvement for us :).