Skip to content
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

Write a section on CP-SAT with C++ (potentially mixed with Python using PyBind11) #44

Open
d-krupke opened this issue Jul 29, 2024 · 3 comments
Labels
new content New content to the primer.

Comments

@d-krupke
Copy link
Owner

Sometimes, the performance of Python is simply too slow to build larger models. In this case, parts of the code can be written in C++ and integrated into Python using PyBind11. My desk neighbor Phillip Keldenich actually wrote a conan package for CP-SAT, which can be automatically build in Python using my skbuild-conan.

Could be nice to have a tutorial on how to do that.

@d-krupke d-krupke added the new content New content to the primer. label Jul 29, 2024
@leonlan
Copy link
Contributor

leonlan commented Aug 23, 2024

Do you have any examples/links for this issue? I might be interested in this for scheduling with circuit constraints. The Python model takes too long to construct the quadratic number of arc literals so moving that part into C++ would be nice to have.

@d-krupke
Copy link
Owner Author

This here is the package I have mentioned: https://github.com/d-krupke/skbuild-conan

It contains some examples on how to do such things with CGAL. I am checking with Phillip if there is a public version of the conanfile. I could then try to give you a small example that you could continue. However, likely not to happen within the next few days but maybe in a week or two.

@d-krupke
Copy link
Owner Author

d-krupke commented Sep 3, 2024

It turns out that automatically building ortools via conan could be painfully slow. Of course, conan does cache the builds but it is not a beginner friendly solution. Will have to think about it a little more... 🤔

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new content New content to the primer.
Projects
None yet
Development

No branches or pull requests

2 participants