Blay Whitby 2003 blayw@sussex.ac.uk Search Blay Whitby 2003 blayw@sussex.ac.uk.

Slides:



Advertisements
Similar presentations
Heuristic Search techniques
Advertisements

State Space Representation and Search
Ch 4. Heuristic Search 4.0 Introduction(Heuristic)
CSC411Artificial Intelligence 1 Chapter 3 Structures and Strategies For Space State Search Contents Graph Theory Strategies for Space State Search Using.
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.
Traveling Salesperson Problem
State Space 3 Chapter 4 Heuristic Search. Three Algorithms Backtrack Depth First Breadth First All work if we have well-defined: Goal state Start state.
Part2 AI as Representation and Search
5-1 Chapter 5 Tree Searching Strategies. 5-2 Satisfiability problem Tree representation of 8 assignments. If there are n variables x 1, x 2, …,x n, then.
Search Techniques MSc AI module. Search In order to build a system to solve a problem we need to: Define and analyse the problem Acquire the knowledge.
CS 484 – Artificial Intelligence1 Announcements Department Picnic: today, after class Lab 0 due today Homework 2 due Tuesday, 9/18 Lab 1 due Thursday,
Chapter 4 Search Methodologies.
Search: Representation and General Search Procedure Jim Little UBC CS 322 – Search 1 September 10, 2014 Textbook § 3.0 –
Mahgul Gulzai Moomal Umer Rabail Hafeez
MAE 552 – Heuristic Optimization Lecture 27 April 3, 2002
Using Search in Problem Solving
Uninformed Search Reading: Chapter 3 by today, Chapter by Wednesday, 9/12 Homework #2 will be given out on Wednesday DID YOU TURN IN YOUR SURVEY?
Using Search in Problem Solving
HEURISTIC SEARCH. Luger: Artificial Intelligence, 5 th edition. © Pearson Education Limited, 2005 Portion of the state space for tic-tac-toe.
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.
WAES 3308 Numerical Methods for AI
CS 415 – A.I. Slide Set 5. Chapter 3 Structures and Strategies for State Space Search – Predicate Calculus: provides a means of describing objects and.
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.
Search exploring the consequences of possible actions.
For Friday Finish reading chapter 4 Homework: –Lisp handout 4.
For Monday Read chapter 4, section 1 No homework..
Search exploring the consequences of possible actions.
Lecture 3: Uninformed Search
1 Solving problems by searching 171, Class 2 Chapter 3.
1 Branch and Bound Searching Strategies Updated: 12/27/2010.
For Friday Read chapter 4, sections 1 and 2 Homework –Chapter 3, exercise 7 –May be done in groups.
Informed Search I (Beginning of AIMA Chapter 4.1)
Knowledge Search CPTR 314.
Search Techniques CS480/580 Fall Introduction Trees: – Root, parent, child, sibling, leaf node, node, edge – Single path from root to any node Graphs:
For Monday Read chapter 4 exercise 1 No homework.
Chapter 3 Solving problems by searching. Search We will consider the problem of designing goal-based agents in observable, deterministic, discrete, known.
Artificial Intelligence Solving problems by searching.
Dept. Computer Science, Korea Univ. Intelligent Information System Lab A I (Artificial Intelligence) Professor I. J. Chung.
Lecture 3: Uninformed Search
Adversarial Search and Game-Playing
Problem Representation and Problem-solving Strategies.
Review: Tree search Initialize the frontier using the starting state
Traveling Salesperson Problem
Problem Solving Agents
Last time: Problem-Solving
Heuristic Search A heuristic is a rule for choosing a branch in a state space search that will most likely lead to a problem solution Heuristics are used.
Problem Solving by Searching
Informed Search and Exploration
Artificial Intelligence Problem solving by searching CSC 361
Algorithms for Exploration
HW #1 Due 29/9/2008 Write Java Applet to solve Goats and Cabbage “Missionaries and cannibals” problem with the following search algorithms: Breadth first.
Finding Heuristics Using Abstraction
Searching for Solutions
Informed search algorithms
BEST FIRST SEARCH -OR Graph -A* Search -Agenda Search CSE 402
CSE (c) S. Tanimoto, 2001 Search-Introduction
Branch and Bound Searching Strategies
CO Games Development 1 Week 8 Depth-first search, Combinatorial Explosion, Heuristics, Hill-Climbing Gareth Bellaby.
CPSC 322 Introduction to Artificial Intelligence
CSE (c) S. Tanimoto, 2002 State-Space Search
State-Space Searches.
State-Space Searches.
Search.
CSE (c) S. Tanimoto, 2004 State-Space Search
Search.
Tree Searching Strategies
Reading: Chapter 4.5 HW#2 out today, due Oct 5th
State-Space Searches.
Lecture 4: Tree Search Strategies
Supplemental slides for CSE 327 Prof. Jeff Heflin
Presentation transcript:

Blay Whitby 2003 blayw@sussex.ac.uk Search Blay Whitby 2003 blayw@sussex.ac.uk

Knowledge Representation Spot the Connection… Chippenham, Wiltshire April 17th 1960. Finding routes, making plans, Deep Blue. One greater than two (if you believe in integer theory). 21/02/2019 Knowledge Representation

Knowledge Representation Jargon State Space or Problem Space ALL the steps achievable in a particular problem Search Space Those steps achievable GIVEN an initial start state and operators for moving between states [usually a directed graph] 21/02/2019 Knowledge Representation

Knowledge Representation Jargon… Directed Graph A graph in which the ARCS are directional and may rejoin as opposed to a: Tree A Special case of a directed graph in which each NODE may have several descendants, but only one ancestor. 21/02/2019 Knowledge Representation

Knowledge Representation State Space Search A general problem solving technique, the basis of: Game playing Planning Natural Language Processing Theorem proving The main step forward in 50’s – 60’s AI 21/02/2019 Knowledge Representation

Knowledge Representation State Space Search Represent the problem as a space of possibilities Solving the problem is then a matter of ‘finding’ if one of these possibilities is the solution. There are many techniques for doing this. 21/02/2019 Knowledge Representation

Knowledge Representation Trees Root Root node Arcs Goal ‘Daughter’ nodes Nodes 21/02/2019 Knowledge Representation

Knowledge Representation How to Grow a Tree Most problems have: A start state A possible solution (or goal) Possible transitions (or legal moves) 21/02/2019 Knowledge Representation

Knowledge Representation How to Grow a Tree Problem: Build a tower of bricks 5cm high from any of 4 bricks: 1cm, 2cm, 3cm & 4cm high. Start state: No bricks at all Possible transitions: Add any one brick, provided it is not already on the pile. Goal: 5cm pile of bricks 21/02/2019 Knowledge Representation

Tower of Bricks Search space tree [ ] [1] [2] [3] [4] [2,1] [2,3] [2,4] [4,1] [4,2] [4,3] [1,2] [1,3] [1,4] [3,1] [3,2] [3,4] [1,2,3] [1,2,4] Note 4 paths to goal [1,2,3,4] 21/02/2019 Knowledge Representation

State Space Representation of Predicate Calculus q r u v t s qp t r r p s u v q s s r t p q r p a b Q Λ r p a V b p Luger & Stubblefield pp. 100-101. 21/02/2019 Knowledge Representation

Knowledge Representation Implementation Most search programs use lists: [a,b,c,d,e] It is important to know if a state has already been visited, so two lists are needed: Considered – states already looked at – closed Alternatives – generated but not yet examined – open Generating and examining these lists is an algorithmic procedure 21/02/2019 Knowledge Representation

Generate & Test Algorithm Generate a possible solution (legal move) Test to see if this is the goal (or 1 of a set of end states) If goal then STOP else return to 1 21/02/2019 Knowledge Representation

Knowledge Representation Search Strategies Depth First: Explore one path at a time to final node or goal. Breadth First: Explore all nodes that are one step away until all visited or goal found. Exhaustive search strategies. They will find a solution if one exists. As such they may be inefficient and need to be limited 21/02/2019 Knowledge Representation

More efficient Strategies For most non-trivial problems exhaustive search is not practicable e.g., Chess (2.5x10154) Many techniques exist to reduce the need to explore unpromising parts of the search space Take into account how much effort has been made in getting this far or how near we think we are to the goal: or, best, both. 21/02/2019 Knowledge Representation

Best First and Hill Climbing Best First: Explore the most promising node first. Hill Climbing:Explore the daughter of the most promising node first. To do this we need a static evaluation function: measure of how good this node is, without looking ahead or: An heuristic* evaluation function? * rule of thumb 21/02/2019 Knowledge Representation

Knowledge Representation Branch and Bound Consider the ‘cost’ of getting to a node Euston Vic. Charing X Northern Oxford Circus Vic. Warren St. Northern Warren St. Vic. Vic. Vic. Green Pk. 2 5 1 4 Here ‘cost’ = travelling time between nodes 21/02/2019 Knowledge Representation

Knowledge Representation Branch and Bound Good in that it guarantees an ‘optimal path’ but: Poor in that it will explore ‘pointless’ options because it is unguided. 21/02/2019 Knowledge Representation

Knowledge Representation A* Algorithm Requires an evaluation of the cost so far (K) and a heuristic (guess) of how close we are to the goal (>K) Where: g(n)=cost of best path from start to n h(n)=estimate of cost of best path to goal from n. Evaluate nodes and always choose lowest f value 21/02/2019 Knowledge Representation

Knowledge Representation A* Algorithm If will find the lowest cost path. Where: h*(n) is the actual cost to goal. In other words: The heuristic must underestimate the cost to goal The closer the heuristic is to the real costs, the more effective is the search. 21/02/2019 Knowledge Representation

Knowledge Representation The 8 Puzzle Tiles 1 3 4 6 8 7 5 2 Represent as a list [1,3,4,6,8,7,hole,5,2] 21/02/2019 Knowledge Representation

Knowledge Representation State Representation 1 4 3 2 8 7 5 6 = [1,4,3,2,8,hole,7,5,6] 1 4 2 8 3 7 5 6 = [1,4,hole,2,8,3,7,5,6] 21/02/2019 Knowledge Representation

Knowledge Representation Program run: 21/02/2019 Knowledge Representation

First 4 layers of search tree 21/02/2019 Knowledge Representation

Comparison of search methods Source Thornton & DuBoulay (1992) 21/02/2019 Knowledge Representation

Comparison of search methods 21/02/2019 Knowledge Representation