CONSTRAINT SATISFACTION

Similar documents
CONSTRAINT SATISFACTION

CONSTRAINT SATISFACTION

Example: Map-Coloring. Constraint Satisfaction Problems Western Australia. Example: Map-Coloring contd. Outline. Constraint graph

Outline. Best-first search

Outline. Best-first search

What is Search For? CS 188: Artificial Intelligence. Constraint Satisfaction Problems

Lecture 18. Questions? Monday, February 20 CS 430 Artificial Intelligence - Lecture 18 1

CS 343: Artificial Intelligence

Australia Western Australia Western Territory Northern Territory Northern Australia South Australia South Tasmania Queensland Tasmania Victoria

Constraint Satisfaction Problems

Announcements. Homework 1: Search. Project 1: Search. Midterm date and time has been set:

Constraint Satisfaction Problems

Artificial Intelligence Constraint Satisfaction Problems

Constraint Satisfaction Problems

Foundations of Artificial Intelligence

Announcements. Homework 4. Project 3. Due tonight at 11:59pm. Due 3/8 at 4:00pm

Today. Introduction to Artificial Intelligence COMP 3501 / COMP Lecture 5. Constraint Satisfaction Problems (CSP) CSP Definition

Constraint Satisfaction Problems. Chapter 6

CS 188: Artificial Intelligence. What is Search For? Constraint Satisfaction Problems. Constraint Satisfaction Problems

10/11/2017. Constraint Satisfaction Problems II. Review: CSP Representations. Heuristic 1: Most constrained variable

CSE 473: Artificial Intelligence

CS 188: Artificial Intelligence Fall 2011

Constraint Satisfaction

Chapter 6 Constraint Satisfaction Problems

Constraint Satisfaction Problems

Constraint Satisfaction Problems

Constraint Satisfaction Problems Part 2

Constraint Satisfaction. AI Slides (5e) c Lin

Announcements. Reminder: CSPs. Today. Example: N-Queens. Example: Map-Coloring. Introduction to Artificial Intelligence

Announcements. CS 188: Artificial Intelligence Spring Today. Example: Map-Coloring. Example: Cryptarithmetic.

Constraints. CSC 411: AI Fall NC State University 1 / 53. Constraints

Constraint Satisfaction Problems. Chapter 6

Announcements. CS 188: Artificial Intelligence Fall 2010

Constraint Satisfaction Problems

Week 8: Constraint Satisfaction Problems

What is Search For? CSE 473: Artificial Intelligence. Example: N-Queens. Example: N-Queens. Example: Map-Coloring 4/7/17

Constraint Satisfaction Problems

Space of Search Strategies. CSE 573: Artificial Intelligence. Constraint Satisfaction. Recap: Search Problem. Example: Map-Coloring 11/30/2012

CS 4100 // artificial intelligence

What is Search For? CS 188: Artificial Intelligence. Example: Map Coloring. Example: N-Queens. Example: N-Queens. Constraint Satisfaction Problems

Lecture 6: Constraint Satisfaction Problems (CSPs)

Artificial Intelligence

Artificial Intelligence

Constraint Satisfaction Problems

CS 188: Artificial Intelligence Fall 2011

CS 188: Artificial Intelligence. Recap: Search

Lars Schmidt-Thieme, Information Systems and Machine Learning Lab (ISMLL), University of Hildesheim, Germany, Course on Artificial Intelligence,

Constraint Satisfaction Problems

Constraint Satisfaction Problems

CS 4100/5100: Foundations of AI

DIT411/TIN175, Artificial Intelligence. Peter Ljunglöf. 30 January, 2018

28.1 Decomposition Methods

Constraint Satisfaction Problems. slides from: Padhraic Smyth, Bryan Low, S. Russell and P. Norvig, Jean-Claude Latombe

CS 771 Artificial Intelligence. Constraint Satisfaction Problem

Constraint Satisfaction Problems. A Quick Overview (based on AIMA book slides)

