CS 484 – Artificial Intelligence1 Announcements Homework 2 due today Lab 1 due Thursday, 9/20 Homework 3 has been posted Autumn – Current Event Tuesday.

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
CPSC 322, Lecture 14Slide 1 Local Search Computer Science cpsc322, Lecture 14 (Textbook Chpt 4.8) Oct, 5, 2012.
Constraint Satisfaction Problems
This lecture topic (two lectures) Chapter 6.1 – 6.4, except
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)
This lecture topic (two lectures) Chapter 6.1 – 6.4, except 6.3.3
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 Satisfaction problems (CSP)
Review: Constraint Satisfaction Problems How is a CSP defined? How do we solve CSPs?
CS 484 – Artificial Intelligence1 Announcements Department Picnic: today, after class Lab 0 due today Homework 2 due Tuesday, 9/18 Lab 1 due Thursday,
CPSC 322, Lecture 14Slide 1 Local Search Computer Science cpsc322, Lecture 14 (Textbook Chpt 4.8) February, 3, 2010.
4 Feb 2004CS Constraint Satisfaction1 Constraint Satisfaction Problems Chapter 5 Section 1 – 3.
Iterative improvement algorithms Prof. Tuomas Sandholm Carnegie Mellon University Computer Science Department.
1 Chapter 5 Advanced Search. 2 Chapter 5 Contents l Constraint satisfaction problems l Heuristic repair l The eight queens problem l Combinatorial optimization.
CPSC 322, Lecture 14Slide 1 Local Search Computer Science cpsc322, Lecture 14 (Textbook Chpt 4.8) February, 4, 2009.
Artificial Intelligence Constraint satisfaction Chapter 5, AIMA.
Constraint Satisfaction Problems
Constraint Satisfaction
1 Chapter 5 Advanced Search. 2 l
Using Search in Problem Solving
Chapter 5 Outline Formal definition of CSP CSP Examples
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.
Search CSE When you can’t use A* Hill-climbing Simulated Annealing Other strategies 2 person- games.
Introduction to search Chapter 3. Why study search? §Search is a basis for all AI l search proposed as the basis of intelligence l inference l all learning.
1 Chapter 5 Advanced Search. 2 Chapter 5 Contents l Constraint satisfaction problems l Heuristic repair l The eight queens problem l Combinatorial optimization.
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.
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.
Local Search Algorithms
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
Constraint Satisfaction Problems (Chapter 6)
An Introduction to Artificial Intelligence Lecture 5: Constraint Satisfaction Problems Ramin Halavati In which we see how treating.
CHAPTER 5 SECTION 1 – 3 4 Feb 2004 CS Constraint Satisfaction 1 Constraint Satisfaction Problems.
Constraint Satisfaction Problems University of Berkeley, USA
Optimization Problems
1. 2 Outline of Ch 4 Best-first search Greedy best-first search A * search Heuristics Functions Local search algorithms Hill-climbing search Simulated.
Chapter 5. Advanced Search Fall 2011 Comp3710 Artificial Intelligence Computing Science Thompson Rivers University.
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 Propagation Artificial Intelligence CMSC January 22, 2002.
Local Search Algorithms and Optimization 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)
Local search algorithms In many optimization problems, the path to the goal is irrelevant; the goal state itself is the solution State space = set of "complete"
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.
Constraint Satisfaction Problems (CSPs)
Computer Science cpsc322, Lecture 14
Computer Science cpsc322, Lecture 14
Constraint Satisfaction Problems
Constraint Satisfaction Problems. A Quick Overview
Chapter 5. Advanced Search
Constraint Satisfaction
CS 8520: Artificial Intelligence
Constraint Satisfaction Problems
Constraint Satisfaction Problems (CSP)
Presentation transcript:

CS 484 – Artificial Intelligence1 Announcements Homework 2 due today Lab 1 due Thursday, 9/20 Homework 3 has been posted Autumn – Current Event Tuesday

Advanced Search Lecture 5

CS 484 – Artificial Intelligence3 Constraint Satisfaction Problems Combinatorial optimization problems involve assigning values to a number of variables. A constraint satisfaction problem is a combinatorial optimization problem with a set of constraints. Can be solved using search. With many variables it is essential to use heuristics.

CS 484 – Artificial Intelligence4 Recognizing CSPs Commutativity: order of application of any given set of actions has no effect on the outcome Algorithms generate successors by considering possible assignments for only a single variable at each node in the search tree

CS 484 – Artificial Intelligence5 Example: Map Coloring Color the Southwest using three colors (red, green, blue) AZ CA NVUT CO NM

CS 484 – Artificial Intelligence6 Backtracking Search Depth-first search chooses values for variables on at a time backtracks when a variable has no legal values left to assign BACKTRACKING-SEARCH(csp) returns a solution, or failure return RECURSIVE-BACKTRACKING ({ }, csp)

CS 484 – Artificial Intelligence7 RECURSIVE-BACKTRACKING(assignment, csp) returns a solution of failure if assignment is complete then return assignment var ← SELECT-UNASSIGNED-VARIABLE (csp.variables, assignment, csp) for each value in ORDER-DOMAIN-VALUES (var, assignment, csp) do if value is consistent with assignment according to csp.constraints then add{var = value} to assignment result ← RECURSIVE-BACKTRACKING (assignment, csp) if result ≠ failure then return result remove {var = value} from assignment return failure

CS 484 – Artificial Intelligence8 Color the Map AZ CA NVUT CO NM

CS 484 – Artificial Intelligence9 Improve Backtracking 1.Which variable should be assigned next, and in what order should its values be tried? 2.What are the implications of the current variable assignments for other unassigned variables?

