title: Permutations of combinations of two groups
body: <p>In C#, I am attempting to write an algorithm to balance two teams given integer player ratings for each of the players.</p>
  
  <p>The data set looks like this:</p>
  
  <pre><code>Player 1:  1330
  Player 2:  1213
  Player 3:  1391
  Player 4:  1192
  Player 5:  1261
  Player 6:  1273
  Player 7:  1178
  Player 8:  1380
  Player 8:  1200
  Player 10: 1252
  </code></pre>
  
  <p>I'd like to build two sets of five players, where the <strong>total</strong> rating difference of both teams is as small as possible, for a fair match.</p>
  
  <p>Now to do this I'd like to generate all team permutations (each permutation is two teams of 5 players). But all c# permutation examples are for combining things like power sets, not teams. </p>
  
  <p>What's the most efficient way to do this?</p>