knapsack problem

On Fri, Aug 14, 2009 at 7:10 PM, fundoonick <fundoon...@yahoo.co.in> wrote:

> The modulus(or absolute) of difference should be minimum.Or the difference
> should be closest to 0(-ve or +ve side).
>
> For ex, for 5,6,7,8,9
> Required sets are: {5,6,7} and {8,9}
> The difference is abs((5+6+7)-(8+9)) = 1
>
> Hope it clears your doubt
>
> Nikhil Jindal
>
>
> On Fri, Aug 14, 2009 at 7:02 PM, Ajinkya Kale <kaleajin...@gmail.com>wrote:
>
>> sorry i meant >=0 .. or are negative differences allowed ?
>>
>> On Fri, Aug 14, 2009 at 7:02 PM, Ajinkya Kale <kaleajin...@gmail.com>wrote:
>>
>>> Should the difference be <= 0 always ?
>>>
>>>
>>> On Fri, Aug 14, 2009 at 6:57 PM, fundoonick <fundoon...@yahoo.co.in>wrote:
>>>
>>>> Problem:
>>>> I have a set of positive integers. I have to divide it into 2 sets such
>>>> that the difference of the sums of both sets is minimum.
>>>> For ex, the given set of +ve integers is: 1,2,3,4
>>>> I divide it into 2 sets {1,4} and {2,3} such that the difference of
>>>> their sum (1+4=)5 - (2+3=)5 = 0
>>>> This is the least possible difference.
>>>>
>>>> Pls help.
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>
>>>
>>> --
>>> Ciao,
>>> Ajinkya
>>>
>>
>>
>>
>> --
>> Ciao,
>> Ajinkya
>>
>>
>>
>
> >
>

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

Reply via email to