Artificial Intelligence

Constraint Satisfaction Problems (CSPs)

Iterative improvement algorithms. Today. Example: Travelling Salesperson Problem. Example: n-queens

Constraint satisfaction search. Combinatorial optimization search.

Moving to a different formalism... SEND + MORE MONEY

What is Search For? CS 188: Ar)ficial Intelligence. Constraint Sa)sfac)on Problems Sep 14, 2015

CS W4701 Artificial Intelligence

Constraint Satisfaction Problems

Admin. Quick search recap. Constraint Satisfaction Problems (CSPs)! Intro Example: 8-Queens. Where should I put the queens in columns 3 and 4?

CS 188: Artificial Intelligence Fall 2008

Announcements. CS 188: Artificial Intelligence Fall Large Scale: Problems with A* What is Search For? Example: N-Queens

Recap: Search Problem. CSE 473: Artificial Intelligence. Space of Search Strategies. Constraint Satisfaction. Example: N-Queens 4/9/2012

Constraint satisfaction search

Constraint Satisfaction Problems

CS 188: Artificial Intelligence Spring Announcements

Solving Problems by Searching: Constraint Satisfaction Problems

Example: Map coloring

ARTIFICIAL INTELLIGENCE (CS 370D)

Comments about assign 1. Quick search recap. Constraint Satisfaction Problems (CSPs) Search uninformed BFS, DFS, IDS. Adversarial search

Constraint Satisfaction Problems Chapter 3, Section 7 and Chapter 4, Section 4.4 AIMA Slides cstuart Russell and Peter Norvig, 1998 Chapter 3, Section

Announcements. CS 188: Artificial Intelligence Spring Today. A* Review. Consistency. A* Graph Search Gone Wrong

DIT411/TIN175, Artificial Intelligence. Peter Ljunglöf. 6 February, 2018

Map Colouring. Constraint Satisfaction. Map Colouring. Constraint Satisfaction

Material. Thought Question. Outline For Today. Example: Map-Coloring EE562 ARTIFICIAL INTELLIGENCE FOR ENGINEERS

Announcements. CS 188: Artificial Intelligence Fall Reminder: CSPs. Today. Example: 3-SAT. Example: Boolean Satisfiability.

CS 188: Artificial Intelligence Fall 2008

Constraint Satisfaction Problems

Mathematical Programming Formulations, Constraint Programming

Set 5: Constraint Satisfaction Problems

CS 188: Artificial Intelligence

Today. CS 188: Artificial Intelligence Fall Example: Boolean Satisfiability. Reminder: CSPs. Example: 3-SAT. CSPs: Queries.

Reading: Chapter 6 (3 rd ed.); Chapter 5 (2 nd ed.) For next week: Thursday: Chapter 8

Set 5: Constraint Satisfaction Problems Chapter 6 R&N

Foundations of Artificial Intelligence

Games and Adversarial Search II Alpha-Beta Pruning (AIMA 5.3)

CS 188: Artificial Intelligence

CS 188: Artificial Intelligence

Set 5: Constraint Satisfaction Problems

CS 188: Artificial Intelligence Spring Today

CS 188: Artificial Intelligence Spring Announcements

Constraint Satisfaction Problems (CSPs) Introduction and Backtracking Search

Constraint Satisfaction Problems (CSP) (Where we postpone making difficult

1. (15 points) Consider the crossword puzzle

Constraint Satisfaction Problems

CMU-Q Lecture 7: Searching in solution space Constraint Satisfaction Problems (CSPs) Teacher: Gianni A. Di Caro

Transcription:

CONSRAI ISFACION oday Constraint satisfaction problems (CSPs) ypes of CSPs Inference Search 1

8-queens problem Exploit the constraints Constraint Satisfaction Problems Advantages of CSPs Use general-purpose heuristics rather than problemspecific information Use constraints to eliminate parts of search space Detect failure early We know why we failed 2

CSPs Defined Example: 8-queens problems X ariables: one for each queen {X 1,, X 8 } Domain: indicates row D = {1,2,,8} Constraints: X i = k =) X j 6= k 8i 6= j X i = k i,x j = k j =) i j 6= k i k j 3

