Constraint Propagation Artificial Intelligence CMSC 25000 January 22, 2002.

Slides:



Advertisements
Similar presentations
Constraint Satisfaction Problems
Advertisements

Constraint Satisfaction Problems Russell and Norvig: Chapter
Local Search Jim Little UBC CS 322 – CSP October 3, 2014 Textbook §4.8
Constraint Satisfaction Problems (Chapter 6). What is search for? Assumptions: single agent, deterministic, fully observable, discrete environment Search.
Constraint Satisfaction Problems
1 Constraint Satisfaction Problems A Quick Overview (based on AIMA book slides)
1 Constraint Satisfaction Problems. 2 Intro Example: 8-Queens Generate-and-test: 8 8 combinations.
1 Finite Constraint Domains. 2 u Constraint satisfaction problems (CSP) u A backtracking solver u Node and arc consistency u Bounds consistency u Generalized.
ICS-271:Notes 5: 1 Lecture 5: Constraint Satisfaction Problems ICS 271 Fall 2008.
Artificial Intelligence Constraint satisfaction problems Fall 2008 professor: Luigi Ceccaroni.
Constraint Satisfaction problems (CSP)
Review: Constraint Satisfaction Problems How is a CSP defined? How do we solve CSPs?
4 Feb 2004CS Constraint Satisfaction1 Constraint Satisfaction Problems Chapter 5 Section 1 – 3.
Artificial Intelligence Constraint satisfaction Chapter 5, AIMA.
Ryan Kinworthy 2/26/20031 Chapter 7- Local Search part 1 Ryan Kinworthy CSCE Advanced Constraint Processing.
Constraint Satisfaction Problems
Constraint Satisfaction
University College Cork (Ireland) Department of Civil and Environmental Engineering Course: Engineering Artificial Intelligence Dr. Radu Marinescu Lecture.
Constraint Satisfaction Problems Russell and Norvig: Chapter 3, Section 3.7 Chapter 4, Pages Slides adapted from: robotics.stanford.edu/~latombe/cs121/2003/home.htm.
Searching by Constraint & Searching by Evolution CSPP Artificial Intelligence January 21, 2004.
Chapter 5 Outline Formal definition of CSP CSP Examples
Constraint Satisfaction Problems
Constraint Satisfaction Problems
Constraint Satisfaction Problems
ISC 4322/6300 – GAM 4322 Artificial Intelligence Lecture 4 Constraint Satisfaction Problems Instructor: Alireza Tavakkoli September 17, 2009 University.
1 Constraint Satisfaction Problems Slides by Prof WELLING.
CPS 270: Artificial Intelligence More search: When the path to the solution doesn’t matter Instructor: Vincent.
CS 484 – Artificial Intelligence1 Announcements Homework 2 due today Lab 1 due Thursday, 9/20 Homework 3 has been posted Autumn – Current Event Tuesday.
Constraint Satisfaction Problems Chapter 6. Review Agent, Environment, State Agent as search problem Uninformed search strategies Informed (heuristic.
Chapter 5 Section 1 – 3 1.  Constraint Satisfaction Problems (CSP)  Backtracking search for CSPs  Local search for CSPs 2.
Constraint Satisfaction CPSC 386 Artificial Intelligence Ellen Walker Hiram College.
CSC 8520 Spring Paula Matuszek Based on Hwee Tou Ng, aima.eecs.berkeley.edu/slides-ppt, which are based on Russell, aima.eecs.berkeley.edu/slides-pdf.
Searching by Constraint CMSC Artificial Intelligence January 24, 2008.
Hande ÇAKIN IES 503 TERM PROJECT CONSTRAINT SATISFACTION PROBLEMS.
Chapter 5: Constraint Satisfaction ICS 171 Fall 2006.
CSCI 5582 Fall 2006 CSCI 5582 Artificial Intelligence Fall 2006 Jim Martin.
1 Chapter 5 Constraint Satisfaction Problems. 2 Outlines  Constraint Satisfaction Problems  Backtracking Search for CSPs  Local Search for CSP  The.
CSC 8520 Spring Paula Matuszek CS 8520: Artificial Intelligence Search 3: Constraint Satisfaction Problems Paula Matuszek Spring, 2013.
Chapter 5 Constraint Satisfaction Problems
Review Test1. Robotics & Future Technology Future of Intelligent Systems / Ray Kurzweil futurist Ray Kurzweil / A Long Bet A Long Bet / Robot Soccer.
Constraint Satisfaction Problems (Chapter 6)
An Introduction to Artificial Intelligence Lecture 5: Constraint Satisfaction Problems Ramin Halavati In which we see how treating.
1 Constraint Satisfaction Problems Chapter 5 Section 1 – 3 Grand Challenge:
CHAPTER 5 SECTION 1 – 3 4 Feb 2004 CS Constraint Satisfaction 1 Constraint Satisfaction Problems.
Constraint Satisfaction Problems University of Berkeley, USA
G51IAI Introduction to Artificial Intelligence
1. 2 Outline of Ch 4 Best-first search Greedy best-first search A * search Heuristics Functions Local search algorithms Hill-climbing search Simulated.
1 Constraint Satisfaction Problems: Formulation, Arc Consistency & Propagation 1 Brian C. Williams October 13 th, 2004 Slides adapted from:
Computing & Information Sciences Kansas State University Friday, 08 Sep 2006CIS 490 / 730: Artificial Intelligence Lecture 7 of 42 Friday, 08 September.
Chapter 5 Team Teaching AI (created by Dewi Liliana) PTIIK Constraint Satisfaction Problems.
Constraint Satisfaction Problems Rich and Knight: 3.5 Russell and Norvig: Chapter 3, Section 3.7 Chapter 4, Pages Slides adapted from: robotics.stanford.edu/~latombe/cs121/2003/home.htm.
Dr. Shazzad Hosain Department of EECS North South University Lecture 01 – Part C Constraint Satisfaction Problems.
1 Constraint Satisfaction Problems (CSP). Announcements Second Test Wednesday, April 27.
Game Search & Constrained Search CMSC Artificial Intelligence January 18, 2005.
ARTIFICIAL INTELLIGENCE (CS 461D) Dr. Abeer Mahmoud Computer science Department Princess Nora University Faculty of Computer & Information Systems.
Cse 150, Fall 2012Gary Cottrell: Many slides borrowed from David Kriegman! Constraint Satisfaction Problems Introduction to Artificial Intelligence CSE.
ECE 448, Lecture 7: Constraint Satisfaction Problems
Constraint Satisfaction Problems (CSPs)
Instructor: Vincent Conitzer
Lecture 7 Constraint Satisfaction Problems
CS B551: Elements of Artificial Intelligence
Chapter 3: Finite Constraint Domains
Game Search & Constrained Search
Constraint Satisfaction Problems
Searching by Constraint & Searching by Evolution
Constraint Satisfaction Problems. A Quick Overview
Searching by Constraint & Searching by Evolution
CS 8520: Artificial Intelligence
Constraint Satisfaction Problems
Presentation transcript:

Constraint Propagation Artificial Intelligence CMSC January 22, 2002

Agenda Constraint Propagation: Motivation Constraint Propagation Example –Waltz line labeling Constraint Propagation Mechanisms –Arc consistency –CSP as search Forward-checking Back-jumping Summary

Constraint Satisfaction Problems Very general: Model wide range of tasks Key components: –Variables: Take on a value –Domains: Values that can be assigned to vars –Constraints: Restrictions on assignments Constraints are HARD –Not preferences: Must be observed E.g. Can’t schedule two classes: same room, same time

Constraint Satisfaction Problem Graph/Map Coloring: Label a graph such that no two adjacent vertexes same color –Variables: Vertexes –Domain: Colors –Constraints: If E(a,b), then C(a) != C(b)

Constraint Satisfaction Problems Resource Allocation: –Scheduling: N classes over M terms, 4 classes/term –Aircraft at airport gates Satisfiability: e.g. 3-SAT –Assignments of truth values to variables such that 1) consistent and 2) clauses true

