2

In Choco Solver, how do you obtain the closest solution (a solution that satisfies the most constraints so far, but may not satisfy all constraints) in the case where finding a solution may take too long?

For example, if I am in the middle of running Model.getSolver().solve() for a solution, and I have decided that it is taken long enough despite finding no solution, how can I output the closest solution so far?

1 Answers1

0

It seems I didn't read the question well the first time.

You can change your model to turn hard constraints into soft constraints which means you turn your satisfaction problem into an optimization problem You can use constraint reification for that.