Hi,
 as gene sugested it can be visulized as subset sum problem...

 lets say for P(i)  - mi1, mi2 are voters registered for 2 parties. and
mi1+ mi2= m.
 calculate d(i) as mi1- mi2.
 now we hae set of d(i)'s.

 k = sum of d(i) , 1<=i <= 2n.

 if(k >0)   then the problem becomes
      finding a set of n numbers from d(i)'s such that sum of the
chosen d(i)'s should be >=1 and <= k-1.
 else {
      d(i) = d(i) * -1;
      k =  k * -1;
      finding a set of n numbers from d(i)'s such that sum of the
chosen d(i)'s should be >=1 and <= k-1.
}


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/algogeeks
-~----------~----~----~----~------~----~------~--~---

Reply via email to