in reply to Re^3: NP-complete sometimes isn't (A benchmark)
in thread NP-complete sometimes isn't

I thought of that and you can't do it. Suppose we have 10 numbers and the optimal partition has 6 in one side and 4 in the other. Then you've added 6*$adjust to one side and 4*$adjust to the other, and the partition is no longer going to look optimal.

I did think about making all numbers be their absolute value, and then reverse which partition the negative numbers go in, but that logic looked more complicated and convoluted than the way I originally wrote it.

  • Comment on Re^4: NP-complete sometimes isn't (A benchmark)