Skip to content

Question regarding enumerating solutions #1

@MushroomHunting

Description

@MushroomHunting

Hi there!

Got a question regarding modifying the code to continually enumerate SAT solutions (if they exist).
As I currently understand once a SAT is found, self.decide() returns -1 (i.e. we've assigned all variables, and no conflict is found).
After that, there the check for SAT occurs

if var_decided == -1: 
   ...
   break

Which then exits the main loop leaving us with just the first found solution. However I want to continue enumerating more solutions if they exist. However I'm not sure the best way to modify the code to do so. I've got many open questions but don't know where to start: Would a new Stats object need to be instantiated for every new search? Does the found solution need to be converted to a new conflict clause? Is it possible to just call self.backtrack(0,None) to restart after adding the just-learned SAT as a conflict clause?

I would be grateful if you have some advice on the above

cheers!

P.S. This codebase a masterpiece of code and commentary... thanks for the awesome release

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