title: Minimize optimization with constraints from multiple sets of options
body: <p>I am looking for a way to minimize costs with multiple constraints by selecting one option per group out of a large dataset with groups that each contain options. The dataset consists of around 100 groups with 200 options each.</p>
  
  <p>Below is a list of the conditions for the optimization, an example of the data and what the result should be. On small datasets I just looped over all combinations but with the actual large dataset this would take forever. I looked into SciPy Optimize Minimize but that doesn't seem suitable. Is there an existing optimization framework that would be usable to find the lowest costs? If not, what would be a good way to solve it in Python?</p>
  
  <p><strong>Conditions</strong></p>
  
  <ul>
  <li>Exactly one option per group</li>
  <li>Minimize sum of costs</li>
  <li>Sum of A must be lower than 10</li>
  <li>Sum of B must be lower than 12</li>
  </ul>
  
  <p><strong>Dataset</strong></p>
  
  <pre><code>+-------+--------+-----+-----+-------+
  | Group | Option |  A  |  B  | Costs |
  +-------+--------+-----+-----+-------+
  |     1 |      1 |  10 |   0 |    10 |
  |     1 |      2 |   0 |   0 |    21 |
  |     1 |      3 |   0 |   7 |    15 |
  |     2 |      1 |   8 |   0 |     8 |
  |     2 |      2 |   0 |   0 |    34 |
  |     2 |      3 |   0 |   5 |    18 |
  |     3 |      1 |   9 |   0 |     9 |
  |     3 |      2 |   0 |   0 |    20 |
  |     3 |      3 |   0 |   6 |     7 |
  +-------+--------+-----+-----+-------+
  </code></pre>
  
  <p><strong>Result</strong></p>
  
  <pre><code>+-------+--------+
  | Group | Option |
  +-------+--------+
  |     1 |      1 |
  |     2 |      3 |
  |     3 |      3 |
  +-------+--------+
  Total costs: 35
  Sum A: 10
  Sum B: 11
  </code></pre>