[Clp] MILP how to make constraints numbers as a decision variable

John Forrest john.forrest at fastercoin.com
Fri Jul 29 10:36:55 EDT 2016


David,

It depends what you mean by condition 3.

Without that you add c1,c2,c3 0-1 variables and add in -M*ck into 
constraint k to make inactive if ck 1.

Then add a constraint c1+c2+c3<=2

Depending on what you mean by 3) you may be able to introduce -
z = 8*x1+6*x2-x3 and maximize z but also use z.

So if you want condition that if z>100 then two constraints must be 
active then you would add 0-1 variable c4 into constraint and have 
M*c4>=z-100.

Of course big M's can make difficulties - depends how big M has to be.

You might also be able to use SOS.

You should probably ask this question on Cbc not Clp.

John Forrest
On 27/07/16 21:21, usa usa wrote:
> Hi,
>
> I am trying to build a MILP.
>
> I need to set the number of linear constraints in the model as a 
> decision variable.
>
> For example:
>
> max 8* x1 + 6 * x2  - x3
> s.t.
>       constraint 1 : x1 + x2 <= 29
>       constraint 2 : x1 - x2 <= 5
>       constraint 3 : x2 + x3 <= 56
>
> I would like to make the all three constraints as candidates such that
>
> 1. the objective maximized.
> 2. At least one constraint must be active
> 3. How many of candidate constraints are active depends on the 
> objective optimization value.
>
> I know this may have exponential complexity because for 3 candidates, 
> I can have 2^3 = 8 combinations of constraints.
>
> Are there some ways to out all candidate in the model and solve it for 
> one run to get the optimal solution and let the model decide which 
> candidates should be active  /
>
> thanks
>
> David
>
>
>
>
>
> _______________________________________________
> Clp mailing list
> Clp at list.coin-or.org
> http://list.coin-or.org/mailman/listinfo/clp


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://list.coin-or.org/pipermail/clp/attachments/20160729/8f9a1d8a/attachment.html>


More information about the Clp mailing list