in reply to NP-complete sometimes isn't
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
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: NP-complete sometimes isn't
by tilly (Archbishop) on Sep 02, 2008 at 08:34 UTC | |
by BrowserUk (Patriarch) on Sep 02, 2008 at 09:19 UTC | |
|
Re^2: NP-complete sometimes isn't
by shmem (Chancellor) on Sep 02, 2008 at 09:39 UTC | |
by BrowserUk (Patriarch) on Sep 02, 2008 at 10:13 UTC | |
|
Re^2: NP-complete sometimes isn't
by lidden (Curate) on Sep 02, 2008 at 07:44 UTC |