Hi, it is based on DP. The state transition function is as f[v]=max(f[v-a[i]],0), means if f[v] can be summed by a[i] and f[v-a[i]]. Any f[...]=0 or 1.
After getting all the f[...], just scan the f[] to get the minimum difference. 2012/11/20 shady <sinv...@gmail.com> > Hi, > We have to divide a set of numbers into two subsets such that their > difference is minimum (Balanced Partitioning Problem). Can anyone explain > the suggested solution ? > http://ace.delos.com/TESTDATA/JAN11.divgold.htm > > -- > > > -- Best Regards, Tian Guo -- Tian Guo Assistant, Ph.D. Student Swiss Federal Institute of Technology of Lausanne (EPFL) EPFL IC LSIR Station 14 CH-1015 Lausanne Switzerland http://lsir.epfl.ch --