L10: Solving Motivation Flashcards
What are the 2 components of constraint solving?
- Systematic search through an assignment of variables. Extend an assignment to a subset of the variables incrementally. Backtrack if establish that current partial assignment cannot be extended to a solution.
- Constraint propagation. Deduction based on constraints, current domains. Usually recorded as reductions in domains. After many steps of propagation, each variable domain contains only one value.
Is it better to write your own solver?
Speed: while the solver may be specialised to the problem, it is probably not clever enough at exploring the search space.
Simplicity: it is not easy to maintain and document as there is much more code than using a generic solver (e.g. minion)
However, this is not always the case, and some specialised solvers are better than generic solvers (however this requires a lot of effort).
Why should we use generic solvers?
Easier to use
- Fewer lines of code
- Easier to maintain
Better to use
- Get strong, efficient constraint reasoning with no effort on your part
- However, with lots of effort and knowledge, it is technically possible to beat a generic solver.
What steps would an efficient Sudoku solver take?
- Update sets of values for each cell
- Restore to previous state when search backtracks
- Check for empty sets – no point continuing search
What is the advantage of specifying a problem declaratively to a constraint solver?
Much stronger constraint reasoning. It is able to propagate decisions by looking at the implications of an assignment.