More on A*; Preview of Logic; Local Search Henry Kautz.

Slides:



Advertisements
Similar presentations
Informed search algorithms
Advertisements

Informed search algorithms
Informed search algorithms
Greedy best-first search Use the heuristic function to rank the nodes Search strategy –Expand node with lowest h-value Greedily trying to find the least-cost.
Informed search algorithms
Informed Search Methods Copyright, 1996 © Dale Carnegie & Associates, Inc. Chapter 4 Spring 2004.
Situation Calculus for Action Descriptions We talked about STRIPS representations for actions. Another common representation is called the Situation Calculus.
1 Heuristic Search Chapter 4. 2 Outline Heuristic function Greedy Best-first search Admissible heuristic and A* Properties of A* Algorithm IDA*
AI – Week 5 Implementing your own AI Planner in Prolog – part II : HEURISTICS Lee McCluskey, room 2/09
Heuristic State Space Seach Henry Kautz. Assignment.
Logical Foundations of AI SAT Henry Kautz. Resolution Refutation Proof DAG, where leaves are input clauses Internal nodes are resolvants Root is false.
Problem Solving by Searching
CPSC 322 Introduction to Artificial Intelligence October 27, 2004.
Informed Search (no corresponding text chapter). Recall: Wanted " An algorithm and associated data structure(s) that can: 1) Solve an arbitrary 8-puzzle.
Artificial Intelligence
MAE 552 – Heuristic Optimization Lecture 27 April 3, 2002
Introduction to Artificial Intelligence Local Search (updated 4/30/2006) Henry Kautz.
Review Best-first search uses an evaluation function f(n) to select the next node for expansion. Greedy best-first search uses f(n) = h(n). Greedy best.
1 Heuristic Search 4 4.0Introduction 4.1An Algorithm for Heuristic Search 4.2Admissibility, Monotonicity, and Informedness 4.3Using Heuristics in Games.
Rutgers CS440, Fall 2003 Heuristic search Reading: AIMA 2 nd ed., Ch
Informed Search Next time: Search Application Reading: Machine Translation paper under Links Username and password will be mailed to class.
State-Space Searches. 2 State spaces A state space consists of –A (possibly infinite) set of states The start state represents the initial problem Each.
State-Space Searches.
Informed Search Idea: be smart about what paths to try.
Graphs II Robin Burke GAM 376. Admin Skip the Lua topic.
INTRODUÇÃO AOS SISTEMAS INTELIGENTES Prof. Dr. Celso A.A. Kaestner PPGEE-CP / UTFPR Agosto de 2011.
Heuristic Search In addition to depth-first search, breadth-first search, bound depth-first search, and iterative deepening, we can also use informed or.
Informed search algorithms
Dr.Abeer Mahmoud ARTIFICIAL INTELLIGENCE (CS 461D) Dr. Abeer Mahmoud Computer science Department Princess Nora University Faculty of Computer & Information.
P ROBLEM Write an algorithm that calculates the most efficient route between two points as quickly as possible.
Informed (Heuristic) Search
Informed search algorithms
Informed search algorithms Chapter 4. Outline Best-first search Greedy best-first search A * search Heuristics.
1 Shanghai Jiao Tong University Informed Search and Exploration.
State-Space Searches. 2 State spaces A state space consists of A (possibly infinite) set of states The start state represents the initial problem Each.
Informed search algorithms Chapter 4. Best-first search Idea: use an evaluation function f(n) for each node –estimate of "desirability"  Expand most.
For Friday Finish reading chapter 4 Homework: –Lisp handout 4.
For Wednesday Read chapter 6, sections 1-3 Homework: –Chapter 4, exercise 1.
For Wednesday Read chapter 5, sections 1-4 Homework: –Chapter 3, exercise 23. Then do the exercise again, but use greedy heuristic search instead of A*
Informed Search Reading: Chapter 4.5 HW #1 out today, due Sept 26th.
Introduction to Artificial Intelligence Class 1 Planning & Search Henry Kautz Winter 2007.
4/11/2005EE562 EE562 ARTIFICIAL INTELLIGENCE FOR ENGINEERS Lecture 4, 4/11/2005 University of Washington, Department of Electrical Engineering Spring 2005.
A General Introduction to Artificial Intelligence.
Feng Zhiyong Tianjin University Fall  Best-first search  Greedy best-first search  A * search  Heuristics  Local search algorithms  Hill-climbing.
Best-first search Idea: use an evaluation function f(n) for each node –estimate of "desirability"  Expand most desirable unexpanded node Implementation:
State space representations and search strategies - 2 Spring 2007, Juris Vīksna.
A* Path Finding Ref: A-star tutorial.
Chapter 3.5 and 3.6 Heuristic Search Continued. Review:Learning Objectives Heuristic search strategies –Best-first search –A* algorithm Heuristic functions.
CPSC 420 – Artificial Intelligence Texas A & M University Lecture 5 Lecturer: Laurie webster II, M.S.S.E., M.S.E.e., M.S.BME, Ph.D., P.E.
Eick: Informed Search Informed Search and Exploration Search Strategies Heuristic Functions Local Search Algorithms Vilalta&Eick: Informed Search.
Review: Tree search Initialize the frontier using the starting state
For Monday Chapter 6 Homework: Chapter 3, exercise 7.
Local Search Strategies: From N-Queens to Walksat
Heuristic Search Henry Kautz.
Discussion on Greedy Search and A*
Discussion on Greedy Search and A*
CS 4100 Artificial Intelligence
A* Path Finding Ref: A-star tutorial.
Lecture 8 Heuristic search Motivational video Assignment 2
CPSC 322 Introduction to Artificial Intelligence
HW 1: Warmup Missionaries and Cannibals
State-Space Searches.
State-Space Searches.
The Rich/Knight Implementation
HW 1: Warmup Missionaries and Cannibals
Midterm Review.
Reading: Chapter 4.5 HW#2 out today, due Oct 5th
State-Space Searches.
Informed Search.
The Rich/Knight Implementation
Presentation transcript:

