Variables “To be is to be the value of a variable.” - William Quine.

Slides:



Advertisements
Similar presentations
Constraint Satisfaction Problems
Advertisements

Constraint Satisfaction Problems Russell and Norvig: Chapter
Constraint Satisfaction Problems (Chapter 6). What is search for? Assumptions: single agent, deterministic, fully observable, discrete environment Search.
Constraint Satisfaction Problems
Lecture 11 Last Time: Local Search, Constraint Satisfaction Problems Today: More on CSPs.
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.
This lecture topic (two lectures) Chapter 6.1 – 6.4, except 6.3.3
Review: Constraint Satisfaction Problems How is a CSP defined? How do we solve CSPs?
4/18/2005EE5621 EE562 ARTIFICIAL INTELLIGENCE FOR ENGINEERS Lecture 6, 4/20/2005 University of Washington, Department of Electrical Engineering Spring.
Constraint Satisfaction Problems. Constraint satisfaction problems (CSPs) Standard search problem: – State is a “black box” – any data structure that.
Constraint Satisfaction Problems
4 Feb 2004CS Constraint Satisfaction1 Constraint Satisfaction Problems Chapter 5 Section 1 – 3.
1 Constraint Satisfaction Problems Soup Total Cost < $30 Chicken Dish Vegetable RiceSeafood Pork Dish Appetizer Must be Hot&Sour No Peanuts No Peanuts.
Constraint Satisfaction Problems
Constraint Satisfaction
Chapter 5 Outline Formal definition of CSP CSP Examples
Constraint Satisfaction Not all problems are solved by a sequential series of steps. How do we solve other types of problems?
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.
Artificial Intelligence CS482, CS682, MW 1 – 2:15, SEM 201, MS 227 Prerequisites: 302, 365 Instructor: Sushil Louis,
CSPs Tamara Berg CS 560 Artificial Intelligence Many slides throughout the course adapted from Svetlana Lazebnik, Dan Klein, Stuart Russell, Andrew Moore,
CSPs Tamara Berg CS Artificial Intelligence Many slides throughout the course adapted from Svetlana Lazebnik, Dan Klein, Stuart Russell, Andrew.
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.
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.
Hande ÇAKIN IES 503 TERM PROJECT CONSTRAINT SATISFACTION PROBLEMS.
1 Constraint Satisfaction Problems Soup Total Cost < $30 Chicken Dish Vegetable RiceSeafood Pork Dish Appetizer Must be Hot&Sour No Peanuts No Peanuts.
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.
Constraint Satisfaction Problems (Chapter 6)
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
Constraint Satisfaction Problems Chapter 6. Outline CSP? Backtracking for CSP Local search for CSPs Problem structure and decomposition.
4/18/2005EE5621 EE562 ARTIFICIAL INTELLIGENCE FOR ENGINEERS Lecture 5, 4/18/2005 University of Washington, Department of Electrical Engineering Spring.
1. 2 Outline of Ch 4 Best-first search Greedy best-first search A * search Heuristics Functions Local search algorithms Hill-climbing search Simulated.
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.
EXAMPLE: MAP COLORING. Example: Map coloring Variables — WA, NT, Q, NSW, V, SA, T Domains — D i ={red,green,blue} Constraints — adjacent regions must.
1 Constraint Satisfaction Problems Chapter 5 Section 1 – 3.
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.
Constraint Satisfaction Problems
CMPT 463. What will be covered A* search Local search Game tree Constraint satisfaction problems (CSP)
ARTIFICIAL INTELLIGENCE (CS 461D) Dr. Abeer Mahmoud Computer science Department Princess Nora University Faculty of Computer & Information Systems.
CS 561, Session 8 1 This time: constraint satisfaction - Constraint Satisfaction Problems (CSP) - Backtracking search for CSPs - Local search for CSPs.
Constraint Satisfaction Problems (Chapter 6)
ECE 448, Lecture 7: Constraint Satisfaction Problems
Constraint Satisfaction Problems Lecture # 14, 15 & 16
Advanced Artificial Intelligence
Constraint Satisfaction Problems
Constraint Satisfaction Problems
Constraint Satisfaction Problems
Artificial Intelligence
Constraint Satisfaction Problems
Constraint satisfaction problems
Constraint Satisfaction Problems. A Quick Overview
Constraint Satisfaction Problems
CS 8520: Artificial Intelligence
Constraint Satisfaction Problems
Constraint satisfaction problems
Constraint Satisfaction Problems (CSP)
Presentation transcript:

Variables “To be is to be the value of a variable.” - William Quine

Announcements Pset 1 and prog 1 were due yesterday Pset 2 and prog 2 are going out today Tiny (intro) backlog Probability Review is… TBA still Mistake on Alpha / Beta agent algorithm

def miniMax(self, node, depth, alpha, beta, isMax): if node.isTerminal(): if isMax return node.utility() return –node.utility() if depth == 0: return self.getHeuristic(node) if isMax: for action in node.getLegalActions(): child = node.getSuccessorState(action) value = miniMax(child, depth -1, alpha, beta, not isMax) alpha = max(alpha, value) if beta <= alpha: break return alpha else: for action in node.getLegalActions(): child = node.getSuccessorState(action) value = self.miniMax(child, depth -1, alpha, beta, not isMax) beta = min(value, beta) if beta <= alpha: break return beta Alpha Beta Pruning return node.utility()

