Artificial Intelligence Lecture No. 8 Dr. Asad Ali Safi ​ Assistant Professor, Department of Computer Science, COMSATS Institute of Information Technology.

Slides:



Advertisements
Similar presentations
Review: Search problem formulation
Advertisements

Informed Search Algorithms
Notes Dijstra’s Algorithm Corrected syllabus.
Informed search strategies
Solving Problem by Searching
1 Heuristic Search Chapter 4. 2 Outline Heuristic function Greedy Best-first search Admissible heuristic and A* Properties of A* Algorithm IDA*
Properties of breadth-first search Complete? Yes (if b is finite) Time? 1+b+b 2 +b 3 +… +b d + b(b d -1) = O(b d+1 ) Space? O(b d+1 ) (keeps every node.
Search Strategies CPS4801. Uninformed Search Strategies Uninformed search strategies use only the information available in the problem definition Breadth-first.
Artificial Intelligence Lecture No. 7 Dr. Asad Safi ​ Assistant Professor, Department of Computer Science, COMSATS Institute of Information Technology.
Artificial Intelligence Lecture
Problem Solving by Searching
CPSC 322 Introduction to Artificial Intelligence October 27, 2004.
SE Last time: Problem-Solving Problem solving: Goal formulation Problem formulation (states, operators) Search for solution Problem formulation:
Review: Search problem formulation
Artificial Intelligence
CS 460 Spring 2011 Lecture 3 Heuristic Search / Local Search.
Problem Solving and Search in AI Heuristic Search
CSC344: AI for Games Lecture 4: Informed search
CS 561, Session 6 1 Last time: Problem-Solving Problem solving: Goal formulation Problem formulation (states, operators) Search for solution Problem formulation:
Informed search algorithms
Problem Solving and Search Andrea Danyluk September 11, 2013.
Dr.Abeer Mahmoud ARTIFICIAL INTELLIGENCE (CS 461D) Dr. Abeer Mahmoud Computer science Department Princess Nora University Faculty of Computer & Information.
INTRODUÇÃO AOS SISTEMAS INTELIGENTES Prof. Dr. Celso A.A. Kaestner PPGEE-CP / UTFPR Agosto de 2011.
Informed search algorithms
Informed search algorithms
January 31, 2006AI: Chapter 4: Informed Search and Exploration 1 Artificial Intelligence Chapter 4: Informed Search and Exploration Michael Scherger Department.
Informed search algorithms Chapter 4. Outline Best-first search Greedy best-first search A * search Heuristics.
CHAPTER 4: INFORMED SEARCH & EXPLORATION Prepared by: Ece UYKUR.
1 Shanghai Jiao Tong University Informed Search and Exploration.
Informed search algorithms Chapter 4. Best-first search Idea: use an evaluation function f(n) for each node –estimate of "desirability"  Expand most.
ISC 4322/6300 – GAM 4322 Artificial Intelligence Lecture 3 Informed Search and Exploration Instructor: Alireza Tavakkoli September 10, 2009 University.
Informed search strategies Idea: give the algorithm “hints” about the desirability of different states – Use an evaluation function to rank nodes and select.
Informed searching. Informed search Blind search algorithms do not consider any information about the states and the goals Often there is extra knowledge.
Informed Search Methods. Informed Search  Uninformed searches  easy  but very inefficient in most cases of huge search tree  Informed searches  uses.
Informed Search Strategies Lecture # 8 & 9. Outline 2 Best-first search Greedy best-first search A * search Heuristics.
Search with Costs and Heuristic Search 1 CPSC 322 – Search 3 January 17, 2011 Textbook §3.5.3, Taught by: Mike Chiang.
Chapter 4 Informed/Heuristic Search
Review: Tree search Initialize the frontier using the starting state While the frontier is not empty – Choose a frontier node to expand according to search.
Advanced Artificial Intelligence Lecture 2: Search.
Princess Nora University Artificial Intelligence Chapter (4) Informed search algorithms 1.
CSC3203: AI for Games Informed search (1) Patrick Olivier
Computer Science CPSC 322 Lecture 6 Iterative Deepening and Search with Costs (Ch: 3.7.3, 3.5.3)
Informed Search I (Beginning of AIMA Chapter 4.1)
1 Kuliah 4 : Informed Search. 2 Outline Best-First Search Greedy Search A* Search.
Search (continued) CPSC 386 Artificial Intelligence Ellen Walker Hiram College.
Informed Search and Heuristics Chapter 3.5~7. Outline Best-first search Greedy best-first search A * search Heuristics.
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:
Informed Search II CIS 391 Fall CIS Intro to AI 2 Outline PART I  Informed = use problem-specific knowledge  Best-first search and its variants.
3.5 Informed (Heuristic) Searches This section show how an informed search strategy can find solution more efficiently than uninformed strategy. Best-first.
Chapter 3.5 and 3.6 Heuristic Search Continued. Review:Learning Objectives Heuristic search strategies –Best-first search –A* algorithm Heuristic functions.
G5AIAI Introduction to AI Graham Kendall Heuristic Searches.
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.
CMPT 463. What will be covered A* search Local search Game tree Constraint satisfaction problems (CSP)
Chapter 3 Solving problems by searching. Search We will consider the problem of designing goal-based agents in observable, deterministic, discrete, known.
Chapter 3.5 Heuristic Search. Learning Objectives Heuristic search strategies –Best-first search –A* algorithm Heuristic functions.
Review: Tree search Initialize the frontier using the starting state
Last time: Problem-Solving
Artificial Intelligence Problem solving by searching CSC 361
Discussion on Greedy Search and A*
Discussion on Greedy Search and A*
CS 4100 Artificial Intelligence
Informed search algorithms
Informed search algorithms
Artificial Intelligence
Informed search algorithms
Artificial Intelligence
Informed Search.
Presentation transcript:

Artificial Intelligence Lecture No. 8 Dr. Asad Ali Safi ​ Assistant Professor, Department of Computer Science, COMSATS Institute of Information Technology (CIIT) Islamabad, Pakistan.

Summary of Previous Lecture Types of search Algorithms Uninformed Search Informed Search Breadth-first searching Depth-first search

Today’s Lecture Informed (Heuristic) search Heuristic evaluation function Greedy Best-First Search A* Search

Informed (Heuristic) search Heuristic search is an AI search technique that employs heuristic for its moves.AI search Heuristic is a rule of thumb that probably leads to a solution. Heuristics play a major role in search strategies because of exponential nature of the most problems. Heuristics help to reduce the number of alternatives from an exponential number to a polynomial number.

Heuristic search In Artificial Intelligence, heuristic search has a general meaning, and a more specialized technical meaning.Artificial Intelligence In a general sense, the term heuristic is used for any advice that is often effective, but is not guaranteed to work in every case. Within the heuristic search architecture, however, the term heuristic usually refers to the special case of a heuristic evaluation function.heuristic evaluation function

Heuristic information In order to solve larger problems, domain- specific knowledge must be added to improve search efficiency. Information about the problem include the nature of states, cost of transforming from one state to another, and characteristics of the goals. This information can often be expressed in the form of heuristic evaluation function, say f(n,g), a function of the nodes n and/or the goals g.

Heuristic evaluation function Heuristic evaluation function estimates the cost of an optimal path between a pair of states in a single-agent path-finding problem,. For example, Euclidean or airline distance is an estimate of the highway distance between a pair of locations.

Manhattan Distance Manhattan distance is a common heuristic function for the sliding-tile puzzles. Manhattan distance is computed by counting the number of moves along the grid that each tile is displaced from its goal position, and summing these values over all faces.

Heuristic evaluation function For a fixed goal state, a heuristic evaluation is a function of a node, say h(n), that estimates the distance from node, say n to the given state. h(n) = estimated cost of the cheapest path from node n to a goal node There is a whole family of Best-First Search algorithms with different evaluation functions – Each has a heuristic function h(n)

Following is a list of heuristic search techniques… Greedy best-first search A* search Recursive best-first search Pure Heuristic Search Iterative-Deepening A* Depth-First Branch-And-Bound Heuristic Path Algorithm

Greedy Best-First Search Greedy Best-First search tries to expand the node that is closest to the goal assuming it will lead to a solution quickly – f(n) = h(n) – “Greedy Search” to refer specifically to a search with a heuristic that attempts to predict how close the end of a path is to a solution, so that paths which are judged to be closer to a solution are extended first. This specific type of search is called greedy best-first search. Implementation – expand the “most desirable” node into the fringe queue – sort the queue in decreasing order of desirability Example: consider the straight-line distance heuristic h SLD – Expand the node that appears to be closest to the goal

Greedy Best-First Search

h SLD (In(Arid)) = 366 Notice that the values of h SLD cannot be computed from the problem itself It takes some experience to know that h SLD is correlated with actual road distances – Therefore a useful heuristic

Greedy Best-First Search

Complete – No, GBFS can get stuck in loops (e.g. bouncing back and forth between cities) Time – O(b m ) but a good heuristic can have dramatic improvement Space – O(b m ) – keeps all the nodes in memory Optimal – No!

Robot Navigation

f(N) = h(N), with h(N) = Manhattan distance to the goal

Robot Navigation f(N) = h(N), with h(N) = Manhattan distance to the goal 7 0 What happened???

A* Search A* algorithm is a best-first search algorithm in which the cost associated with a node is f(n) = g(n) + h(n), where g(n) is the cost of the path from the initial state to node n and h(n) is the heuristic estimate or the cost or a path from node n to a goal. Thus, f(n) estimates the lowest total cost of any solution path going through node n. At each point a node with lowest f value is chosen for expansion. Ties among nodes of equal f value should be broken in favor of nodes with lower h values. The algorithm terminates when a goal is chosen for expansion.

A* Search A* (A star) is the most widely known in AI – It evaluates nodes by combining g(n) and h(n) – f(n) = g(n) + h(n) – Where g(n) = cost so far to reach n h(n) = estimated cost to goal from n f(n) = estimated total cost of path through n

A* Search When h(n) = actual cost to goal – Only nodes in the correct path are expanded – Optimal solution is found When h(n) < actual cost to goal – Additional nodes are expanded – Optimal solution is found When h(n) > actual cost to goal – Optimal solution can be overlooked

Greedy Best-First Search

A* Search

A* expands nodes in increasing f value – Gradually adds f-contours of nodes (like breadth- first search adding layers) – Contour i has all nodes f=f i where f i < f i+1

A* Search Complete – Yes, unless there are infinitely many nodes with f <= f(G) Time – Exponential in [relative error of h x length of soln] – The better the heuristic, the better the time Best case h is perfect, O(d) Worst case h = 0, O(b d ) same as BFS Space – Keeps all nodes in memory and save in case of repetition – This is O(b d ) or worse – A* usually runs out of space before it runs out of time Optimal – Yes, cannot expand f i+1 unless f i is finished

Once more We kept looking at nodes closer and closer to the goal, but were accumulating costs as we got further from the initial state Our goal is not to minimize the distance from the current head of our path to the goal, we want to minimize the overall length of the path to the goal! Let g(N) be the cost of the best path found so far between the initial node and N f(N) = g(N) + h(N)

Robot Navigation f(N) = g(N)+h(N), with h(N) = Manhattan distance to goal

Complexity Of Finding Optimal Solutions The time complexity of a heuristic search algorithm depends on the accuracy of the heuristic function. For example, if the heuristic evaluation function is an exact estimator, then A* search algorithm runs in linear time, expanding only those nodes on an optimal solution path. Conversely, with a heuristic that returns zero everywhere, A* algorithm becomes uniform-cost search, which has exponential complexity.

Summery of Today’s Lecture Informed (Heuristic) search Heuristic evaluation function Greedy Best-First Search A* Search