More on A*; Preview of Logic; Local Search Henry Kautz

A* Search start.dist := 0; insert(start, h(start), heap); while (! empty(heap)) do node := deleteMin(heap); if GoalTest(node) then return node; for each edge do if (child is new or node.dist + length < child.dist) then child.dist = node.dist + length; child.prev = node; if (child is in the heap) then decreaseKey(child, child.dist+h(child), heap); else insert(child, child.dist+h(child), heap); end return FAIL;

A* Search start.dist := 0; insert(start, h(start), heap); while (! empty(heap)) do node := deleteMin(heap); if GoalTest(node) then return node; for each edge do if (child is new or node.dist + length < child.dist) then child.dist = node.dist + length; child.prev = node; if (child is in the heap) then decreaseKey(child, child.dist+h(child), heap); else insert(child, child.dist+h(child), heap); end return FAIL; if a goal node is removed from the heap, the shortest path has been found

A* Search start.dist := 0; insert(start, h(start), heap); while (! empty(heap)) do node := deleteMin(heap); if GoalTest(node) then return node; for each edge do if (child is new or node.dist + length < child.dist) then child.dist = node.dist + length; child.prev = node; if (child is in the heap) then decreaseKey(child, child.dist+h(child), heap); else insert(child, child.dist+h(child), heap); end return FAIL; child might have already been removed from heap; if so, it will be added to the heap again

Details A node is never added to the heap twice if h is admissible and monotonic for all nodes n for all edges h(n)  c + n Never becomes less accurate (more optimistic) as it nears a goal –Manhattan distance is monotonic –Book calls this condition “consistent”

Example: Non-Monotonic, Admissible Heuristic S AB G h=10 h=5h=9

Example: Non-Monotonic, Admissible Heuristic S AB G h=10 h=5h=9

Example: Non-Monotonic, Admissible Heuristic S AB G h=10 h=5h=9

Example: Non-Monotonic, Admissible Heuristic S AB G h=10 h=5h=9

Example: Non-Monotonic, Admissible Heuristic S AB G h=10 h=5h=9

Example: Non-Monotonic, Admissible Heuristic S AB G h=10 h=5h=9

Search and Reasoning State-space search can be viewed as a special kind of logical reasoning Explicitly representing problems logically, however, has many advantages: –Clarifies thinking –Increased expressivity –Tap into rich set of algorithms for logical inference

Reasoning and Search Logical reasoning can be viewed as a special kind of state space search –State = agent’s explicit beliefs –Operator = making a logical deduction Thinking in terms of state space search will help us understand how to create practical inference algorithms

Propositional Logic Sentence Translation N-Queens

Greedy Local Search state = start; while ! GoalTest(state) do state := arg min { h(s) | s in Neighbors(state) } end return state; Terminology: –“neighbors” instead of “children” –heuristic h(s) is the “objective function”, no need to be admissible No guarantee of finding a solution –sometimes: probabilistic guarantee Best goal-finding, not path-finding Many variations

N-Queens Local Search state = start; while ! GoalTest(state) do state := arg min { h(s) | s in Neighbors(state) } end return state; start = put down N queens randomly GoalTest = Board has no attacking pairs h = number of attacking pairs neighbors = move one queen randomly

N-Queens Local Search state = start; while ! GoalTest(state) do state := arg min { h(s) | s in Neighbors(state) } end return state; Alternative: start = put a queen on each square with 50% probability GoalTest = Board has N queens, no attacking pairs h = number of attacking pairs + | #queens – N | neighbors = add or delete one queen

Sudoku