Constraint Satisfaction Problem “N-Queens”: –Place N queens on an NxN chessboard such that none attacks another –Variables: Queens (1/column) –Domain: Rows –Constraints: Not same row, column, or diagonal

N-queens Q1 Q2 Q3 Q4

Constraint Satisfaction Problem Range of tasks: –Coloring, Resource Allocation, Satisfiability –Varying complexity: E.g. 3-SAT NP-complete Complexity: Property of problem NOT CSP Basic Structure: –Variables: Graph nodes, Classes, Boolean vars –Domains: Colors, Time slots, Truth values –Constraints: No two adjacent nodes with same color, No two classes in same time, consistent, satisfying ass’t

Constraint Propagation Method For each variable, –Get all values for that variable –Remove all values that conflict with ALL adjacent A:For each neighbor, remove all values that conflict with ALL adjacent –Repeat A as long as some label set is reduced

Constraint Propagation Example Image interpretation: –From a 2-D line drawing, automatically determine for each line, if it forms a concave, convex or boundary surface –Segment image into objects Simplifying assumptions: –World of polyhedra No shadows, no cracks

CSP Example: Line Labeling 3 Line Labels: –Boundary line: regions do not abut: > Arrow direction: right hand side walk –Interior line: regions do abut Concave edge line: _ Convex edge line : + Junction labels: –Where line labels meet

