-
Hi, I am using cadical for solving a problem after converted to SAT. The preliminary results are very good. In the conversion I need to create many variables, but the solution is depending only on a subset of the variables. I would like to restrict the decision variables to a list of the first K variables, to verify if helps the solver. The auxilar variables may not generte as many implications like the first variables. Exist a simple way to do that, in some advanced parameter? If not, can you provide some orientation on the source code needed to change, for adding the option and how to limit the decision variables. Thanks. Best regards, |
Beta Was this translation helpful? Give feedback.
Replies: 6 comments 2 replies
-
There is no option to do that, because it is in general not useful, dangerous (SAT becomes meaningless), and unclear how to do in presence of inprocessing (See #39 (comment)). That being said, you /could/ before starting solving, add something like (untried!):
before starting the main CDCL loop to bump the clauses that you believe are important (without running into completeness issues because you only bump the variables at the beginning instead of removing them from the queues like you are suggesting). |
Beta Was this translation helpful? Give feedback.
-
Thanks for for the support. I checked #39, and is the same issue. I can present a simpler case: scheduling problem to SAT. In Horbach2010, they convert RCPSP to SAT by creating two types of variables in SAT. The start variables (that are 1 if activity j start at time t), and the process variables (that are 1 if activity j is executing at time t). For extracting the solution, is enough the start variables, but for codify the resource restrictions in SAT is required the process variables. The idea would be just to allow branching in the variables that are enough to get a solution, in this case, the start variables. With all the solution variables with a fixed value, the SAT instance should be SAT or UNSAT. If all solution variables have a value and does not exist a conflict, then return SAT. But, for make sure, the solver could continue to find a solution for the rest of auxiliar variables, to get a guaranty that is possible the rest of the variables. In case of my codifications, the conflicts originate always from solution variables, so no branching is needed once we have all variables in the solution set, since unit propagation will guaranty all conflicts will be active if all solution variables are set. Of course, arbitrary just branch on the K first variables, makes no sense. But in this case, for each instance, by construction, we know that is enough to set a value for the first K variables to have a solution that can be validated by unit propagation (no need to branch). This is the base for only want to allow branching on solution variables. Also, branching in a start time of an activity, makes more sense then in processing variable. I am trying the m-fleury suggestion, that partial solves this and would work even if setting all solution variables, we cannot verify the solution only by unit propagation. At least it can be used to verify if has an impact or not, in my instances. Bump all solution variables before start. If I understand, the bump is to put the variable first in the queue and in the scores. An head start for these variables, may be enough to observe a positive effect. I am running now, to see if the effect is significative, in the configuration that have more extra variables. Changed only in the file cadical.cpp: ` solver->options (); //// jcoelho bump test: code from mfleury In case it has a significative effect, if I bump multiple times, would lead to some difference? Since bump only once, may get the variables to be used first, but after a while may get behind other variables that are not solution variables. Best regards, References:
|
Beta Was this translation helpful? Give feedback.
-
So you only want to prefer them once at the beginning (before a conflict is reached). This would be simpler to achieve, the other more general version in #39 to always prefer is much harder to implement. BTW, there a hints for value/phase assignment. |
Beta Was this translation helpful? Give feedback.
-
For
See this issue #56. You want to use the Line 303 in 84b4439 |
Beta Was this translation helpful? Give feedback.
-
Thanks for the paper and the support given. I understand now the phase. Bumpping only variables that are enough to define the solution, do not worked in my instances. Could not observe a significative difference, at least, but is good that I made the test, to convice myself. I want to left the changes made in cadical, for someone that may want to test the same in other instances. I think the changes do not make incorrect results, since the variables are not removed from any queue, are only not bumped, following the m-fleury first suggestion. At least, tried several times, and in one case with a bug where no variables are bumped, and I do not observe any crash from cadical. In the worst option, without any bump, the performance drop, but not as much as I expected, only about 5%. But, of course, the bumping would be more important in longer runs, I only used 1 minute runs. Changes in 3 files: analyze.cpp: --- just inserted the conditional to bump only the first variables internal.hpp: --- create the max_bump variable in struct Internal cadical.cpp --- in main, load the paramter, and set max_bump To use is a matter of calling cadical with for example "-B100", will bump only variables in conflicts, that have ID lower or equal than 100. Is good that cadical is very well optimized, and this is not needed at least in my instances. The users from other problems, can concentrate on the transformation to SAT. Thanks for the solver. Best regards, |
Beta Was this translation helpful? Give feedback.
There is no option to do that, because it is in general not useful, dangerous (SAT becomes meaningless), and unclear how to do in presence of inprocessing (See #39 (comment)).
That being said, you /could/ before starting solving, add something like (untried!):
before starting the main CDCL loop to bump the clauses that you believe are important (without running into completeness issues because you only bump the variables at the beginning instead of removing them from the queues like you are suggesting).