<div dir="ltr"><div><div><div><div><div><div>Hi, <br><br></div>I am trying to build a MILP. <br><br></div>I need to set the number of linear constraints in the model as a decision variable.<br><br></div>For example: <br><br></div>max 8* x1 + 6 * x2  - x3<br></div>s.t. <br></div>      constraint 1 : x1 + x2 <= 29<br>      constraint 2 : x1 - x2 <= 5<br>      constraint 3 : x2 + x3 <= 56<br><div><div><div><div><div><br></div><div>I would like to make the all three constraints as candidates such that <br><br>1. the objective maximized. <br>2. At least one constraint must be active<br></div><div>3. How many of candidate constraints are active depends on the objective optimization value.<br><br></div><div>I know this may have exponential complexity because for 3 candidates, I can have 2^3 = 8 combinations of constraints.<br><br></div><div>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  /<br><br></div><div>thanks<br><br></div><div>David<br></div><div><br><br><br></div></div></div></div></div></div>