CSP Example: Line Labeling Simplifying (initial) restrictions: –No shadows, cracks –Three-faced vertexes –General position: small changes in view-> no change in junction type 4^2 labels for 2 line junction: L 4^3; 3-line junction : Fork, Arrow, T Total: 208 junction labelings

CSP Example: Line Labeling Key observation: Not all 208 realizable –How many? 18 physically realizable All Junctions L junctions Fork Junctions T junctions Arrow junctions _ _ _ _ _ _ _ _ _ + + __ _ + + +

CSP Example: Line Labeling Label boundaries clockwise Label arrow junctions + + +

CSP Example: Line Labeling Label boundaries clockwise

CSP Example: Line Labeling Label fork junctions with +’s

CSP Example: Line Labeling Label arrow junctions with -’s _ _ _ _ _ _ __ _

Waltz’s Line Labeling For each junction in image, –Get all labels for that junction type –Remove all labels that conflict with ALL adjacent A:For each neighbor, remove all labels that conflict with ALL –Repeat A as long as some label set is reduced

Waltz Propagation Example C D B A + __ _ _ + + X X X + + +

Waltz’s Line Labeling Full version: –Removes constraints on images Adds special shadow and crack labels Includes all possible junctions –Not just 3 face Physically realizable junctions –Still small percentage of all junction labels –O(n) : n = # lines in drawing

Constraint Propagation Mechanism Arc consistency –Arc V1->V2 is arc consistent if for all x in D1, there exists y in D2 such that (x,y) is allowed Delete disallowed x’s to achieve arc consistency

Arc Consistency Example Graph Coloring: Variables: Nodes Domain: Colors (R,G,B) Constraint: If E(a,b), then C(a) != C(b) Initial assignments R,G,B BR,B X Y Z

Arc Consistency Example R,G,B BR,B X Y Z Arc Rm Value X -> Y None X -> Z X=B Y-> Z Y=B X -> Y X=R X -> Z None Y -> Z None ======> Assignments: X = G Y = R Z = B

Limitations of Arc Consistency Arc consistent: –No legal assignment Arc consistent: –>1 legal assignment R,G G,B X Y Z X Y Z

CSP as Search Constraint Satisfaction Problem (CSP) is a restricted class of search problem –State: Set of variables & assignment info Initial State: No variables assigned Goal state: Set of assignments consistent with constraints –Operators: Assignment of value to variable

CSP as Search Depth: Number of Variables Branching Factor: |Domain| Leaves: Complete Assignments Blind search strategy: –Bounded depth -> Depth-first strategy Backtracking: –Recover from dead ends –Find satisfying assignment

CSP as Search X=R X=G X=B Y=R Y=B Y=RY=BY=RY=B No! Yes! No!Yes! No! Z=BZ=RZ=B Z=R Z=BZ=R Z=BZ=R

Backtracking Issues CSP as Search –Depth-first search Maximum depth = # of variables –Continue until (partial/complete) assignment Consistent: return result Violates constraint -> backtrack to previous assignment –Wasted effort Explore branches with no possible legal assignment

Backtracking with Forward Checking Augment DFS with backtracking –Add some constraint propagation Propagate constraints –Remove assignments which violate constraint –Only propagate when domain = 1 “Forward checking” Limit constraints to test

Backtracking+Forward Checking X=R X=G X=B Y=B Y=RY=B Y=R Z=B No! Yes! No! Z=R

Heuristic CSP Improving Backtracking –Standard backtracking Back up to last assignment –Back-jumping Back up to last assignment that reduced current domain Change assignment that led to dead end

Heuristic CSP Backtracking –Pick “first”/”leftmost” node to expand Heuristic CSP –Most constrained variable: Minimize branching factor –Least constraining value: Pick value that removes fewest values from other vars Improve chance of finding SOME assignment Can increase feasible size of CSP problem

Iterative Improvement Alternate formulation of CSP –Rather than DFS through partial assignments –Start with some complete, valid assignment Search for optimal assignment wrt some criterion Example: Traveling Salesman Problem –Minimum length tour through cities, visiting each one once

Iterative Improvement Example TSP –Start with some valid tour E.g. find greedy solution –Make incremental change to tour E.g. hill-climbing - take change that produces greatest improvement –Problem: Local minima –Solution: Randomize to search other parts of space Other methods: Simulated annealing, Genetic alg’s

CSP Summary General problem structure –Variables; Domain: values to assign; –Constraints: Restrictions on valid assignments –N-Queens; Graph-coloring; 3-Sat; Scheduling Constraint propagation mechanisms –Arc consistency –Search model: Backtrack+Forward-checking Heuristics: Back-jump; Variable&value selection –Iterative improvement reformulation