Programming Assignment Time

Consider asking for help. your TA (or rock on)

Problem Set Question Time

Total: 28 Hours / Student Ideal: 26 Hours / Student Units: 4.2 unit class

Homework Preference

Driverless Car Important Algo. Easy to Visualize Less Time Driverless Car

Search Variable Based Machine Learning CS221

Search Variable Based Machine Learning CS221

Image Segmentation

Chris Claire Home

Image Segmentation

Motivating Example

CSPs Commutatively: the order of application of actions has no effect on outcome

CSPs

Interesting in their own right Introduction to variable based models Inference is very similar to … [super secret stuff]

Formalization Inference Search Improved Search Arc Consistency Graph Structure Genetic Algorithms Weighted CSPs Image Segmentation CSPs

Real World Problem Formal Problem Solution Model the problem Apply an Algorithm Evaluate The AI Pipeline

Formally

Factor Graphs

Types of Domains

Constraints

Variables WA, NT, Q, NSW, V, SA, T Domains D i = {red,green,blue} Constraints: adjacent regions must have different colors e.g., WA ≠ NT, or (WA,NT) in {(red,green),(red,blue),(green,red), (green,blue),(blue,red),(blue,green)} Example: Map Coloring

4 Feb 2004CS Constraint Satisfaction34 Variables: F T U W R O X 1 X 2 X 3 Domains: {0,1,2,3,4,5,6,7,8,9} Constraints: – Alldiff (F,T,U,W,R,O) – O + O = R + 10 · X 1 – X 1 + W + W = U + 10 · X 2 – X 2 + T + T = O + 10 · X 3 – X 3 = F, T ≠ 0, F ≠ 0 Example: Crypto

Example: Student Seats Go!

Real World Problem Formal Problem Solution Model the problem Apply an Algorithm Evaluate The AI Pipeline

Inference 1. Search 2. Constraint Propagation

Variables WA, NT, Q, NSW, V, SA, T Domains D i = {red,green,blue} Constraints: adjacent regions must have different colors e.g., WA ≠ NT, or (WA,NT) in {(red,green),(red,blue),(green,red), (green,blue),(blue,red),(blue,green)} Example 2: Map Coloring

Solutions are complete and consistent assignments, e.g., WA = red, NT = green,Q = red,NSW = green,V = red,SA = blue,T = green Example 2: Map Coloring

Binary CSP: each constraint relates two variables Constraint graph: nodes are variables, arcs are constraints Example 2: Map Coloring

Inference 1. Search 2. Constraint Propagation

4 Feb 2004CS Constraint Satisfaction42 Search

General-purpose methods 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? Improved Search

Choose the variable with the fewest legal values a.k.a. minimum remaining values (MRV) heuristic Most Constrained Variable

Tie-breaker among most constrained variables Choose the variable with the most constraints on remaining variables Most Constraining Variable

Given a variable, choose the assignment that rules out the fewest values in the remaining variables Least Constraining Assignment Fun fact: Combining these heuristics makes 1000 queens feasible

Inference 1. Search 2. Constraint Propagation

4 Feb 2004CS Constraint Satisfaction51 Idea: Keep track of remaining legal values for unassigned variables Terminate search when any variable has no legal values Forward Checking

4 Feb 2004CS Constraint Satisfaction52 Idea: Keep track of remaining legal values for unassigned variables Terminate search when any variable has no legal values Forward Checking

4 Feb 2004CS Constraint Satisfaction53 Idea: Keep track of remaining legal values for unassigned variables Terminate search when any variable has no legal values Forward Checking

4 Feb 2004CS Constraint Satisfaction54 Idea: Keep track of remaining legal values for unassigned variables Terminate search when any variable has no legal values Forward Checking Other ways to catch other failures

4 Feb 2004CS Constraint Satisfaction55 At each iteration, make each arc consistent Arc Consistency

4 Feb 2004CS Constraint Satisfaction56 At each iteration, make each arc consistent Arc Consistency

4 Feb 2004CS Constraint Satisfaction57 At each iteration, make each arc consistent Arc Consistency

4 Feb 2004CS Constraint Satisfaction58 At each iteration, make each arc consistent Arc Consistency

Graph Structure

Theorem: If a constraint graph has no loops then the CSP can be solved in O(nd 2 ) time linear in the number of variables! Compare difference with general CSP, where worst case is O(d n ) Trees are Easy

Non Trees

Tree Decomposition

Motivating Example Sudoku becomes easy (under 0.1s)

Flavors

Weighted CSP A B weight

Demo Example

Image Segmentation?

Genetic Algorithms Variables D = (D 1, D 2 … D n ) each with domain = {A, T, G, C} Try searching by creating populations, mating them with one another and mutating every once in a while. Just for fun!

Genetic Algorithms Just for fun!

Genetic Algorithms Just for fun!

Theme?

Mehran Sahami Probability

Motivating Example

And The Revolution Starts…