Skip to content

Non-incremental solve function in solver interface #968

Description

@IgnaceBleukx

As posted by Jo in another issue, for some solvers (e.g., Exact), there are more efficient API calls to use when "just solving" a CSP.

A separate issue to note: self.xct_solver.toOptimum in def solve(...) in exact.py is slower than self.xct_solver.runFull(true). The latter is allowed to add bound constraints. You really want to run the latter for regular optimization runs (e.g., competitions etc.).

Originally posted by @JoD in #896

We currently use the slow version, which does not post bound-constraints, as we allow to the use to change the objective later on, but that of course is only useful in a handful of usecases.

Maybe we can add a flag "incremental" or something to the constructor of the exact solver interface, which determines the solver-API call to use.
When initializing the solver from a cpmpy.Model class, this will always be set to False (somewhat similar to what we do with solveAll and the call_from_model argument)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions