Backward Checking Search BT, BM, BJ, CBJ. An example problem Colour each of the 5 nodes, such that if they are adjacent, they take different colours 12.

Slides:



Advertisements
Similar presentations
Constraint Satisfaction Problems
Advertisements

GRAPHS Prof. Muhammad Saeed Analysis of Algorithms Analysis Of Algorithms1.
I am Patrick Prosser I am a senior lecturer at Glasgow I teach AF2 & CP4 I am a member of the algorithms group the apes (distributed, not disbanded) I.
Constraint Programming Peter van Beek University of Waterloo.
Constraint Satisfaction Patrick Prosser. An Example, Exam Timetabling Someone timetables the exams We have a number of courses to examine how many? Dept.
A Normal Form for XML Documents Marcelo Arenas Leonid Libkin Department of Computer Science University of Toronto.
Constraint Satisfaction Problems Russell and Norvig: Chapter
1 On c-Vertex Ranking of Graphs Yung-Ling Lai & Yi-Ming Chen National Chiayi University Taiwan.
Fc. Consider the following problem (csp5) variables V[1] to V[10] uniform domains D[1] to D[10] = {1,2,3} constraints V[1] = V[4] V[4] > V[7] V[7] = V[10]
From Approximative Kernelization to High Fidelity Reductions joint with Michael Fellows Ariel Kulik Frances Rosamond Technion Charles Darwin Univ. Hadas.
Instructor: Shengyu Zhang 1. Content Two problems  Minimum Spanning Tree  Huffman encoding One approach: greedy algorithms 2.
CS 253: Algorithms Chapter 22 Graphs Credit: Dr. George Bebis.
Foundations of Constraint Processing Lookahead Schemas 1 Foundations of Constraint Processing CSCE421/821, Spring
Backward Checking Search BT, BM, BJ, CBJ. An example problem Colour each of the 5 nodes, such that if they are adjacent, they take different colours.
Constraint Satisfaction Problems
Lecture 7 March 1, 11 discuss HW 2, Problem 3
MCA 202: Discrete Mathematics Instructor Neelima Gupta
Maintaining Arc Consistency We have a constraint graph G of variables X 1,...X n, and constraint relations {X i  X j}, and each Xi has a value set V (X.
Constraint Based Reasoning over Mutex Relations in Graphplan Algorithm Pavel Surynek Charles University, Prague Czech Republic.
1 Constraint Satisfaction Problems A Quick Overview (based on AIMA book slides)
1 CMSC 471 Fall 2002 Class #6 – Wednesday, September 18.
1 Constraint Satisfaction Problems. 2 Intro Example: 8-Queens Generate-and-test: 8 8 combinations.
This lecture topic (two lectures) Chapter 6.1 – 6.4, except 6.3.3
1 Finite Constraint Domains. 2 u Constraint satisfaction problems (CSP) u A backtracking solver u Node and arc consistency u Bounds consistency u Generalized.
MBD and CSP Meir Kalech Partially based on slides of Jia You and Brian Williams.
Artificial Intelligence Constraint satisfaction problems Fall 2008 professor: Luigi Ceccaroni.
Constraint Logic Programming Ryan Kinworthy. Overview Introduction Logic Programming LP as a constraint programming language Constraint Logic Programming.
Constraint Satisfaction CSE 473 University of Washington.
Constraint Satisfaction Problems
Constraint Satisfaction
Foundations of Constraint Processing, Fall 2005 Sep 20, 2005BT: A Theoretical Evaluation1 Foundations of Constraint Processing CSCE421/821, Fall 2005:
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.
Constraint Propagation (Where a better exploitation of the constraints further reduces the need to make decisions) R&N: Chap. 5 + Chap. 24, p
Chapter 5 Outline Formal definition of CSP CSP Examples
1 Constraint Programming: An Introduction Adapted by Cristian OLIVA from Peter Stuckey (1998) Ho Chi Minh City.
Relaxation and Hybrid constraint processing Different relaxation techniques Some popular hybrid techniques.
Constraint Satisfaction Read Chapter 5. Model Finite set of variables: X1,…Xn Variable Xi has values in domain Di. Constraints C1…Cm. A constraint specifies.
Constraint Satisfaction CPSC 386 Artificial Intelligence Ellen Walker Hiram College.
1 CS B551: Elements of Artificial Intelligence Instructor: Kris Hauser
Problem Solving with Constraints Lookahead Schemas 1 Foundations of Constraint Processing CSCE496/896, Fall
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.
Maintaining Arc Consistency (MAC) MAC is the same as Back-tracking, but with calls to AC-3 interleaved... function Backtracking-Search(csp) returns.
An Introduction to Artificial Intelligence Lecture 5: Constraint Satisfaction Problems Ramin Halavati In which we see how treating.
1 CSC 384 Lecture Slides (c) , C. Boutilier and P. Poupart CSC384: Lecture 16  Last time Searching a Graphplan for a plan, and relaxed plan heuristics.
Cbj. What’s a csp? a set of variables each with a domain of values a collection of constraints (I’m going to assume binary for the present) assign each.
I am a senior lecturer at Glasgow
Computer Science cpsc322, Lecture 13
Constraint Satisfaction Problems (CSPs)
543 cbj fans can’t be wrong.
Constraint Satisfaction
Constraint Satisfaction
I am a senior lecturer at Glasgow
Constraint Propagation
Computer Science cpsc322, Lecture 13
Chapter 3: Finite Constraint Domains
CSP Search Techniques Backtracking Forward checking
Intelligent Backtracking Algorithms: A Theoretical Evaluation
Intelligent Backtracking Algorithms
Constraints and Search
Intelligent Backtracking Algorithms: A Theoretical Evaluation
Intelligent Backtracking Algorithms: A Theoretical Evaluation
Constraint satisfaction problems
Constraint Satisfaction Problems. A Quick Overview
Intelligent Backtracking Algorithms: A Theoretical Evaluation
Intelligent Backtracking Algorithms: A Theoretical Evaluation
Artificial Intelligence
Intelligent Backtracking Algorithms: A Theoretical Evaluation
Constraint Graph Binary CSPs
Constraint satisfaction problems
Presentation transcript:

Backward Checking Search BT, BM, BJ, CBJ

An example problem Colour each of the 5 nodes, such that if they are adjacent, they take different colours

Representation variables v1, v2, v3, v4, and v5 domains d1, d2, d3, d4, and d5 domains are the three colours {R,B,G} constraints v1  v2 v1  v3 v2  v3 v2  v5 v3  v5 v4  v5 Assign a value to each variable, from its domain, such that the constraints are satisfied CSP = (V,D,C)

Chronological Backtracking (BT) (0) label(variable:vi) (1) let consistent := false (2) assign vi a value x from its domain di (3) consistent := true (4) while consistent, check against past variables vh if inconsistent(vh,vi) then consistent := false (5) if not consistent remove x from di if di is not empty go to (2) (6) return consistent (0) unlabel(variable:vi) (1) restore domain di (set to original value) (2) let h be i-1 (3) remove the value of vh from domain dh (3) if dh is empty then return false else return true (0) BT(integer:i) (1) if i > N then return(true) (2) if i = 1 and d_1 is empty then return(false) (3) if label(v[i]) then bt(i+1) else unlabel(v[i]) bt(i-1)

Three Different Views of Search a trace a tree past, current, future

V[1] := R V[2] := R check(v[1],v[2]) fails V[2] := B check(v[1],v[2]) good V[3] := R check(v[1],v[3]) fails V[3] := B check(v[1],v[3]) good check(v[2],v[3]) fails V[3] := G check(v[1],v[3]) good check(v[2],v[3]) good V[4] := R V[5] := R check(v[2],v[5]) good check(v[3],v[5]) good check(v[4],v[5]) fails V[5] := B check(v[2],v[5]) fails V[5] := G check(v[2],v[5]) good check(v[3],v[5]) fails backtrack! V[4] := B V[5] := R check(v[2],v[5]) good check(v[3],v[5]) good check(v[4],v[5]) good solution found A Trace of BT (assume domain ordered {R,B,G}) checks and 12 nodes

A Tree Trace of BT (assume domain ordered {R,B,G}) v1 v2 v3 v4 v5

A Tree Trace of BT (assume domain ordered {R,B,G}) v1 v2 v3 v4 v5

A Tree Trace of BT (assume domain ordered {R,B,G}) v1 v2 v3 v4 v5

A Tree Trace of BT (assume domain ordered {R,B,G}) v1 v2 v3 v4 v5

A Tree Trace of BT (assume domain ordered {R,B,G}) v1 v2 v3 v4 v

A Tree Trace of BT (assume domain ordered {R,B,G}) v1 v2 v3 v4 v

A Tree Trace of BT (assume domain ordered {R,B,G}) v1 v2 v3 v4 v

A Tree Trace of BT (assume domain ordered {R,B,G}) v1 v2 v3 v4 v

A Tree Trace of BT (assume domain ordered {R,B,G}) v1 v2 v3 v4 v

A Tree Trace of BT (assume domain ordered {R,B,G}) v1 v2 v3 v4 v

A Tree Trace of BT (assume domain ordered {R,B,G}) v1 v2 v3 v4 v

A Tree Trace of BT (assume domain ordered {R,B,G}) v1 v2 v3 v4 v

A Tree Trace of BT (assume domain ordered {R,B,G}) v1 v2 v3 v4 v

Another view v1 v2 v3 v4 v5 current variable past variables future variables check back

Can you solve this? Try bt1 and/or bt2 with constraints C2 - load(“bt2”) - bt(V,D,C2) this is csp2

Thrashing? (csp3)

V1 = R v2 = B v3 = G v4 = R v5 = B v6 = R v7 = B v8 = R v9 = conflict The cause of the conflict with v9 is v4, but what will bt do? Find out how it goes with bt3 and csp4

Where’s the code? See clairExamples/bt*.cl and clairExample/csp*.cl

questions Why measure checks and nodes? What is a node anyway? Who cares about checks? Why instantiate variables in lex order? Would a different order make a difference? How many nodes could there be? How many checks could there be? Are all csp’s binary? How can we represent constraints? Is it reasonable to separate V from D? Why not have variables with domains What is a constraint graph? How can (V,D,C) be a graph?