<html>
  <head>
    <meta content="text/html; charset=windows-1252"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <div class="moz-cite-prefix">David,<br>
      <br>
      It depends what you mean by condition 3.<br>
      <br>
      Without that you add c1,c2,c3 0-1 variables and add in -M*ck into
      constraint k to make inactive if ck 1.<br>
      <br>
      Then add a constraint c1+c2+c3<=2<br>
      <br>
      Depending on what you mean by 3) you may be able to introduce -<br>
      z = 8*x1+6*x2-x3 and maximize z but also use z.<br>
      <br>
      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.<br>
      <br>
      Of course big M's can make difficulties - depends how big M has to
      be.<br>
      <br>
      You might also be able to use SOS.<br>
      <br>
      You should probably ask this question on Cbc not Clp.<br>
      <br>
      John Forrest<br>
      On 27/07/16 21:21, usa usa wrote:<br>
    </div>
    <blockquote
cite="mid:CANzaY593wr1k3hvZLGsTkFxFMZgoEZ_SmPk+Ga2-5Qv0fBQn2Q@mail.gmail.com"
      type="cite">
      <meta http-equiv="Context-Type" content="text/html; charset=UTF-8">
      <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>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
Clp mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Clp@list.coin-or.org">Clp@list.coin-or.org</a>
<a class="moz-txt-link-freetext" href="http://list.coin-or.org/mailman/listinfo/clp">http://list.coin-or.org/mailman/listinfo/clp</a>
</pre>
    </blockquote>
    <p><br>
    </p>
  </body>
</html>