Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dead-loop in depth-first-search #1

Open
noodles-v6 opened this issue Jul 26, 2014 · 0 comments
Open

dead-loop in depth-first-search #1

noodles-v6 opened this issue Jul 26, 2014 · 0 comments

Comments

@noodles-v6
Copy link

I found the duplication state might be happen at

void simulation::depth_first_search(state* initial)
 ...
                if (s->board()->areas()->pop(&a)) {
        if (a->size() < 3) {
            delete a;
            continue;
        }

        state* p = new state(s, *a);
        GRAPH(s, &a->point(), p);
        stack.push(p);
        delete a;
        continue;
    }

I think you should check the new state whether or not duplication before stack.push(p).
if duplication, skip.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant