Skip to content

NQueensProblem doesn't work with search methods #711

@PeterDrake

Description

@PeterDrake

If I import search and then

puzzle = search.NQueensProblem(8)
print(search.breadth_first_search(puzzle))

I get:

TypeError: unhashable type: 'list'

In order to work with the various search algorithms, the states have to be tuples, not mutable lists.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions