Sep 08, 2003 ------------- - a new type of search: constraint satisfaction search - map-coloring - cryptarithmetic problems - 4-queens - (All) CSPs have - Variables - Domains - Constraints - can summarize in the form of constraint graph - Whats the big deal? - goal test is not a black box - goal test can be decomposed - A really dumb algorithm for solving CSPs - Generate-and-test for 4-queens - is dumb because - order of assignment doesn't matter - once violated, nothing can unviolate a constraint - doesn't use goal test effectively - Better approach: backtracking - its really DFS - fixes some ordering and backtracks when constraints violated - Problems with DFS - "thrashing" - search fails in different portions of the search space for the same reason - More sophisticated viewpoint - MAC (maintaining arc consistency) - Defn: (V_i, V_j) is arc-consistent if for every value of V_i, there is an acceptable value of V_j - Examples of constraint graphs - that are arc consistent, and - that are not arc consistent - MAC - remove violating values from domains - keep propagating (why?) - originally satisfied constraints might suddenly get violated - Arc consistency is sometimes useful - If all domains become 1, then you can "read off" the answer! - i.e., no backtracking in search is needed - In general - MAC might still require more search - Complexity of MAC - O(ed^2) where - e: number of edges in graph - d: size of domain = |D| - your book uses n^2 instead of e - but its the same thing - Different examples of constraint graphs and their relationship to MAC