hw1 * more of thinking questions, since will have project0 for coding pretty soon project0 * put up, start working on next week students helping with the course material? sudoku... * My solver, I basically did what they were talking about for CSP's, which is today's topic, so ... Outline for today... * Local search - there are interesting things to say, they can be quite good, but I'm not going to say much more about them now. Maybe on hw1. * Main topic today - CSP's and solving methods. CSP * variables (vertices), possible values for variables, constraints/rules. * types of constraints/rules? (not equal, <=, in range, ...) + can convert different kinds, simplify them. + for example, in Sudoku can simplify row rule into series of rules on pairs... + could also have preference constraints - e.g., class scheduling, job scheduling, ... Examples of CSP problems. * Sudoku - had that on the board last time. * SAT * 8-puzzle * Others? Constraint propagation * pick a value for one of the variables, look at how that reduces the choices for other variables - go through the whole graph + node consistency - none of the choices at that node violate any of the constraints. + arc consistency - for pair of nodes with constraint between them, for each choice of one there is a choice of the other that is legal. + path consistency, k-consistency - check more than two nodes at a time. * example - sudoku small example. Backtracking search * Basically doing DFS but with constraint propagation * choices - which variable to try assigning first (minimum remaining values), and which order to try the values. * doing the constraint propagation after each assigned variable - called forward checking. Other observations... * Local search - yep, could do that for CSP's to. * Sub-cases that are easier to solve, by looking at what the CSP graph looks like. + disconnected components of the graph can be solved separately (that could lead to huge saving over just blindly doing backtracking search on the whole graph - see why?) + trees are easy to solve - do topological sort to get directed-arc consistent, then ... - so another approach for other graphs is to try and make it into a graph * by setting a small number of variables, or * by decomposing into multiple trees.