CS 484 – Artificial Intelligence10 Variable ordering var ← SELECT-UNASSIGNED-VARIABLE (csp.variables, assignment, csp) Order the set based on This prunes the search tree AZ CA NVUT CO NM

CS 484 – Artificial Intelligence11 First State Degree heuristic – reduce branching factor by selecting variable has largest number of constraints AZ CA NVUT CO NM

CS 484 – Artificial Intelligence12 Value Ordering Least-constraining value – prefers the values that rule out the fewest choices for neighboring variables in graph If CA=red and NV=green, what happens if UT=blue? Heuristic leaves maximum flexibility AZ CA NVUT CO NM

CS 484 – Artificial Intelligence13 Forward checking After assigning X=value Look at unassigned neighbor-variables (Y) Delete from Y any value that is inconsistent with value chosen for X CANVUTCONMAZ Init. domainR G B After CA=RR* G BR G B G B After UT=GR* B G*R BR G B B After NM=BR* B G*R B*

CS 484 – Artificial Intelligence14 Finding Arc Consistency Consistency – for every value of X, there is some possible value of Y Algorithm Puesdocode Put all arcs in queue While queue isn't empty If any inconsistencies in (X i, X j ) (i.e. (CO, AZ) for each neighbor, X k, of X i other than X j add (X k, X i ) to the queue

CS 484 – Artificial Intelligence15 Heuristic Repair A heuristic method for solving constraint satisfaction problems. Generate a possible solution, and then make small changes to bring it closer to satisfying constraints.

CS 484 – Artificial Intelligence16 The Eight Queens Problem A constraint satisfaction problem: Place eight queens on a chess board so that no two queens are on the same row, column or diagonal. Can be solved by search, but the search tree is large. Heuristic repair is very efficient at solving this problem.

CS 484 – Artificial Intelligence17 Heuristic Repair for The Eight Queens Problem Initial state – one queen is conflicting with another. We’ll now move that queen to the square with the fewest conflicts.

CS 484 – Artificial Intelligence18 Heuristic Repair for The Eight Queens Problem Second state – now the queen on the f column is conflicting, so we’ll move it to the square with fewest conflicts.

CS 484 – Artificial Intelligence19 Heuristic Repair for The Eight Queens Problem Final state – a solution!

CS 484 – Artificial Intelligence20 Local Search Like heuristic repair, local search methods start from a random state, and make small changes until a goal state is achieved. Local search methods are known as meta- heuristics. Most local search methods are susceptible to local maxima, like hill-climbing.

CS 484 – Artificial Intelligence21 Exchanging Heuristics A simple local search method. Heuristic repair is an example of an exchanging heuristic. Involves swapping two or more variables at each step until a solution is found. A k-exchange involves swapping the values of k variables. Can be used to solve the traveling salesman problem.

CS 484 – Artificial Intelligence22 Iterated Local Search A local search is applied repeatedly from different starting states. Attempts to avoid finding local maxima. Useful in cases where the search space is extremely large, and exhaustive search will not be possible.

CS 484 – Artificial Intelligence23 Simulated Annealing Combination of hill climbing and a random walk In metallurgy, annealing - heat metal and then cooled very slowly Aims at obtaining a minimum value for some function of a large number of variables. This value is known as the energy of the system.

CS 484 – Artificial Intelligence24 Simulated Annealing (2) A random start state is selected A small random change is made. If this change lowers the system energy, it is accepted. If it increases the energy, it may be accepted, depending on a probability called the Boltzmann acceptance criteria: e (∆E/T)

CS 484 – Artificial Intelligence25 Simulated Annealing (3) e (∆E/T) T is the temperature of the system ∆E is the change in energy. When the process starts, T is high, meaning increases in energy are relatively likely to happen. Over successive iterations, T lowers and increases in energy become less likely.

CS 484 – Artificial Intelligence26 SIMULATED-ANNEALING(problem, schedule) returns a solution state { current ← InitialState(problem) for t ← 1 to ∞ do T ← schedule[t] if T = 0 then return current next ← a randomly selected successor of current ∆E ← next.value – current.value if ∆E > 0 then current ← next else current ← next only with probability e ∆E/T

CS 484 – Artificial Intelligence27 Simulated Annealing (4) Because the energy of the system is allowed to increase, simulated annealing is able to escape from global minima. Simulated annealing is a widely used local search method for solving problems with very large numbers of variables. For example: scheduling problems, traveling salesman, placing VLSI (chip) components.

CS 484 – Artificial Intelligence28 Genetic Algorithms A method based on biological evolution. Create chromosomes which represent possible solutions to a problem. The best chromosomes in each generation are bred with each other to produce a new generation. Much more detail on this later.

CS 484 – Artificial Intelligence29 Iterative Deepening A* A* is applied iteratively, with incrementally increasing limits on f(n). Works well if there are only a few possible values for f(n). The method is complete, and has a low memory requirement, like depth-first search.

CS 484 – Artificial Intelligence30 Parallel Search Some search methods can be easily split into tasks which can be solved in parallel. Important concepts to consider are: Task distribution Load balancing Tree ordering

CS 484 – Artificial Intelligence31 Bidirectional Search Also known as wave search. Useful when the start and goal are both known. Starts two parallel searches – one from the root node and the other from the goal node. Paths are expanded in a breadth-first fashion from both points. Where the paths first meet, a complete and optimal path has been formed. Milan to Naples w/ knowledge "All roads lead to Rome"

CS 484 – Artificial Intelligence32 Nondeterministic Search Useful when very little is known about the search space. Combines the depth first and breadth first approaches randomly. Avoids the problems of both, but does not necessarily have the advantages of either. New paths are added to the queue in random positions, meaning the method will follow a random route through the tree until a solution is found.