DOC PREVIEW
Berkeley COMPSCI 188 - Lecture 4, Constraint Satisfaction

This preview shows page 1-2-3-24-25-26-27-48-49-50 out of 50 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 50 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 50 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 50 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 50 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 50 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 50 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 50 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 50 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 50 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 50 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 50 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

CS 188: Artificial Intelligence Fall 2009AnnouncementsTodayA* ReviewA* Graph Search Gone WrongConsistencyMazeworld Demo!What is Search For?Constraint Satisfaction ProblemsExample: N-QueensSlide 13Example: Map-ColoringConstraint GraphsExample: CryptarithmeticExample: SudokuExample: The Waltz AlgorithmVarieties of CSPsVarieties of ConstraintsReal-World CSPsStandard Search FormulationSearch MethodsBacktracking SearchSlide 28Backtracking ExampleImproving BacktrackingMinimum Remaining ValuesDegree HeuristicLeast Constraining ValueForward CheckingConstraint PropagationArc ConsistencySlide 37Limitations of Arc ConsistencyDemo: Backtracking + ACSlide 40Problem StructureTree-Structured CSPsSlide 43Nearly Tree-Structured CSPsIterative Algorithms for CSPsExample: 4-QueensPerformance of Min-ConflictsSummaryLocal Search MethodsTypes of ProblemsHill ClimbingHill Climbing DiagramSimulated AnnealingSlide 54Beam SearchCS 188: Artificial IntelligenceFall 2009Lecture 4: Constraint Satisfaction9/8/2009Dan Klein – UC BerkeleyMultiple slides adapted from Stuart Russell or Andrew MooreAnnouncementsProject 1: Search is due MondayFind partners at end of lecture, in frontWritten 1: Search and CSPs out soonNewsgroup: check it outTodaySearch ConclusionConstraint Satisfaction ProblemsA* ReviewA* uses both backward costs g and forward estimate h: f(n) = g(n) + h(n)A* tree search is optimal with admissible heuristics (optimistic future cost estimates)Heuristic design is key: relaxed problems can helpA* Graph Search Gone WrongSABCG11123h=2h=1h=4h=1h=0S (0+2)A (1+4) B (1+1)C (2+1)G (5+0)C (3+1)G (6+0)SABCGState space graphSearch treeConsistency3ACGh=4h=11The story on Consistency:• Definition: cost(A to C) + h(C) ≥ h(A)• Consequence in search tree: Two nodes along a path: NA, NC g(NC) = g(NA) + cost(A to C) g(NC) + h(C) ≥ g(NA) + h(A)• The f value along a path never decreases• Non-decreasing f means you’re optimal to every state (not just goals)Mazeworld Demo!What is Search For?Models of the world: single agents, deterministic actions, fully observed state, discrete state spacePlanning: sequences of actionsThe path to the goal is the important thingPaths have various costs, depthsHeuristics to guide, fringe to keep backupsIdentification: assignments to variablesThe goal itself is important, not the pathAll paths at the same depth (for some formulations)CSPs are specialized for identification problems9Constraint Satisfaction ProblemsStandard search problems:State is a “black box”: arbitrary data structureGoal test: any function over statesSuccessor function can be anythingConstraint satisfaction problems (CSPs):A special subset of search problemsState is defined by variables Xi with values from a domain D (sometimes D depends on i)Goal test is a set of constraints specifying allowable combinations of values for subsets of variablesSimple example of a formal representation languageAllows useful general-purpose algorithms with more power than standard search algorithms10Example: N-QueensFormulation 1:Variables:Domains:Constraints11Example: N-QueensFormulation 2:Variables:Domains:Constraints:Implicit:Explicit:-or-Example: Map-ColoringVariables:Domain:Constraints: adjacent regions must have different colorsSolutions are assignments satisfying all constraints, e.g.: 14Constraint GraphsBinary CSP: each constraint relates (at most) two variablesBinary constraint graph: nodes are variables, arcs show constraintsGeneral-purpose CSP algorithms use the graph structure to speed up search. E.g., Tasmania is an independent subproblem!15Example: CryptarithmeticVariables (circles):Domains:Constraints (boxes):16Example: SudokuVariables:Each (open) squareDomains:{1,2,…,9}Constraints:9-way alldiff for each row9-way alldiff for each column9-way alldiff for each regionExample: The Waltz AlgorithmThe Waltz algorithm is for interpreting line drawings of solid polyhedraAn early example of a computation posed as a CSP Look at all intersectionsAdjacent intersections impose constraints on each other?18Varieties of CSPsDiscrete VariablesFinite domainsSize d means O(dn) complete assignmentsE.g., Boolean CSPs, including Boolean satisfiability (NP-complete)Infinite domains (integers, strings, etc.)E.g., job scheduling, variables are start/end times for each jobLinear constraints solvable, nonlinear undecidableContinuous variablesE.g., start/end times for Hubble Telescope observationsLinear constraints solvable in polynomial time by LP methods (see cs170 for a bit of this theory)21Varieties of ConstraintsVarieties of ConstraintsUnary constraints involve a single variable (equiv. to shrinking domains):Binary constraints involve pairs of variables:Higher-order constraints involve 3 or more variables: e.g., cryptarithmetic column constraintsPreferences (soft constraints):E.g., red is better than greenOften representable by a cost for each variable assignmentGives constrained optimization problems(We’ll ignore these until we get to Bayes’ nets) 22Real-World CSPsAssignment problems: e.g., who teaches what classTimetabling problems: e.g., which class is offered when and where?Hardware configurationTransportation schedulingFactory schedulingFloorplanningFault diagnosis… lots more!Many real-world problems involve real-valued variables…23Standard Search FormulationStandard search formulation of CSPs (incremental)Let's start with the straightforward, dumb approach, then fix itStates are defined by the values assigned so farInitial state: the empty assignment, {}Successor function: assign a value to an unassigned variableGoal test: the current assignment is complete and satisfies all constraintsSimplest CSP ever: two bits, constrained to be equal 24Search MethodsWhat does BFS do?What does DFS do?[demo]What’s the obvious problem here?What’s the slightly-less-obvious problem?25Backtracking SearchIdea 1: Only consider a single variable at each pointVariable assignments are commutative, so fix orderingI.e., [WA = red then NT = green] same as [NT = green then WA = red]Only need to consider assignments to a single variable at each stepHow many leaves are there?Idea 2: Only allow legal assignments at each


View Full Document

Berkeley COMPSCI 188 - Lecture 4, Constraint Satisfaction

Documents in this Course
CSP

CSP

42 pages

Metrics

Metrics

4 pages

HMMs II

HMMs II

19 pages

NLP

NLP

23 pages

Midterm

Midterm

9 pages

Agents

Agents

8 pages

Lecture 4

Lecture 4

53 pages

CSPs

CSPs

16 pages

Midterm

Midterm

6 pages

MDPs

MDPs

20 pages

mdps

mdps

2 pages

Games II

Games II

18 pages

Load more
Download Lecture 4, Constraint Satisfaction
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 Lecture 4, Constraint Satisfaction 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 Lecture 4, Constraint Satisfaction 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?