mSAT icon indicating copy to clipboard operation
mSAT copied to clipboard

How to get non-deterministic solutions?

Open bergwerf opened this issue 4 years ago • 1 comments

I want to use mSAT to solve (a lot of) quite small CNFs (~40 variables), but I want to get non-deterministic solutions (e.g. a uniform pick from the set of solutions). Could I (easily) do that with this library? I appreciate all suggestions :).

bergwerf avatar Sep 21 '21 11:09 bergwerf

I haven't yet thought about this use-case. Currently, I'd say you can get some amount of non-determinism by randomizing the order in which you add clauses to the solver (which will in turn randomize the order in which the variables are added to the heap, and thus which variables are decided on when there is a tie in the activity score, which is what should happen for all the first decisions, which is likely to significantly influence how the solver will explore the clauses, and thus the solution returned), but I haven't tried it before, so it'd probably be best to try it on some small hand-crafted examples and see whether it works.

Gbury avatar Sep 21 '21 13:09 Gbury