New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use a pseudo-boolean SAT solver #568
Comments
Here's an update. I've delved a bit into the wonderful world of SAT solvers. I won't bore you with the details, but basically academics are terrible at writing software. I have a branch
(it includes mkl, which is a separate issue; it's because internally conda is considering mkl to be newer than the non-mkl version)
The optimization function that I am using works like this. Say 20 is the maximum number of versions of any package. Say that Now here is my plan for now:
This would be much easier to implement, and would be exactly as efficient. The downside is that we are stuck with that exact scheme, or something similar. With pseudo-boolean, we could play with different kinds of constraints or optimization functions in the future (or even now, if this one we are currently thinking of does not work as well as we expect it to). It would also make tweaking the scheme easier, because we would just have to tweak the optimization function, rather than the algorithm I described above. But the upside is that we don't have to worry about implementing and testing a tricky logic algorithm. Yesterday when I realized this my plan was to just implement this in conda, but today, when I saw how simple the BDD conversion is, I think I'll just try it. |
The paper at http://www.mancoosi.org/papers/ase10.pdf describes how to use pseudo-boolean constraints. I think it is better to use what they are doing rather than the ad-hoc thing I came up with. The pseudo-boolean transformation algorithm is completely implemented in the logic branch. Testing it on my above idea reveals that it is too slow (it takes about 20 seconds just to convert the constraint into SAT conditions), and also, since the implemented BDD algorithm is recursive, it hits the recursion limit if there are more than 1000 or so terms. I haven't read the above paper fully yet, but it seems to be much simpler, and it will likely be much faster. |
This is merged. There is still work to do (like using pseudo-boolean clauses to also find the minimal solution, and starting to look at what is already installed), but the most important part, looking at all versions and using constraints to find the optimal solution, is implemented. |
Hi there, thank you for your contribution to Conda! This issue has been automatically locked since it has not had recent activity after it was closed. Please open a new issue if needed. |
The current SAT solver falls short if we want to be more intelligent about including more than just the latest version of every package (see #491 and related issues). An attempt was made using the existing framework at #549, but it is too slow. A pseudo-boolean SAT solver would let us specify a function to optimize, which would be translated into SAT conditions.
The text was updated successfully, but these errors were encountered: