C M M Awais (LUMS)1 SEARCH METHODS State space search Heuristic search.

Slides:



Advertisements
Similar presentations
BEST FIRST SEARCH - BeFS
Advertisements

Artificial Intelligence: Knowledge Representation
Solving problems by searching
Review: Search problem formulation
Informed Search Algorithms
Heuristic Search techniques
Informed search algorithms
Artificial Intelligence By Mr. Ejaz CIIT Sahiwal.
A* Search. 2 Tree search algorithms Basic idea: Exploration of state space by generating successors of already-explored states (a.k.a.~expanding states).
CSC411Artificial Intelligence 1 Chapter 3 Structures and Strategies For Space State Search Contents Graph Theory Strategies for Space State Search Using.
PROBLEM SOLVING AND SEARCH
Problem Solving by Searching Copyright, 1996 © Dale Carnegie & Associates, Inc. Chapter 3 Spring 2007.
Solving Problem by Searching
Formal Description of a Problem
State Space Search Classic AI.
Part2 AI as Representation and Search
Implementation and Evaluation of Search Methods. Use a stack data structure. 1. Push root node of tree on the stack. 2. Pop the top node off the stack.
Depth-First and Breadth-First Search In addition to specifying a search direction (data-driven or goal-driven), a search algorithm must determine the order.
Problem Solving by Searching Copyright, 1996 © Dale Carnegie & Associates, Inc. Chapter 3 Spring 2004.
UnInformed Search What to do when you don’t know anything.
Nyhoff, ADTs, Data Structures and Problem Solving with C++, Second Edition, © 2005 Pearson Education, Inc. All rights reserved Graphs.
Using Search in Problem Solving
Problem Solving and Search in AI Heuristic Search
Using Search in Problem Solving
Graphs & Graph Algorithms Nelson Padua-Perez Bill Pugh Department of Computer Science University of Maryland, College Park.
CISC220 Fall 2009 James Atlas Nov 13: Graphs, Line Intersections.
For Friday Finish chapter 3 Homework: –Chapter 3, exercise 6 –May be done in groups. –Clarification on part d: an “action” must be running the program.
Solving Problems by Searching
Artificial Intelligence Course outline Introduction Problem solving Generic algorithms Knowledge Representation and Reasoning Expert Systems Uncertainty.
3.0 State Space Representation of Problems 3.1 Graphs 3.2 Formulating Search Problems 3.3 The 8-Puzzle as an example 3.4 State Space Representation using.
Formal Description of a Problem In AI, we will formally define a problem as –a space of all possible configurations where each configuration is called.
State Space Search. State Space representation of a problem is a graph  Nodes correspond to problem states  Arcs correspond to steps in a solution process.
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.
CS.462 Artificial Intelligence SOMCHAI THANGSATHITYANGKUL Lecture 02 : Search.
Discrete Structures Lecture 12: Trees Ji Yanyan United International College Thanks to Professor Michael Hvidsten.
Search exploring the consequences of possible actions.
Vilalta&Eick:Uninformed Search Problem Solving By Searching Introduction Solutions and Performance Uninformed Search Strategies Avoiding Repeated States/Looping.
For Friday Finish reading chapter 4 Homework: –Lisp handout 4.
Search exploring the consequences of possible actions.
Lecture 3: Uninformed Search
For Friday Read chapter 4, sections 1 and 2 Homework –Chapter 3, exercise 7 –May be done in groups.
Basic Problem Solving Search strategy  Problem can be solved by searching for a solution. An attempt is to transform initial state of a problem into some.
Goal-based Problem Solving Goal formation Based upon the current situation and performance measures. Result is moving into a desirable state (goal state).
1 search CS 331/531 Dr M M Awais REPRESENTATION METHODS Represent the information: Animals are generally divided into birds and mammals. Birds are further.
Search Techniques CS480/580 Fall Introduction Trees: – Root, parent, child, sibling, leaf node, node, edge – Single path from root to any node Graphs:
Introduction to Artificial Intelligence (G51IAI) Dr Rong Qu Blind Searches - Introduction.
Introduction to State Space Search
Trees CSIT 402 Data Structures II 1. 2 Why Do We Need Trees? Lists, Stacks, and Queues are linear relationships Information often contains hierarchical.
Brute Force and Exhaustive Search Brute Force and Exhaustive Search Traveling Salesman Problem Knapsack Problem Assignment Problem Selection Sort and Bubble.
Brute Force and Exhaustive Search Brute Force and Exhaustive Search Traveling Salesman Problem Knapsack Problem Assignment Problem Selection Sort and Bubble.
Chapter 3 Solving problems by searching. Search We will consider the problem of designing goal-based agents in observable, deterministic, discrete, known.
Solving problems by searching Chapter 3. Types of agents Reflex agent Consider how the world IS Choose action based on current percept Do not consider.
Lecture 3: Uninformed Search
Solving problems by searching
BackTracking CS255.
Breadth First and Depth First
Csc 2720 Instructor: Zhuojun Duan
Introduction to Artificial Intelligence
Problem Solving by Searching
Spanning Trees Longin Jan Latecki Temple University based on slides by
Graphs Chapter 13.
SOLVING PROBLEMS BY SEARCHING
What to do when you don’t know anything know nothing
Searching for Solutions
Blay Whitby 2003 Search Blay Whitby 2003
A General Backtracking Algorithm
HW 1: Warmup Missionaries and Cannibals
Spanning Trees Longin Jan Latecki Temple University based on slides by
ARTIFICIAL INTELLIGENCE
HW 1: Warmup Missionaries and Cannibals
Presentation transcript:

