Skip to content

dead-loop in depth-first-search #1

Description

@noodles-v6

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions