2.1.0: string constraints and parallel solver #92
fjwillemsen
announced in
Announcements
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
This release provides two exciting improvements: string constraints and a parallel solver!
Introducing string constraints, a new interface for addConstraint where users can simply write their constraint(s) as a list of Python-evaluable strings. Writing constraints in the new string format is preferable over functions and lambdas. These strings, even as compound statements, are automatically parsed to faster built-in constraints, are more concise, and do not require constraint solving familiarity by the user to be efficient.
For example,
problem.addConstraint(["50 <= x * y < 100"])
is parsed to[MinProdConstraint(50, ["x", "y"]), MaxProdConstraint(100, ["x", "y"])]
.This feature is in beta and subject to possible change, please provide feedback.
The new Parallel Solver is a solver that is able to parallelize solving for all solutions over the largest domain in both ProcessPool and ThreadPool mode. In ProcessPool mode, string constraints must be used instead of functions or lambdas, as these can't be pickled. This Parallel Solver is currently experimental and unlikely to provide an actual speedup - it is recommended to use the default OptimizedBacktrackingSolver for now.
In addition, Python 3.13 and 3.14 support has been added and dependencies updated.
For more details, see #91.
Full Changelog: 2.0.3...2.1.0
This discussion was created from the release 2.1.0: string constraints and parallel solver.
Beta Was this translation helpful? Give feedback.
All reactions