简体   繁体   中英

Does the Choco-Solver Java library support Parallel Programming?

My constraint problem has become too complex, and I'm looking to know if the Choco-Solver framework which I'm using to model and solve the problem supports a parallel programming approach like multi-threading.

Originally, I thought this would happen by default, but checking the CPU usage percentage when running top -i shows it consistently around 100%, so I assume parallelization is not occurring.

I know about the ParallelPortfolio class in Choco, but it's not what I'm looking for since I have implemented a custom search strategy and it's that one that I want to use multi-threading on.

There are roughly 3 ways for parallel programming in constraint programming.

  1. Paralleling the propagation of the constraints: the constraints to be propagated are distributed among CPUs/cores. In that case, the main bottleneck comes from variables' domain synchronisation. You also need to find a relevant way to distribute constraints propagation among cores. This is an approach that was studied with Choco-solver without much success, the approach was abandoned.
  2. Paralleling the search space exploration: the search space is divided into subspaces, a CPU/core is in charge of exploring it. In that case, the main issue is related to the capacity to replicate a (sub-)model. The way Choco-solver manages backtracks is based on trailing (as opposed to copying), so not directly adapted to duplication. This could possibly be done using a serialization framework.
  3. Paralleling the search space (2): each CPU/core is responsible of a model and defines a specific search strategy. In that case, the copy issue is delegated to the user (since it is purely a Java problem) and models (actually solvers) starts a race where each time a solution is found, the information is shared between the models. This is the principle of the ParallelPortfolio in Choco-solver.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM