Inferring member of a set given incomplete facts about the set
Given a bunch of facts like: Set contains at least 1 of (A,B,C) Set does not contain any of (D,E,F)
about a finite set where each member can be a finite number of values(say integers 1...m), how can I enumerate all the possible sets which satisfy the list of facts?
I realize that this algorithm is 开发者_StackOverflowexponential in nature, but I'd like to improve on my current naive implementation which is to list all possible sets, and eliminate those which do not satisfy every condition in the facts list. I thought that perhaps I could use dynamic programming and iterate over the finite values. i.e. first consider only facts relating to value 1, then values 1,2, then values 1,2,3 and so on.
Your facts sound like they would be easily translatable to a SAT (boolean satisfiability) instance. You can then use a SAT solver to find all possible solutions (get one solution, add a clause that eliminates that solution, and repeat). There are a lot of good SAT solvers out there, e.g. zChaff.
精彩评论