DOC PREVIEW
Berkeley COMPSCI 188 - CSP

This preview shows page 1-2-3-20-21-40-41-42 out of 42 pages.

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

Unformatted text preview:

CS 188: Artificial Intelligence Spring 2007AnnouncementsThe pastTodayConstraint Satisfaction ProblemsExample: Map-ColoringSlide 7Constraint GraphsExample: CryptarithmeticVarieties of CSPsVarieties of ConstraintsReal-World CSPsStandard Search FormulationSearch MethodsCSP formulation as searchBacktracking SearchSlide 17Backtracking ExampleImproving BacktrackingMinimum Remaining ValuesDegree HeuristicLeast Constraining ValueForward CheckingConstraint PropagationArc ConsistencySlide 26Summary: ConsistencyLimitations of Arc ConsistencyK-ConsistencyStrong K-ConsistencyIterative Algorithms for CSPsExample: 4-QueensPerformance of Min-ConflictsExample: Boolean SatisfiabilityExample: 3-SATCSPs: QueriesProblem StructureTree-Structured CSPsSlide 39Slide 40Nearly Tree-Structured CSPsCSP SummaryCS 188: Artificial IntelligenceSpring 2007Lecture 6: CSP2/1/2007Srini Narayanan – ICSI and UC BerkeleyMany slides over the course adapted from Dan Klein, Stuart Russell or Andrew MooreAnnouncementsAssignment 2 is up (due 2/12)Search problemsUninformed searchHeuristic search: best-first and A*Construction of heuristics Local searchThe pastTodayCSPFormulationPropagationApplicationsConstraint Satisfaction ProblemsStandard search problems:State is a “black box”: any old data structureGoal test: any function over statesSuccessors: any map from states to sets of statesConstraint satisfaction problems (CSPs):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 algorithmsExample: Map-ColoringVariables:Domain:Constraints: adjacent regions must have different colorsSolutions are assignments satisfying all constraints, e.g.:Example: Map-ColoringSolutions are complete and consistent assignments, e.g., WA = red, NT = green,Q = red,NSW = green,V = red,SA = blue,T = greenConstraint GraphsBinary CSP: each constraint relates (at most) two variables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!Example: CryptarithmeticVariables:Domains:Constraints:Varieties 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Need a constraint language, e.g., StartJob1 + 5 < StartJob3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)Varieties 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)Real-World CSPsAssignment problems: e.g., who teaches what classTimetabling problems: e.g., which class is offered when and where?Hardware configurationSpreadsheetsTransportation schedulingFactory schedulingFloorplanningMany real-world problems involve real-valued variables…Standard 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fail if no legal assignmentGoal test: the current assignment is complete and satisfies all constraintsSearch MethodsWhat does DFS do?What’s the obvious problem here?What’s the slightly-less-obvious problem?CSP formulation as search1. This is the same for all CSPs2. Every solution appears at depth n with n variables use depth-first search3. Path is irrelevant, so can also use complete-state formulation4. b = (n - l )d at depth l, hence n! · dn leavesBacktracking SearchIdea 1: Only consider a single variable at each point:Variable assignments are commutative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 pointI.e. consider only values which do not conflict previous assignmentsMight have to do some computation to figure out whether a value is okDepth-first search for CSPs with these two improvements is called backtracking searchBacktracking search is the basic uninformed algorithm for CSPsCan solve n-queens for n  25Backtracking SearchWhat are the choice points?Backtracking ExampleImproving BacktrackingGeneral-purpose ideas can give huge gains in speed:Which variable should be assigned next?In what order should its values be tried?Can we detect inevitable failure early?Can we take advantage of problem structure?Minimum Remaining ValuesMinimum remaining values (MRV):Choose the variable with the fewest legal valuesWhy min rather than max?Called most constrained variable“Fail-fast” orderingDegree HeuristicTie-breaker among MRV variablesDegree heuristic:Choose the variable with the most constraints on remaining variablesWhy most rather than fewest constraints?Least Constraining ValueGiven a choice of variable:Choose the least constraining valueThe one that rules out the fewest values in the remaining variablesNote that it may take some computation to determine this!Why least rather than most?Combining these heuristics makes 1000 queens feasibleForward CheckingIdea: Keep track of remaining legal values for unassigned variablesIdea: Terminate when any variable has no legal valuesWASANTQNSWVConstraint PropagationForward checking propagates information from assigned to unassigned


View Full Document

Berkeley COMPSCI 188 - CSP

Documents in this Course
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 CSP
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 CSP 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 CSP 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?