title: Greedy algorithm for dividing a region of numbers into partitions with the most equal sum?
body: <p>Say we have a number sequence, and we have X sections to divide this into:</p>
  
  <p>1, 4, 7, 9, 3, 11, 10</p>
  
  <p>If we had 3 sections, the optimal answer would be:</p>
  
  <p>[1, 4, 7][9, 3][11, 10]
  <strong>or</strong>
  [1, 4, 7, 9][3, 11][10]</p>
  
  <p>Since the largest sum = 21. This is the best case. (I think, I did it by hand).</p>
  
  <p>We want each section to be as equal as possible. How can this be done? My first attempt at an algorithm was to find the highest X values (9, 11, 10), and base the regions off of that. That does not work in an example like below, since one of the regions will NOT contain one of the highest values in the set:</p>
  
  <p>3, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, </p>
  
  <p>Again with X=3 sections, optimal answer:</p>
  
  <p>[3, 2][2, 1, 1, 1][1, 1, 1, 1, 1]</p>
  
  <p>Of course I could brute force every possible combination, but there is a much more efficient way of doing this. But I'm having trouble finding it.</p>