title: Discrete optimization - selecting exactly N items from each row and column of a score matrix
body: <p>Given a matrix of scores, I'd like to select exactly n elements from each column and each row such that the total score of the selected elements across the entire matrix will be as high as possible.</p>
  
  <p>Example: given the cost matrix </p>
  
  <pre><code>array([[0.65500799, 0.79214695, 0.39854742],
         [0.53634974, 0.3682463 , 0.99663978],
         [0.73423119, 0.87150676, 0.80823699]])
  </code></pre>
  
  <p>The optimal selection for n=1 is:</p>
  
  <pre><code>array([[1., 0., 0.],
         [0., 0., 1.],
         [0., 1., 0.]])
  </code></pre>
  
  <p>the total score of this solution is 0.65500799+0.87150676+0.99663978</p>
  
  <p>The optimal selection for n=2 is:</p>
  
  <pre><code>array([[1., 1., 0.],
         [1., 0., 1.],
         [0., 1., 1.]])
  </code></pre>
  
  <p>the total score of this solution is 0.65500799+0.53634974+0.79214695+0.87150676+0.99663978+0.80823699</p>
  
  <p>These solutions were obtained by a naive <a href="https://en.wikipedia.org/wiki/Breadth-first_search" rel="nofollow noreferrer">Breadth-First Search (BFS)</a>. However, this approach isn't computationally feasible (run time explodes) for larger problems (e.g., 10x10, n=2).</p>
  
  <p>Questions:</p>
  
  <ol>
  <li>How is this discrete optimization problem classified?</li>
  <li>What heuristics can allow finding good solutions for this problem quickly?</li>
  <li>What Python libararies implement these heuristics?</li>
  </ol>