Example: Map coloring ariables: {,,,,,, } Domains: {red, blue, green} Constraints: adjacent regions have different colors Implicit:,,,, Explicit: (,) 2 {(red,green), (red,blue), } Western Northern erritory ueensland New Wales ictoria asmania More examples Puzzles sudoku, cryptarithmetic Real-world applications Assignment problems, e.g. who teaches what class? imetable problems, e.g. which class offered when? where? Circuit layout Workout routine app (final project) Assigning first-years to rooms (final project) 4

ypes of constraints Unary constraints involve a single variable e.g. green Binary constraints involve pairs of variables A binary CSP can be illustrated using a constraint graph Higher-order constraints e.g. A, B, and C cannot be in the same grouping e.g. AllDiff (all variables must be assigned different values) Preference constraints costs on individual variable assignments Constraint Graph Useful for binary constraint CSPs where each constraint relates (at most) two variables Nodes correspond to variables Edges (arcs) link two variables that participate in a constraint Use graph to speed up search Western Northern erritory ueensland New Wales ictoria asmania 5

Approach 1: Inference Use the constraints to reduce the number of legal values for a variable Possibly find a solution without searching Node consistency n A node is node-consistent if all values in its domain satisfy the unary constraints Arc consistency n A node X i is arc-consistent w.r.t. node X j if for every value in D i there exists a value in D j that satisfies the binary constraint n Algorithm AC-3 Other types of consistency (path consistency, k-consistency, global constraints) AC-3 algorithm for Arc consistency 6

Backtracking Search {} =red =green =blue =red =green =red =blue =red =green =red =red =green =blue Western Northern erritory ueensland New Wales ictoria asmania Backtracking Search Algorithm 7

Improving Backtracking search Idea 1: Intelligent ordering Which variable X should be assigned a value next? In which order should its domain D be sorted? Idea 2: Incorporating inference Forward checking AC-3 Idea 3: Exploiting structure Can we exploit the problem structure? Idea 1: Intelligent Ordering Which variable should we choose? ueensland nia New Wales ictoria 8

Idea 1: Intelligent Ordering ariable ordering Minimum-remaining values heuristic - Choose the variable with the fewest legal moves remaining Degree heuristic - Choose variable involved in the largest number of constraints with remaining unassigned variables alue ordering Least-constraining value heuristic - Choose the value that rules out the fewest choices for the neighboring variables Idea 2: Incorporating Inference Forward checking After an assignment X = x, ensure all arcs of the form (Y,X) are arc consistent Run AC-3 algorithm Ensure all arcs are arc consistent Run path-consistency or k-consistency algorithm 9

Example Run Backtracking on graph coloring Use fixed ordering of variables Use forward checking for inference Western Northern erritory ueensland New Wales ictoria asmania Limitations of Forward Checking 10

Limitations of Forward Checking Using AC-3 instead of forward checking Idea 3: Exploit Structure Independent subproblems Find connected components of the constraint graph If we split n variables into sub-problems of c variables each then: O(d n ) O(d c n/c) asmania is independent of the mainland 11

Idea 3: Exploit Structure ree structured constraint graphs Can solve in linear time using AC-3 A E B D A B C D E F C (a) F (b) Idea 3: Exploit Structure Reduction to a tree structured graph Cycle cutset a subset of the variables whose removal creates a tree. ree decomposition Divide graph into subproblems, solve independently merge the solutions 12

CSP Summary Constraint Satisfaction Problems (CSPs) Solving CSPs using inference Solving CSPs using search Backtracking algorithm = DSF + fixed ordering + constraints checking General (not problem-specific) heuristics Improving Backtracking Intelligent ordering Incorporating inference Exploiting structure 13