Originally posted by: giscardf
Hi Gregory, let's see if I understood what you mean (I am not a CPLEX expert, neither a Optimizer expert)...
>> did you already try formulating your model in the natural way and pass it to CPLEX?
The answer is YES. I did try three different models in CPLEX
1)Using quadratic terms + normal constraints (CPLEX could solve it for N<=6 but not for N=8)
MIN X1 Y1 Cost1 + X2 Y2 Cost2 + ... + XN YN CostN 2)Using linear terms + normal constraints + special constraints (CPLEX could solve it for N<=6 but nor for N=8, however for N=6 CPLEX did it 1000 times faster)
MIN T1 Cost1 + T2 Cost2 + ... + TN CostN X1 + Y1 - T1 <= 1 X2 + Y2 - T2 <= 1 ... XN + YN - Tn <= 1 3)Using linear terms + normal constraints (CPLEX could solve it for N=40, however this does not result in the right solution due to modification)
MIN (X1 + Y1) Cost1 + (X2 + Y2) Cost2 + ... + (XN + YN) CostN >>I'm not sure from your comment about "thousand of terms" whether you already determined that this formulation is computationally intractable, or if you are assuming non-convexity is the >>obstacle and reformulation is mandatory
When I mean thousand, I am trying to say that my objective function has
3.(((n-2).n.n.n)-(2.((n-2).(n.n)))+((n-2).n)) + 2.(n.(n-1)) terms
>>While the product of two variables is not a convex quadratic function, the binary declaration allows CPLEX to make an internal reformulation that permits it to solve it.
I agree with you
>>If your model will never contain any nonlinearities other than these simple products, it may not be necessary for you to do any explicit reformulation yourself.
When I change the products by sums and create the new restrictions CPLEX can solve them faster, so I believe the reformulation helped. However the problem still has
too much terms and inserting
3.(((n-2).n.n.n)-(2.((n-2).(n.n)))+((n-2).n)) + 2.(n.(n-1)) new restrictions is making things harder to CPLEX
>> The growth in model size by using the linearization you described does sound daunting. And indicator constraints hold no promise for improvement in that regard as they are basically linear >> too - I wouldnt' expect the complexity of the model to be markedly different. While a quadratic model will usually be slower than a linear counterpart of the same size, quadratic methods
>> are still efficient enough that they can do better than a linear model of much larger dimension.
I agree with you, at the begining it sounds daunting for me too. However the reforumation (even adding new restrictions) allowed CPLEX to solve the N=6 problem 150 times faster
>>As for your final question about how to create a single function that matches your table of values, there are 4 values you are trying to "curve fit", and while a symmetry argument reduces it >>to 3, it is still one too many for a linear fit, and so I see quadratic as the lowest order polynomial you can hope for.
I did understand your point here. However, let me jot down MY PERSPECTIVE (please, argue it and critic it as much as you want)
During my experiments I could see that what is taking CPLEX down are the new restrictions (as I said if I force my objective function to be linear and do not create any new restriction it can solve the problem really fast). So I am focusing on transform those new restrictions in lightweight ones. For example if a restrictions
Xi + Yi - Ti <=1, where all variables are Binary, we have the table
TABLE
X Y T
0 0 0/1
0 1 0/1
1 0 0/1
1 1 1
In my model T=1 means increment the objective function, while T=0 means decrease, so every time CPLEX have the opportunity to choose between 0 or 1, it will take 0 (it is a MINIMIZE objective functions). Also, in my model, 99% of Xi + Yi expressions will fit the three first rows of the table (i.e., CPLEX will have to try T=0 and T=1 and after that pick T=0). Performing such selection for so many terms taking time and nodes when considering the branch and cut method.
Since I know that T MUST be 1 for X=1 and Y=1 and T MUST be 0 for all the others, I am supposing that force CPLEX on doing that will allow me to get better results. Right now I am trying to create a Java program to do this, let's see if I can get better results
#CPLEXOptimizers#DecisionOptimization