How should the objects be split ????


Therefore:


S = all possible subsets of {1 , 2, 3,...., n}; Initialize minArea: s_{1} ∈ S; // Pick the first subset in S best_A = s_{1} best_B = {1,2,3,...,n}  s; // Completement set minArea = AreaOfBB(objects in A) + AreaOfBB(objects in B); /* ================================================= Brute force: test every possible split... ================================================= */ for ( each subset s ∈ S  s_{1} ) do { A = s; B = {1,2,3,...,n}  s; Area = AreaOfBB(objects in A) + AreaOfBB(objects in B); if ( Area < minArea ) { minArea = Area; // New best !!! best_A = A; best_B = B; } } 

Running time of the naive (bruteforce) algorithm:
Complexity of the naive redistribute alg = O(2^{n1}) (# subsets of a set of n elements = 2^{n}) (We need to consider half of all subsets due to symmetry) 
Abstractly:
1. Pick 2 "seed" objects e_{1} and e_{2} that are "as far apart" from each other as possible Group1 = { e_{1} }; Group2 = { e_{1} }; 2. while ( remaining elements ≠ ∅ ) { nextElem1 = the uninserted element that will increase the BB of Group1 by the least amount nextElem2 = the uninserted element that will increase the BB of Group2 by the least amount if ( increase in BB when adding nextElem1 to Group1 < increase in BB when adding nextElem1 to Group2 ) { Add nextElem1 to Group1; } else { Add nextElem2 to Group2; } } 
This O(n^{2}) algorithm is described in this reference paper: click here