DOC PREVIEW
UMBC CMSC 671 - NOTES

This preview shows page 1-2-3-25-26-27 out of 27 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 27 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 27 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 27 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 27 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 27 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 27 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 27 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

CMSC 671 Fall 2001Today’s classConstraint ProcessingOverviewInformal Definition of CSPInformal Example: Map ColoringSlide 7Example: SATisfiabilityReal-world problemsFormal definition of a constraint network (CN)Formal definition of a CN (cont.)Typical Tasks for CSPBinary CSPExample: Crossword PuzzleRunning Example: XWORD PuzzleSlide 16Solving Constraint ProblemsGenerate and test: XWORDSystematic search: Backtracking (a.k.a. depth-first search)Backtracking: XWORDProblems with backtrackingConsistencyConstraint propagation: XWORD exampleK-consistencySlide 25Why do we care?Improving Backtracking1CMSC 671CMSC 671Fall 2001Fall 2001Class #6-7 – Thursday, September 20 / Tuesday, September 252Today’s class•Constraint Processing / Constraint Satisfaction Problem (CSP) paradigm•Algorithms for CSPs–Backtracking (systematic search)–Constraint propagation (k-consistency)–Variable ordering heuristics–Backjumping and dependency-directed backtracking•Viewing scheduling as a CSP3Constraint Constraint ProcessingProcessingRussell & Norvig 3.7, 4.2 end, 4.4 endKumar, “Algorithms for constraint satisfaction problems: A survey”Barták, “Constraint programming: In pursuit of the holy grail”4Overview•Constraint Processing offers a powerful problem-solving paradigm–View a problem as a set of variables to which we have to assign values that satisfy a number of problem-specific constraints.–Constraint programming, CSPs, constraint logic programming…•Algorithms for CSPs–Backtracking (systematic search)–Constraint propagation (k-consistency)–Variable ordering heuristics–Backjumping and dependency-directed backtracking5Informal Definition of CSP•CSP = Constraint Satisfaction Problem•Given(1) a finite set of variables(2) each with a domain of possible values (often finite)(3) a set of constraints that limit the values the variables can take on•A solution is an assignment of a value to each variable such that the constraints are all satisfied.•Tasks might be to decide if a solution exists, to find a solution, to find all solutions, or to find the “best solution” according to some metric.6Informal Example: Map Coloring•Color the following map using three colors (red, green, blue) such that no two adjacent regions have the same color.ED ACB7Informal Example: Map Coloring•Variables: A, B, C, D, E all of domain RGB•Domains: RGB = {red, green, blue}•Constraints: AB, AC,A  E, A  D, B  C, C  D, D  E•One solution: A=red, B=green, C=blue, D=green, E=blueED ACBED ACB=>8Example: SATisfiability•Given a set of propositions containing variables, find an assignment of the variables to {false,true} that satisfies them.•Example, the clauses:–A or B or ~C, ~A or D–(equivalent to C -> A or B, D -> A)•Are satisfied byA = falseB = trueC = falseD = false9Real-world problems•Scheduling•Temporal reasoning•Building design•Planning•Optimization/satisfaction•Vision•Graph layout•Network management•Natural language processing•Molecular biology / genomics•VLSI design10Formal definition of a constraint network (CN)A constraint network (CN) consists of•a set of variables X = {x1, x2, … xn} –each with an associated domain of values {d1, d2, … dn}. –The domains are typically finite•a set of constraints {c1, c2 … cm} where –each constraint defines a predicate which is a relation over a particular subset of X. –E.g., Ci involves variables {Xi1, Xi2, … Xik} and defines the relation Ri  Di1 x Di2 x … Dik•Unary constraint: only involves one variable•Binary constraint: only involves two variables11Formal definition of a CN (cont.)•Instantiations–An instantiation of a subset of variables S is an assignment of a legal domain value to each variable in in S–An instantiation is legal iff it does not violate any (relevant) constraints.•A solution is an instantiation of all of the variables in the network.12Typical Tasks for CSP•Solutions:–Does a solution exist?–Find one solution–Find all solutions–Given a partial instantiation, do any of the above•Transform the CN into an equivalent CN that is easier to solve.13Binary CSP•A binary CSP is a CSP in which all of the constraints are binary or unary.•Any non-binary CSP can be converted into a binary CSP by introducing additional variables.•A binary CSP can be represented as a constraint graph, which has a node for each variable and an arc between two nodes if and only there is a constraint involving the two variables.–Unary constraint appears as self-referential arc14Example: Crossword Puzzle1 2 34515Running Example: XWORD Puzzle•Variables and their domains–X1 is 1 across D1 is 5-letter words–X2 is 2 down D2 is 4-letter words–X3 is 3 down D3 is 3-letter words–X4 is 4 across D4 is 4-letter words–X5 is 5 across D5 is 2-letter words•Constraints (implicit/intensional)–C12 is “the 3rd letter of X1 must equal the 1st letter of X2”–C13 is “the 5th letter of X1 must equal the 1st letter of X3”.–C24 is …–C25 is …–C34 is ...161 2 345Variables: X1X2X3X4X5Domains:D1 = {hoses, laser, sheet, snail,steer}D2 = {hike, aron, keet, earn, same}D3 = {run, sun, let, yes, eat, ten}D4 = {hike, aron, keet, earn, same}D5 = {no, be, us, it}Constraints (explicit/extensional):C12 = {(hoses,same), (laser,same), (sheet,earn), (steer,earn)}C13 = ...X1X4X5X2X317Solving Constraint Problems•Systematic search–Generate and test–Backtracking•Constraint propagation (consistency)•Variable ordering heuristics•Backjumping and dependency-directed backtracking18Generate and test: XWORD•Try each possible combination until you find one that works:–Hoses – hike – run – hike – no–Hoses – hike – run – hike – be–Hoses – hike – run – hike – us•Doesn’t check constraints until all variables have been instantiated•Very inefficient way to explore the space of possibilities19Systematic search: Backtracking(a.k.a. depth-first search)•Consider the variables in some order•Pick an unassigned variable and give it a provisional value such that it is consistent with all of the constraints•If no such assignment can be made, we’ve reached a dead end and need to backtrack to the previous variable•Continue this process until a solution is found or we backtrack to the initial variable and have exhausted all possible vlaues20Backtracking: XWORD12345X1=hoses


View Full Document

UMBC CMSC 671 - NOTES

Download NOTES
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view NOTES and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view NOTES 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?