c M M Awais (LUMS)1 SEARCH METHODS State space search Heuristic search

c M M Awais (LUMS)2 SEARCH Introduction:- If the general idea and action is known The actions that lead to solution is not known search methods can be applied examples:- Systematical steps that lead to prove certain theorems Sequence of steps that solve a puzzle

c M M Awais (LUMS)3 BASIC METHODS (Through all possible actions) Initial State Target State Background Material required is “GRAPH THEORY”

c M M Awais (LUMS)4 TYPICAL EXAMPLES OF SEARCH PROBLEMS Toy Problem (The 8 puzzle) Route Finding Traveling Save Person Robot Navigation Assembly Sequencing

c M M Awais (LUMS)5 Eight Puzzle Problem

c M M Awais (LUMS)6 Route Finding Problem

c M M Awais (LUMS)7 Suppose Initial State is Library Goal State is University Possible Route ? Problem is simple so all possible paths can be searched systematically to reach the goal Library via Hospital via newsagent to University What happens if search space is complex ?

c M M Awais (LUMS)8 ANALYSIS OF SEARCH STRATEGIES Completeness: is the strategy guaranteed to find a solution where there is one? Time Complexity:How long does it take to find a solution? Space Complexity:How much memory does it need to perform the search? Optimality:Does the strategy find the highest quality solution when there are several different solutions?

c M M Awais (LUMS)9 Exhaustive Search One can systematically check every state that is reachable from initial state to end out if it is a goal state. Search Space The set of all states is the search space For simple/small search space exhaustive search is applicable [BRUTE FORCE or BLIND SEARCH] For complex search space HEURISTIC SEARCH is used

c M M Awais (LUMS)10 GRAPHS AND TREES Graphs:- Consist of a set of nodes with links between them links can be directed / undirected Path is the sequence of nodes connected nodes via links. Acyclic graphs = (Paths linking a node with itself are absent) Trees???

c M M Awais (LUMS)11 Tree:- A tree is a special kind of graph with only one path to each node, usually represented with a special root node at the top Relationship between nodes Parent Children Sibling Ancestor Node,Descendant Node,Leaf Node

c M M Awais (LUMS)12 Graphs VS Trees Compare the searches in the two (which is efficient) a b c d a b c d e f g

c M M Awais (LUMS)13 Type of searches What is the value of profit if sales,employees, expenses etc., are given?. For a given profit what level of sales,employees, expenses etc., are required

c M M Awais (LUMS)14 STRATEGIES FOR STATE SPACE SEARCH DATA DRIVEN SEARCH (Forward Chaining) Start with some given facts Set of legal moves are given Search proceeds by applying rules to facts to generate new facts Process continues unless goal is reached

c M M Awais (LUMS)15 Goal - Driven Search(Backward Chaining) Take the goal Find what conditions or rules can produce or generate the goal Apply the conditions to generate subgoals Continue until the goal is reached

c M M Awais (LUMS)16 Types: Breadth First/Depth First

c M M Awais (LUMS)17 Example: Map Problem-1

c M M Awais (LUMS)18 Example: Map Problem -2

c M M Awais (LUMS)19 1.Start with queue = [initial - state] and found = FALSE 2.While queue not empty and not found do: (a)Remove the first node n from queue (b)if N is a goal state then found = TRUE (c )Find all the successor nodes of X, and put them on the end of the queue Breath First

c M M Awais (LUMS)20

c M M Awais (LUMS)21 1.Open = [A]; closed = [] 2. Open = [B,C,D]; closed = [A] 3. Open = [C,D,E,F]; closed = [A,B] 4. Open = [D,E,F,G,H]; closed = [C,B,A] 5. Open = [E,F,G,H,I,J]; closed = [D,C,B,A] 6. Open = [F,G,H,I,J,K,L]; closed = [E,D,C,B,A] 7. Open = [G,H,I,J,K,L,M]; closed = [F,E,D,C,B,A] 8. Open = [H,I,J,K,L,M,N]; closed = [G,F,E,D,C,B,A] 9. And so on until either U is found or open = []

c M M Awais (LUMS)22 1.Start with agenda = [initial - state] and found = FALSE 2.While agenda not empty and not found do: (a)Remove the first node N from agenda (b)if N is not in visited then (I)Add N to visited (II)if N is a goal state then found = TRUE (III)Put N’s successors on the front of the stack Depth First

c M M Awais (LUMS)23 Example

c M M Awais (LUMS)24 1.Open = [A]; closed = [] 2. Open = [B,C,D]; closed = [A] 3. Open = [E,F, C,D]; closed = [B,A] 4. Open = [K,L,F,C,D]; closed = [E,B,A] 5. Open = [S,L,F,C,D]; closed = [K,E,B,A] 6. Open = [L,F,C,D]; closed = [S,K,E,B,A] 7. Open = [T,F,C,D]; closed = [L,S,K,E,B,A] 8. Open = [F,C,D]; closed = [T,L,S,K,E,B,A] 9. Open = [M,C,D]as L is already on closed; closed = [F,T,L,S,K,E,B,A] 10. Open = [C,D]; closed = [M,F,T,L,S,K,E,B,A] 11. Open = [G.H.D]; closed = [C,M,F,T,L,S,K,E,B,A]