in reply to Re: NP-complete sometimes isn't
in thread NP-complete sometimes isn't

The initial version that I posted did indeed have a bug. If it wound up not using any of the initial greedy guess, it would repeat the last element from the greedy guess. In your case that would explain why 191 repeated.

I fixed that bug, but obviously not before you downloaded the buggy version of the code.

Replies are listed 'Best First'.
Re^3: NP-complete sometimes isn't
by BrowserUk (Patriarch) on Sep 02, 2008 at 09:19 UTC

    Indeed the updated version works much better. I was a bit quick of the mark because I was looking to use your code to verify the veracity of the claims I was making for my own :)


    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.