and is guaranteed to find the best answer
I think you may have a bug. Given the input set [400 402 521 735 758 191 191 307 679 776 877], your code produces this partition:
[400 402 521 735 758 191] := 3007 [191 307 679 776 877] := 2830
But there is a better partition:
[679 776 307 877 191] := 2830 [400 402 521 758 735] := 2816
In reply to Re: NP-complete sometimes isn't
by BrowserUk
in thread NP-complete sometimes isn't
by tilly
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |