Constraint satisfaction search. Combinatorial optimization search.

Similar documents
Constraint satisfaction search. Combinatorial optimization search.

Constraint satisfaction search

Informed (heuristic) search (cont). Constraint-satisfaction search.

Outline. Best-first search

Finding optimal configurations 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

Lecture 6: Constraint Satisfaction Problems (CSPs)

Constraint Satisfaction

Constraint Satisfaction Problems Part 2

Constraint Satisfaction Problems

CS 771 Artificial Intelligence. Constraint Satisfaction Problem

Constraint Satisfaction Problems

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

General Methods and Search Algorithms

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

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

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

Constraint Satisfaction. AI Slides (5e) c Lin

Constraint Satisfaction Problems

Week 8: Constraint Satisfaction Problems

CONSTRAINT SATISFACTION

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

Constraint Satisfaction Problems. Chapter 6

Outline. Best-first search

Constraint Satisfaction Problems

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

Constraint Satisfaction Problems

Constraint Satisfaction Problems

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

Example: Map coloring

CS 188: Artificial Intelligence Spring Today

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

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

CS 4100/5100: Foundations of AI

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

CS 188: Artificial Intelligence Fall 2008

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

CS W4701 Artificial Intelligence

CS 188: Artificial Intelligence. Recap: Search

Local Search. (Textbook Chpt 4.8) Computer Science cpsc322, Lecture 14. May, 30, CPSC 322, Lecture 14 Slide 1

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

CONSTRAINT SATISFACTION

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

Set 5: Constraint Satisfaction Problems

CSE 473: Artificial Intelligence

CS 188: Artificial Intelligence Fall 2011

Constraint Satisfaction Problems (CSPs)

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

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

CS 188: Artificial Intelligence Spring Announcements

Set 5: Constraint Satisfaction Problems Chapter 6 R&N

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

CS 188: Artificial Intelligence Spring Announcements

Chapter 6 Constraint Satisfaction Problems

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

ARTIFICIAL INTELLIGENCE (CS 370D)

Constraint Satisfaction Problems

Foundations of Artificial Intelligence

Constraint Satisfaction Problems

Spezielle Themen der Künstlichen Intelligenz

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

CS 188: Artificial Intelligence Fall 2011

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

CS 188: Artificial Intelligence Fall 2008

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

Local Search and Optimization Chapter 4. Mausam (Based on slides of Padhraic Smyth, Stuart Russell, Rao Kambhampati, Raj Rao, Dan Weld )

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

Artificial Intelligence Constraint Satisfaction Problems

Constraint Satisfaction Problems (CSPs) Lecture 4 - Features and Constraints. CSPs as Graph searching problems. Example Domains. Dual Representations

CS 4100 // artificial intelligence

Announcements. CS 188: Artificial Intelligence Fall 2010

Set 5: Constraint Satisfaction Problems

Constraint Satisfaction Problems. Chapter 6

Backtracking and Branch-and-Bound

Map Colouring. Constraint Satisfaction. Map Colouring. Constraint Satisfaction

CONSTRAINT SATISFACTION

Announcements. CS 188: Artificial Intelligence Spring Production Scheduling. Today. Backtracking Search Review. Production Scheduling

Informed search algorithms. Chapter 4

CS 343: Artificial Intelligence

Local Search and Optimization Chapter 4. Mausam (Based on slides of Padhraic Smyth, Stuart Russell, Rao Kambhampati, Raj Rao, Dan Weld )

Constraint Satisfaction. CS 486/686: Introduction to Artificial Intelligence

Outline. Informed Search. Recall: Uninformed Search. An Idea. Heuristics Informed search techniques More on heuristics Iterative improvement

Local Search. (Textbook Chpt 4.8) Computer Science cpsc322, Lecture 14. Oct, 7, CPSC 322, Lecture 14 Slide 1

Constraint Satisfaction Problems

Last time: Problem-Solving

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

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

Constraint Satisfaction Problems

Artificial Intelligence

Artificial Intelligence

Set 5: Constraint Satisfaction Problems

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

Informed search algorithms. (Based on slides by Oren Etzioni, Stuart Russell)

4 Search Problem formulation (23 points)

Practice Final Exam 1

Local Search and Optimization Chapter 4. Mausam (Based on slides of Padhraic Smyth, Stuart Russell, Rao Kambhampati, Raj Rao, Dan Weld )

Machine Learning for Software Engineering

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

CS 188: Artificial Intelligence

mywbut.com Informed Search Strategies-II

Transcription:

S 1571 Introduction to I Lecture 8 onstraint satisfaction search. ombinatorial optimization search. Milos Hauskrecht milos@cs.pitt.edu 539 Sennott Square onstraint satisfaction problem (SP) Objective: ind a configuration satisfying goal conditions onstraint satisfaction problem (SP) is a configuration search problem where: state is defined by a set of variables and their values Goal condition is represented by a set constraints on possible variable values 1

SP example: N-queens Goal: n queens placed in non-attacking positions on the board ariables: Represent queens, one for each column: 1,, 3, alues: Row placement of each queen on the board {1,, 3, } 1, onstraints: i j i j i j wo queens not in the same row wo queens not on the same diagonal olor a map using k different colors such that no adjacent countries have the same color ariables: Represent countries,,, D, alues: K -different colors {Red, lue, Green,..} onstraints:,,, etc n example of a problem with binary constraints

Solving a SP through standard search Maximum depth of the tree: Number of variables in the SP Depth of the solution: Number of variables in the SP ranching factor: if we fix the order of variable assignments the branch factor depends on the number of their values Unassigned:,, ssigned: 1 3, Unassigned:, 3, ssigned: 1 1 Unassigned:, 3, ssigned: 1 Unassigned: ssigned:, 3, 1 Solving a SP through standard search What search algorithm to use: Depth first search!!! Since we know the depth of the solution We do not have to keep large number of nodes in queues Unassigned:,, ssigned: 1 3, Unassigned:, 3, ssigned: 1 1 Unassigned:, 3, ssigned: 1 Unassigned:, 3 ssigned:, 1 3

onstraint consistency uestion: When to check the constraints defining the goal condition? he violation of constraints can be checked: at the end (for the leaf nodes) for each node of the search tree during its generation or before its expansion hecking the constraints for intermediate nodes: More efficient: cuts branches of the search tree early onstraint consistency hecking the constraints for intermediate nodes: More efficient: cuts branches of the search tree early Unassigned:,, ssigned: 1 3, Unassigned:, 3, ssigned: 1 1 Unassigned:, 3, ssigned: 1 Unassigned:, 3 ssigned:, 1

onstraint consistency hecking the constraints for intermediate nodes: More efficient: cuts branches of the search tree early Unassigned:,, ssigned: 1 3, Unassigned:, 3, ssigned: 1 1 Unassigned:, 3, ssigned: 1 Unassigned: ssigned:, 3, 1 onstraint consistency nother way to cut the search space and tree exploration urrent variable assignments together with constraints restrict remaining legal values of unassigned variables he remaining legal and illegal values of variables may be inferred (effect of constraints propagates) Unassigned: 1,, 3, ssigned: Unassigned:, 3, ssigned: 1 1 Unassigned:, 3, ssigned: 1 Unassigned: ssigned:, 3, 1 We know that 1 5

onstraint consistency nother way to cut the search space and tree exploration urrent variable assignments together with constraints restrict remaining legal values of unassigned variables he remaining legal and illegal values of variables may be inferred (effect of constraints propagates) Unassigned: 1,, 3, ssigned: Unassigned:, 3, ssigned: 1 1 Unassigned:, 3, ssigned: 1 hen node representing Unassigned:, 1, 3 is not ssigned: even generated 1, We know that 1 onstraint propagation state (more broadly) is defined: by a set of assigned variables, their values and a list of legal and illegal assignments for unassigned variables Legal and illegal assignments can be represented: equations (value assignments) and disequations (list of invalid assignments) Red, lue Red onstraints + assignments can entail new equations and disequations Red Red onstraint propagation: the process of inferring of new equations and disequations from existing equations and disequations 6

onstraint propagation ssign =Red =Red D Red lue Green - ssignments (equations) - Invalid assignments (disequations) onstraint propagation ssign =Red Red lue Green D = =Red x - ssignments (equations) - Invalid assignments (disequations) 7

onstraint propagation ssign =lue Red lue Green D =lue =Red x onstraint propagation ssign =lue Red lue Green =? =lue =Red x x D 8

onstraint propagation ssign =Green Red lue Green =Green =lue =Red x x D onstraint propagation hree techniques for propagating the effects of past assignments and constraints: Node propagation rc consistency orward checking Difference: ompleteness of inferences ime complexity of inferences. 9

onstraint propagation 1. Node consistency. Infers: equations (valid assignments) or disequations (invalid assignments) for an individual variable by applying a unary constraint. rc consistency. Infers: disequations from the set of equations and disequations defining the partial assignment, and a constraint equations through the exhaustion of alternatives 3. orward checking. Infers: disequations from a set of equations defining the partial assignment, and a constraint quations through the exhaustion of alternatives Restricted forward checking: uses only active constraints (active constraint only one variable unassigned in the constraint) xample of ustralia territories Note: problem with binary constraints 10

xample: node consistency ssume a constraint: Green vars inferred??????? xample: node consistency ssume a constraint: Green Infer: invalid assignments from Green constraint vars inferred R R G R G R G R G R G R G 11

xample: forward checking Set: =Red vars =Red R?????? xample: forward checking Infer: invalid assignments from =Red + constraints vars =Red R G R G R G R G G R G 1

xample: forward checking Set: =Green vars =Red R G R G R G R G G R G =Green R? G???? xample: forward checking Infer: invalid assignments from =Green + constraints vars =Red R G R G R G R G G R G =Green R G R R G R G 13

xample: forward checking Infer: = xhaustions of alternatives vars =Red R G R G R G R G G R G =Green R G R R G R G Infer R G???? xample: forward checking Infer: invalid assignments from = vars =Red R G R G R G R G G R G =Green R G R R G R G Infer R G R R G! R G 1

xample: arc consistency Set: =Red Set: =Green vars =Red R G R G R G R G G R G =Green R G R R G R G xample: arc consistency {} Infer: invalid assignments from valid and invalid assignments vars =Red R G R G R G R G G R G =Green R G R R G R G {R,} 15

xample: arc consistency {} Infer: invalid assignments from valid and invalid assignments vars =Red R G R G R G R G G R G =Green R G R R G R G {R,} = =R onsistent assignment xample: arc consistency {} Infer: invalid assignments from valid and invalid assignments vars =Red R G R G R G R G G R G =Green R G R R G R G {R,} =R = onsistent assignment 16

xample: arc consistency {} Infer: invalid assignments from valid and invalid assignments vars =Red R G R G R G R G G R G =Green R G R R G R G {R,} = =! Inconsistent assignment xample: arc consistency {} Infer: invalid assignments from valid and invalid assignments vars =Red R G R G R G R G G R G =Green R G R R G R G R {R,} = =! Inconsistent assignment 17

Heuristics for SPs SP searches the space in the depth-first manner. ut we still can choose: Which variable to assign next? Which value to choose first? Heuristics Most constrained variable Which variable is likely to become a bottleneck? Least constraining value Which value gives us more flexibility later? xamples: map coloring Heuristics for SP Heuristics Most constrained variable ountry is the most constrained one (cannot use Red, Green) Least constraining value ssume we have chosen variable Red is the least constraining valid color for the future 18

inding optimal configurations Search for the optimal configuration onstrain satisfaction problem: Objective: find a configuration that satisfies all constraints Optimal configuration problem: Objective: find the best configuration he quality of a configuration: is defined by some quality measure that reflects our preference towards each configuration (or state) Our goal: optimize the configuration according to the quality measure also referred to as objective function 19

Search for the optimal configuration Optimal configuration search: onfigurations are described in terms of variables and their values ach configuration has a quality measure Goal: find the configuration with the best value If the space of configurations we search among is Discrete or finite then it is a combinatorial optimization problem ontinuous then it is a parametric optimization problem xample: raveling salesman problem Problem: graph with distances tour a path that visits every city once and returns to the start e.g. D D Goal: find the shortest tour 0

xample: N queens SP problem Is it possible to formulate the problem as an optimal configuration search problem? xample: N queens SP problem Is it possible to formulate the problem as an optimal configuration search problem? Yes. he quality of a configuration in a SP can be measured by the number of violated constraints Solving: minimize the number of constraint violations # of violations =3 # of violations =1 # of violations =0 1

Iterative optimization methods Searching systematically for the best configuration with the DS may not be the best solution Worst case running time: xponential in the number of variables Solutions to large optimal configuration problems are often found using iterative optimization methods Methods: Hill climbing Simulated nnealing Genetic algorithms Properties: Iterative optimization methods Search the space of complete configurations ake advantage of local moves Operators make local changes to complete configurations Keep track of just one state (the current state) no memory of past states!!! No search tree is necessary!!!

xample: N-queens Local operators for generating the next state: Select a variable (a queen) Reallocate its position xample: raveling salesman problem Local operator for generating the next state: divide the existing tour into two parts, reconnect the two parts in the opposite order xample: D D 3

xample: raveling salesman problem Local operator for generating the next state: divide the existing tour into two parts, reconnect the two parts in the opposite order xample: D D Part 1 D Part D xample: raveling salesman problem Local operator: generates the next configuration (state) by rearranging the existing tour D D D D D

Searching the configuration space Search algorithms keep only one configuration (the current configuration) D D Problem: How to decide about which operator to apply?? D Search algorithms Strategies to choose the configuration (state) to be visited next: Hill climbing Simulated annealing Later: xtensions to multiple current states: Genetic algorithms Note: Maximization is inverse of the minimization min f ( X ) max f ( X ) 5