Solving Problems by Searching. Artificial Intelligence Santa Clara University 2016

Size: px
Start display at page:

Download "Solving Problems by Searching. Artificial Intelligence Santa Clara University 2016"

Transcription

1 Solving Problems by Searching Artificial Intelligence Santa Clara University 2016

2 Problem Solving Agents Problem Solving Agents Use atomic representation of states Planning agents Use factored or structured states Uninformed search algorithms Algorithms only use state space Informed search algorithms Algorithms use some guidance where to find solution

3 Problem Solving Agents Problem formulation What actions and state to consider Goal formulation What is a desirable state

4 Problem Solving Agents First set of assumptions Environment is observable Agent knows current state Environment is discrete In any state, there are only a finite number of actions to be taken (and states to be reached) Environment is known Agent knows which states are reached by what action Environment is deterministic Each action has exactly one outcome

5 Problem solving agents Search: Looking for a sequence of actions that lead to the (a) goal Execution: Follow the sequence of actions Formulate - Search - Execute Notice: agent does not react to precepts during the execute phase Open loop system: loop between agent and environment is broken

6 Problem Solving Agents Well-defined problem 1. Initial state 2. Descriptions of actions 3. Transition model: Which action leads to what state 4. Goal test 5. Path cost

7 Recurring Sample Problem: Navigating Rumania 71 Oradea Neamt Zerind 140 Timisoara Fagaras 80 Rimnicu Vilcea 87 Iasi 92 Vaslui 111 Lugoj 97 Pitesti Drobeta Mehadia Bucharest 90 Craiova Giurgiu 98 Urziceni Hirsova 86 Eforie

8 A typical toy problem L R L R S S R R L R L R L L S S S S R L R L S S

9 Another toy problem Start State Goal State

10 Another toy problem

11 A simple real world problem Find a flight from A to B (with stop overs)

12 Uninformed Searching Uninformed searching Go through the search space looking for a state that fulfills the goal condition Search space represented as a graph of nodes Expand nodes (create all the neighbors of the current node)

13 Uniformed Searching State examples: 8-puzzle State given by a matrix with entries represents the blank space Note: for half of the initial states, there is no solution _goal_state = [[1,2,3], [4,5,6], [7,8,0]]

14 Uninformed Searching n - queens problem States are given by the position of j queens Each queen needs to be in a different column State given by an array (Python list) of j numbers Avoid generating states that are not legal def init (self, parent, move): self.parent = parent if parent: self.lista = parent.lista[:] else: self.lista = [] self.lista.append(move) def str (self): return "State "+str(self.lista) def test(self): #test whether any queen can take another one for col in range(0,len(self.lista)): row = self.lista[col] for j in range(len(self.lista)): if j == col: continue if self.lista[j] == row+j-col or self.lista[j] == row-j+col: return False return True

15 Uninformed Searching When generating nodes, can revisit the same node Repeated state Loopy path Search tree is then infinite, even though state space is finite Assuming going from one state to another incurs costs Assuming costs add up Then loopy paths never are cost-optimal

16 Uninformed Searching (a) (b) (c) Black: explored set discovered and expanded White: frontier discovered but not yet expanded Gray: unknown set not yet discovered

17 Example 71 Oradea Neamt Breadth first search: حفظنا اهلل منه Generate all accessible nodes in order until finding goal state Zerind 140 Timisoara Drobeta Fagaras 80 Rimnicu Vilcea Lugoj Mehadia 120 Pitesti Bucharest 90 Craiova Giurgiu 87 Iasi Urziceni Vaslui Hirsova 86 Eforie

18 Uninformed Searching Breadth first search Finds guaranteed a goal state if there is a path to the goal state Expand initial state, then the states expanded from it, then the states expanded from them, def bfs(instance): states = fifo(instance.initial) while states: current = states.pop(0) else: for state in current.neighbours(): if state.notmarked() and state.feasible(): if state.isgoal(): return state state.markvisited() states.append(state)

19 Uninformed Search BFS: Will find closest goal node Assume a branching factor of b Number of unexplored nodes reachable from a node during the breadth-first search Assume nearest goal state is at distance d from the initial state BFS creates b + b 2 + b b d = O(b d ) nodes

20 Uninformed Search BFS: Memory is stressed: too many nodes kept in fifo queue Time needs depends on the depth of the search

21 Uninformed Search Uniform cost search: Assume that all state transitions incur a cost g(node) = cost to reach node from initial node Expand the node n with the lowest path cost g(n) Apply goal test only when the node is expanded

22 Uninformed Search def uniformcostsearch(instance): frontier = priorityqueue(instance.initial, 0) explored = [] while frontier: current = frontier.pop() #get lowest cost node if current.isgoal(): print(current) #print out inverse path to goal for node in current.neighbours(): node.parent = current pathcost = current.cost + current.actioncost(node) if node in frontier and node.cost > pathcost: node.cost = pathcost #duplicate, update node.parent = current elif node not in frontier and node not in explored: frontier.insert(node) explored.append(current)

23 Group Quiz Apply Uniform Cost Search to go from to Bucharest 71 Oradea Neamt Zerind 140 Timisoara Fagaras 80 Rimnicu Vilcea 87 Iasi 92 Vaslui 111 Lugoj 97 Pitesti Drobeta Mehadia Bucharest 90 Craiova Giurgiu 98 Urziceni Hirsova 86 Eforie

24 Uninformed Search Depth First Search: Use stack instead of fifo in organizing the frontier def dfs(instance): states = lifo(instance.initial) while states: current = states.pop(0) else: for state in current.neighbours(): if state.notmarked() and state.feasible(): if state.isgoal(): return state state.markvisited() states.append(state)

25 Uninformed Search DFS will find a solution more quickly if they are lots of solutions at a certain depth. n-queens problem: n bfs dfs

26 Uninformed Search A A A B C B C B C D E F G H I J K L M N O D E F G H I J K L M N O D E F G H I J K L M N O A A A B C B C C D E F G H I J K L M N O D E F G I J K L M N O E F G J K L M N O A A C B C C E F G E F G F G J K L M N O K L M N O L M N O A A A C C C DFS on a F G L M N O F G L M N O F G M N O binary tree

27 Uninformed Search DFS works well if there are goal states at a limited depth but horribly if there are not Depth limited search If you don t find a goal, break off after reaching a maximum depth of d How do we determine d? Sometimes, the problem can tell us Iterative deepening depth first search

28 Uninformed Search Iterative deepening depth first search Do limited depth dfs Increase limit, if no solution found Why is this a good idea? We recreate parts of the previous search tree Repeated work is not a big portion of the total work done db +(d 1)b 2 +(d 2)b b d 1 +1b d = O(b d )

29 Uninformed Search Bidirectional Search Basic idea: Search from the initial state and from the goal state Success if you can connect Complexity O(bˆd/2) Start Goal

30 Informed Searches Use additional information Rumanian road map: Straight-line distance to goal 8-puzzle Sum of the Manhattan distance of current location of a piece to goal location of a piece n-queen problem Need to redefine states

31 Informed Search Tree search Expand nodes without regard whether expanded nodes have been visited Graph search Expand nodes but disregard explored nodes

32 Informed Search def treesearch(instance): frontier = [ instance.initial ] while frontier: current = frontier.pop() if current.isgoal(): return current else: for node in current.neighbor() node.parent = current frontier.push(node)

33 Informed Search def graphsearch(instance): explored = [] frontier = [instance.initial] while frontier: current = frontier.pop() if current.isgoal(): print( current ) explored.push(current) for node in current.neighbor(): if node not in explored and node not in frontier: node.parent = current frontier.push(node)

34 Informed Search Best-first search Do graph search Use a priority queue Have an evaluation function for each node

35 Informed Search Greedy first search: Expand nodes according to the best node Example: Use straight-line distance to the goal Bucharest Craiova Drobeta Eforie Fagaras Giurgiu Hirsova Iasi Lugoj Mehadia Neamt Oradea Pitesti Rimnicu Vilcea Timisoara Urziceni Vaslui Zerind

36 Informed Search (a) The initial state (b) After expanding 366 Timisoara Zerind (c) After expanding Timisoara 329 Zerind 374 Fagaras Oradea Rimnicu Vilcea (d) After expanding Fagaras Timisoara Zerind Fagaras Oradea Rimnicu Vilcea Bucharest 253 0

37 Informed Search Greedy best first search has difficulties Going from Iasi to Fagaras First expand Neamt This puts Iasi back into the frontier Can never consider Vaslui, because Vaslui is farther from Fagaras according to the heuristics Oradea 71 Neamt Zerind Fagaras 80 Timisoara Rimnicu Vilcea 111 Lugoj 70 Mehadia 75 Drobeta 120 Pitesti Bucharest 90 Craiova Giurgiu 87 Iasi Urziceni Vaslui Hirsova 86 Eforie

38 Informed Search Greedy best-first search Combine with graph search algorithm Do not consider repeated states Version is complete for finite trees

39 Informed Search A* search Evaluation function f for node n: g(n) cost of getting to node n h(n) heuristic for getting from node n to goal f(n) =g(n)+h(n)

40 Informed Search A* search When will A* be optimal? Heuristic needs to be admissible Never overestimate the costs to reach the goal from the current node Heuristic needs to be consistent (when using graph search) Estimated costs of reaching goal from n is less than or equal to the costs of going from n to successor n plus estimated costs of reaching the goal from n. 8n, 8n 0,n 0 successor of n h(n) apple costs(n, n 0 )+h(n 0 )

41 Informed Search Tree-version of A* is optimal if heuristic is admissible Graph version of A* is optimal if heuristic is consistent Clue: f-costs are nondecreasing on any path generated Can "prune" even neighbors of initial node

42 (a) The initial state (b) After expanding 366= = Timisoara 447= Zerind 449= (c) After expanding Timisoara Zerind 447= = Fagaras Oradea Rimnicu Vilcea 646= = = = (d) After expanding Rimnicu Vilcea Timisoara Zerind 447= = Fagaras Oradea 646= = = Rimnicu Vilcea Craiova Pitesti 526= = = (e) After expanding Fagaras Timisoara Zerind 447= = Fagaras Oradea Rimnicu Vilcea 646= = Bucharest Craiova Pitesti 591= = = = = (f) After expanding Pitesti Timisoara Zerind 447= = Fagaras Oradea Rimnicu Vilcea 646= = Bucharest Craiova Pitesti 591= = = = Bucharest Craiova Rimnicu Vilcea 418= = =

43 Informed Search A* expands nodes according to contours O Z N A T 380 S 400 R L F P I V D M C 420 G B U H E

44 Informed Search A* works well If there are many sub-optimal paths that are not quite a goal, then A* will explore many unnecessary spaces

45 Informed Search A* problems A* needs to maintain big arrays it never throws away a node runs out of memory before it runs out of user s patience

46 Informed Search Memory bounded A* variants Iterative deepening Cut-off consideration of nodes with f-value larger than a certain value If not successful, adjust cut-off point Can be difficult if f-values are floats

47 Informed Search Recursive best-first search Uses only linear space Uses an f-limit value to keep track of the best alternative path available

48 Informed Search RBFS Search f_limit on top heuristic on bottom (a) After expanding,, and Rimnicu Vilcea Fagaras Oradea Rimnicu Vilcea (b) After unwinding back to and expanding Fagaras Fagaras Oradea Rimnicu Vilcea Craiova Pitesti Timisoara Zerind Timisoara 447 Zerind Bucharest 450 (c) After switching back to Rimnicu Vilcea and expanding Pitesti Timisoara 447 Zerind Fagaras Oradea Rimnicu Vilcea Craiova Pitesti Bucharest Craiova Rimnicu Vilcea

49 Informed Search RBFS Search (a) Expand on best path unless the current best leaf (Pitesti) is worse than the best alternative value (Fagaras) Don t forget to update the value for Rimicu Vilcea (a) After expanding,, and Rimnicu Vilcea Fagaras Oradea Rimnicu Vilcea Fagaras Oradea Bucharest (b) After unwinding back to and expanding Fagaras 393 Rimnicu Vilcea (c) After switching back to Rimnicu Vilcea and expanding Pitesti Craiova Pitesti Timisoara Zerind Timisoara Zerind Timisoara 447 Zerind Fagaras Oradea Rimnicu Vilcea Craiova Pitesti Bucharest Craiova Rimnicu Vilcea

50 Informed Search RBFS Search (b) Unwind to This puts the best leaf value of the forgotten subtree in Rimnicu Vilcea. Expand Fagaras with best leaf value of 450 (a) After expanding,, and Rimnicu Vilcea Fagaras Oradea Rimnicu Vilcea (b) After unwinding back to and expanding Fagaras Fagaras Oradea Rimnicu Vilcea Craiova Pitesti Timisoara Zerind Timisoara 447 Zerind Bucharest 450 This is worse than 415 for Rimnicu Vilcea (c) After switching back to Rimnicu Vilcea and expanding Pitesti Fagaras Oradea Rimnicu Vilcea Craiova Pitesti Timisoara Zerind Bucharest Craiova Rimnicu Vilcea

51 Informed Search RBFS Search (c) Back up to after updating Fagaras Expand again RV Then expand Pitesti This time, we reach Bucharest, because the best alternative value (Timisoara) is worse (a) After expanding,, and Rimnicu Vilcea Fagaras Oradea Rimnicu Vilcea Fagaras Oradea Bucharest (b) After unwinding back to and expanding Fagaras Fagaras Oradea Rimnicu Vilcea (c) After switching back to Rimnicu Vilcea and expanding Pitesti Craiova Pitesti Rimnicu Vilcea Craiova Pitesti Timisoara Zerind Timisoara Zerind 449 Timisoara Zerind Bucharest Craiova Rimnicu Vilcea

52 Informed Search RBFS generates less nodes than IDA* In a sense, IDA* and RBFS throw away too much memory

53 Informed Search Memory bounded A* Simplified memory bounded A*

54 Informed Search Simplified memory bounded A* Do A* until algorithm runs out of memory Need to free a node Frees the node with the highest value of f After backing up the f-value to its parent If all the descendants of n are forgotten SMA* does not know where to go from n But SMA* knows whether n is worth while considering

55 Heuristics Example 8-puzzle Branching factor about 3 Depth about 22 Exhaustive tree search gives 3**22 ~3*10**10 moves Graph search has 9!/2 possible states Example 15-puzzle Graph search has 16!/2 = 10,461,394,944,000 states

56 Heuristics Heuristic may not overstate the true costs of moving to the goal state 1. Use number of misplaced tiles 2. Use the sum of the Manhattan distances of tiles in the actual state to the tiles in the goal state Start State Goal State

57 Heuristics 8-puzzle Second choice works better

58 Heuristics Relaxed search problems Instead of humans inventing heuristics Computer could generate heuristics by relaxing the rules of the game 8 puzzle: Allow tiles move to any position Second heuristic gives the costs to move to the goal in the relaxed version Automatic generation of heuristics Formulate the rules of the game Then relax automatically the rules Try out heuristics

59 Heuristics Pattern databases: Generate admissible heuristics from subproblems Start State Goal State Heuristic: Costs of moving 1,2,3,4 to a goal state

60 Heuristics Pattern databases: Use various heuristics 1,2,3,4 5,6,7,8 Pattern database stores the exact solution for a number of subproblems Disjoint pattern database Solve 1, 2, 3, 4 subproblem only counting the moves of tiles 1, 2, 3, or 4 Solve 5, 6, 7, 8 subproblem only contain the moves of tiles 5, 6, 7, or 8 Heuristic is the sum of both values

Informed Search and Exploration

Informed Search and Exploration Ch. 03b p.1/51 Informed Search and Exploration Sections 3.5 and 3.6 Nilufer Onder Department of Computer Science Michigan Technological University Ch. 03b p.2/51 Outline Best-first search A search Heuristics,

More information

Informed Search and Exploration

Informed Search and Exploration Ch. 03 p.1/47 Informed Search and Exploration Sections 3.5 and 3.6 Ch. 03 p.2/47 Outline Best-first search A search Heuristics, pattern databases IDA search (Recursive Best-First Search (RBFS), MA and

More information

Artificial Intelligence. Informed search methods

Artificial Intelligence. Informed search methods Artificial Intelligence Informed search methods In which we see how information about the state space can prevent algorithms from blundering about in the dark. 2 Uninformed vs. Informed Search Uninformed

More information

COMP9414/ 9814/ 3411: Artificial Intelligence. 5. Informed Search. Russell & Norvig, Chapter 3. UNSW c Alan Blair,

COMP9414/ 9814/ 3411: Artificial Intelligence. 5. Informed Search. Russell & Norvig, Chapter 3. UNSW c Alan Blair, COMP9414/ 9814/ 3411: Artificial Intelligence 5. Informed Search Russell & Norvig, Chapter 3. COMP9414/9814/3411 15s1 Informed Search 1 Search Strategies General Search algorithm: add initial state to

More information

Introduction to Artificial Intelligence. Informed Search

Introduction to Artificial Intelligence. Informed Search Introduction to Artificial Intelligence Informed Search Bernhard Beckert UNIVERSITÄT KOBLENZ-LANDAU Winter Term 2004/2005 B. Beckert: KI für IM p.1 Outline Best-first search A search Heuristics B. Beckert:

More information

Overview. Path Cost Function. Real Life Problems. COMP219: Artificial Intelligence. Lecture 10: Heuristic Search

Overview. Path Cost Function. Real Life Problems. COMP219: Artificial Intelligence. Lecture 10: Heuristic Search COMP219: Artificial Intelligence Lecture 10: Heuristic Search Overview Last time Depth-limited, iterative deepening and bi-directional search Avoiding repeated states Today Show how applying knowledge

More information

CS:4420 Artificial Intelligence

CS:4420 Artificial Intelligence CS:4420 Artificial Intelligence Spring 2018 Informed Search Cesare Tinelli The University of Iowa Copyright 2004 18, Cesare Tinelli and Stuart Russell a a These notes were originally developed by Stuart

More information

Problem solving and search

Problem solving and search Problem solving and search Chapter 3 Chapter 3 1 Outline Problem-solving agents Problem types Problem formulation Example problems Uninformed search algorithms Informed search algorithms Chapter 3 2 Restricted

More information

AGENTS AND ENVIRONMENTS. What is AI in reality?

AGENTS AND ENVIRONMENTS. What is AI in reality? AGENTS AND ENVIRONMENTS What is AI in reality? AI is our attempt to create a machine that thinks (or acts) humanly (or rationally) Think like a human Cognitive Modeling Think rationally Logic-based Systems

More information

Informed search algorithms. Chapter 4, Sections 1 2 1

Informed search algorithms. Chapter 4, Sections 1 2 1 Informed search algorithms Chapter 4, Sections 1 2 Chapter 4, Sections 1 2 1 Outline Best-first search A search Heuristics Chapter 4, Sections 1 2 2 Review: Tree search function Tree-Search( problem, fringe)

More information

Informed search algorithms

Informed search algorithms Informed search algorithms Chapter 4, Sections 1 2 Chapter 4, Sections 1 2 1 Outline Best-first search A search Heuristics Chapter 4, Sections 1 2 2 Review: Tree search function Tree-Search( problem, fringe)

More information

Solving Problems using Search

Solving Problems using Search Solving Problems using Search Artificial Intelligence @ Allegheny College Janyl Jumadinova September 11, 2018 Janyl Jumadinova Solving Problems using Search September 11, 2018 1 / 35 Example: Romania On

More information

COMP219: Artificial Intelligence. Lecture 10: Heuristic Search

COMP219: Artificial Intelligence. Lecture 10: Heuristic Search COMP219: Artificial Intelligence Lecture 10: Heuristic Search 1 Class Tests Class Test 1 (Prolog): Tuesday 8 th November (Week 7) 13:00-14:00 LIFS-LT2 and LIFS-LT3 Class Test 2 (Everything but Prolog)

More information

Artificial Intelligence, CS, Nanjing University Spring, 2018, Yang Yu. Lecture 3: Search 2.

Artificial Intelligence, CS, Nanjing University Spring, 2018, Yang Yu. Lecture 3: Search 2. Artificial Intelligence, CS, Nanjing University Spring, 2018, Yang Yu Lecture 3: Search 2 http://cs.nju.edu.cn/yuy/course_ai18.ashx Previously... function Tree-Search( problem, fringe) returns a solution,

More information

AGENTS AND ENVIRONMENTS. What is AI in reality?

AGENTS AND ENVIRONMENTS. What is AI in reality? AGENTS AND ENVIRONMENTS What is AI in reality? AI is our attempt to create a machine that thinks (or acts) humanly (or rationally) Think like a human Cognitive Modeling Think rationally Logic-based Systems

More information

COMP219: Artificial Intelligence. Lecture 10: Heuristic Search

COMP219: Artificial Intelligence. Lecture 10: Heuristic Search COMP219: Artificial Intelligence Lecture 10: Heuristic Search 1 Class Tests Class Test 1 (Prolog): Friday 17th November (Week 8), 15:00-17:00. Class Test 2 (Everything but Prolog) Friday 15th December

More information

Informed search algorithms

Informed search algorithms Artificial Intelligence Topic 4 Informed search algorithms Best-first search Greedy search A search Admissible heuristics Memory-bounded search IDA SMA Reading: Russell and Norvig, Chapter 4, Sections

More information

Solving Problems by Searching

Solving Problems by Searching Solving Problems by Searching CS486/686 University of Waterloo Sept 11, 2008 1 Outline Problem solving agents and search Examples Properties of search algorithms Uninformed search Breadth first Depth first

More information

CS486/686 Lecture Slides (c) 2015 P.Poupart

CS486/686 Lecture Slides (c) 2015 P.Poupart 1 2 Solving Problems by Searching [RN2] Sec 3.1-3.5 [RN3] Sec 3.1-3.4 CS486/686 University of Waterloo Lecture 2: May 7, 2015 3 Outline Problem solving agents and search Examples Properties of search algorithms

More information

CS486/686 Lecture Slides (c) 2014 P.Poupart

CS486/686 Lecture Slides (c) 2014 P.Poupart 1 2 1 Solving Problems by Searching [RN2] Sec 3.1-3.5 [RN3] Sec 3.1-3.4 CS486/686 University of Waterloo Lecture 2: January 9, 2014 3 Outline Problem solving agents and search Examples Properties of search

More information

Graphs vs trees up front; use grid too; discuss for BFS, DFS, IDS, UCS Cut back on A* optimality detail; a bit more on importance of heuristics,

Graphs vs trees up front; use grid too; discuss for BFS, DFS, IDS, UCS Cut back on A* optimality detail; a bit more on importance of heuristics, Graphs vs trees up front; use grid too; discuss for BFS, DFS, IDS, UCS Cut back on A* optimality detail; a bit more on importance of heuristics, performance data Pattern DBs? General Tree Search function

More information

Artificial Intelligence: Search Part 2: Heuristic search

Artificial Intelligence: Search Part 2: Heuristic search Artificial Intelligence: Search Part 2: Heuristic search Thomas Trappenberg January 16, 2009 Based on the slides provided by Russell and Norvig, Chapter 4, Section 1 2,(4) Outline Best-first search A search

More information

Artificial Intelligence CS 6364

Artificial Intelligence CS 6364 Artificial Intelligence CS 6364 Professor Dan Moldovan Section 4 Informed Search and Adversarial Search Outline Best-first search Greedy best-first search A* search Heuristics revisited Minimax search

More information

Foundations of Artificial Intelligence

Foundations of Artificial Intelligence Foundations of Artificial Intelligence 4. Informed Search Methods Heuristics, Local Search Methods, Genetic Algorithms Joschka Boedecker and Wolfram Burgard and Frank Hutter and Bernhard Nebel Albert-Ludwigs-Universität

More information

Robot Programming with Lisp

Robot Programming with Lisp 6. Search Algorithms Gayane Kazhoyan (Stuart Russell, Peter Norvig) Institute for University of Bremen Contents Problem Definition Uninformed search strategies BFS Uniform-Cost DFS Depth-Limited Iterative

More information

Informed Search Algorithms. Chapter 4

Informed Search Algorithms. Chapter 4 Informed Search Algorithms Chapter 4 Outline Informed Search and Heuristic Functions For informed search, we use problem-specific knowledge to guide the search. Topics: Best-first search A search Heuristics

More information

PEAS: Medical diagnosis system

PEAS: Medical diagnosis system PEAS: Medical diagnosis system Performance measure Patient health, cost, reputation Environment Patients, medical staff, insurers, courts Actuators Screen display, email Sensors Keyboard/mouse Environment

More information

Princess Nora University Faculty of Computer & Information Systems ARTIFICIAL INTELLIGENCE (CS 370D) Computer Science Department

Princess Nora University Faculty of Computer & Information Systems ARTIFICIAL INTELLIGENCE (CS 370D) Computer Science Department Princess Nora University Faculty of Computer & Information Systems ARTIFICIAL INTELLIGENCE (CS 370D) Computer Science Department (CHAPTER-3-PART3) PROBLEM SOLVING AND SEARCH Searching algorithm Uninformed

More information

COSC343: Artificial Intelligence

COSC343: Artificial Intelligence COSC343: Artificial Intelligence Lecture 18: Informed search algorithms Alistair Knott Dept. of Computer Science, University of Otago Alistair Knott (Otago) COSC343 Lecture 18 1 / 1 In today s lecture

More information

Informed search algorithms

Informed search algorithms CS 580 1 Informed search algorithms Chapter 4, Sections 1 2, 4 CS 580 2 Outline Best-first search A search Heuristics Hill-climbing Simulated annealing CS 580 3 Review: General search function General-Search(

More information

Week 3: Path Search. COMP9414/ 9814/ 3411: Artificial Intelligence. Motivation. Example: Romania. Romania Street Map. Russell & Norvig, Chapter 3.

Week 3: Path Search. COMP9414/ 9814/ 3411: Artificial Intelligence. Motivation. Example: Romania. Romania Street Map. Russell & Norvig, Chapter 3. COMP9414/9814/3411 17s1 Search 1 COMP9414/ 9814/ 3411: Artificial Intelligence Week 3: Path Search Russell & Norvig, Chapter 3. Motivation Reactive and Model-Based Agents choose their actions based only

More information

Artificial Intelligence

Artificial Intelligence Artificial Intelligence hapter 1 hapter 1 1 Iterative deepening search function Iterative-Deepening-Search( problem) returns a solution inputs: problem, a problem for depth 0 to do result Depth-Limited-Search(

More information

Problem solving and search

Problem solving and search Problem solving and search Chapter 3 TB Artificial Intelligence Slides from AIMA http://aima.cs.berkeley.edu 1 /1 Outline Problem-solving agents Problem types Problem formulation Example problems Basic

More information

4. Solving Problems by Searching

4. Solving Problems by Searching COMP9414/9814/3411 15s1 Search 1 COMP9414/ 9814/ 3411: Artificial Intelligence 4. Solving Problems by Searching Russell & Norvig, Chapter 3. Motivation Reactive and Model-Based Agents choose their actions

More information

PROBLEM SOLVING AND SEARCH IN ARTIFICIAL INTELLIGENCE

PROBLEM SOLVING AND SEARCH IN ARTIFICIAL INTELLIGENCE Artificial Intelligence, Computational Logic PROBLEM SOLVING AND SEARCH IN ARTIFICIAL INTELLIGENCE Lecture 3 Informed Search Sarah Gaggl Dresden, 22th April 2014 Agenda 1 Introduction 2 Uninformed Search

More information

CS414-Artificial Intelligence

CS414-Artificial Intelligence CS414-Artificial Intelligence Lecture 6: Informed Search Algorithms Waheed Noor Computer Science and Information Technology, University of Balochistan, Quetta, Pakistan Waheed Noor (CS&IT, UoB, Quetta)

More information

Informed Search and Exploration

Informed Search and Exploration Ch. 04 p.1/39 Informed Search and Exploration Chapter 4 Ch. 04 p.2/39 Outline Best-first search A search Heuristics IDA search Hill-climbing Simulated annealing Ch. 04 p.3/39 Review: Tree search function

More information

Outline. Informed search algorithms. Best-first search. Review: Tree search. A search Heuristics. Chapter 4, Sections 1 2 4

Outline. Informed search algorithms. Best-first search. Review: Tree search. A search Heuristics. Chapter 4, Sections 1 2 4 Outline Best-first search Informed search algorithms A search Heuristics Chapter 4, Sections 1 2 Chapter 4, Sections 1 2 1 Chapter 4, Sections 1 2 2 Review: Tree search function Tree-Search( problem, fringe)

More information

Solving Problems by Searching

Solving Problems by Searching Solving Problems by Searching Agents, Goal-Based Agents, Problem-Solving Agents Search Problems Blind Search Strategies Agents sensors environment percepts actions? agent effectors Definition. An agent

More information

Solving Problems by Searching

Solving Problems by Searching Solving Problems by Searching Agents, Goal-Based Agents, Problem-Solving Agents Search Problems Blind Search Strategies Agents sensors environment percepts actions? agent effectors Definition. An agent

More information

Artificial Intelligence

Artificial Intelligence Artificial Intelligence Academic year 2016/2017 Giorgio Fumera http://pralab.diee.unica.it fumera@diee.unica.it Pattern Recognition and Applications Lab Department of Electrical and Electronic Engineering

More information

Informed search methods

Informed search methods CS 2710 Foundations of AI Lecture 5 Informed search methods Milos Hauskrecht milos@pitt.edu 5329 Sennott Square Announcements Homework assignment 2 is out Due on Tuesday, September 19, 2017 before the

More information

Planning, Execution & Learning 1. Heuristic Search Planning

Planning, Execution & Learning 1. Heuristic Search Planning Planning, Execution & Learning 1. Heuristic Search Planning Reid Simmons Planning, Execution & Learning: Heuristic 1 Simmons, Veloso : Fall 2001 Basic Idea Heuristic Search Planning Automatically Analyze

More information

Foundations of Artificial Intelligence

Foundations of Artificial Intelligence Foundations of Artificial Intelligence 4. Informed Search Methods Heuristics, Local Search Methods, Genetic Algorithms Joschka Boedecker and Wolfram Burgard and Bernhard Nebel Albert-Ludwigs-Universität

More information

Artificial Intelligence, CS, Nanjing University Spring, 2018, Yang Yu. Lecture 2: Search 1.

Artificial Intelligence, CS, Nanjing University Spring, 2018, Yang Yu. Lecture 2: Search 1. rtificial Intelligence, S, Nanjing University Spring, 2018, Yang Yu Lecture 2: Search 1 http://lamda.nju.edu.cn/yuy/course_ai18.ashx Problem in the lecture 7 2 4 51 2 3 5 6 4 5 6 8 3 1 7 8 Start State

More information

TDT4136 Logic and Reasoning Systems

TDT4136 Logic and Reasoning Systems TDT4136 Logic and Reasoning Systems Chapter 3 & 4.1 - Informed Search and Exploration Lester Solbakken solbakke@idi.ntnu.no Norwegian University of Science and Technology 18.10.2011 1 Lester Solbakken

More information

Searching and NetLogo

Searching and NetLogo Searching and NetLogo Artificial Intelligence @ Allegheny College Janyl Jumadinova September 6, 2018 Janyl Jumadinova Searching and NetLogo September 6, 2018 1 / 21 NetLogo NetLogo the Agent Based Modeling

More information

Foundations of Artificial Intelligence

Foundations of Artificial Intelligence Foundations of Artificial Intelligence 16. State-Space Search: Greedy BFS, A, Weighted A Malte Helmert University of Basel March 28, 2018 State-Space Search: Overview Chapter overview: state-space search

More information

Introduction to Artificial Intelligence (G51IAI)

Introduction to Artificial Intelligence (G51IAI) Introduction to Artificial Intelligence (G51IAI) Dr Rong Qu Heuristic Searches Blind Search vs. Heuristic Searches Blind search Randomly choose where to search in the search tree When problems get large,

More information

Informed Search and Exploration

Informed Search and Exploration Informed Search and Exploration Chapter 4 (4.1-4.3) CS 2710 1 Introduction Ch.3 searches good building blocks for learning about search But vastly inefficient eg: Can we do better? Breadth Depth Uniform

More information

16.1 Introduction. Foundations of Artificial Intelligence Introduction Greedy Best-first Search 16.3 A Weighted A. 16.

16.1 Introduction. Foundations of Artificial Intelligence Introduction Greedy Best-first Search 16.3 A Weighted A. 16. Foundations of Artificial Intelligence March 28, 2018 16. State-Space Search: Greedy BFS, A, Weighted A Foundations of Artificial Intelligence 16. State-Space Search: Greedy BFS, A, Weighted A Malte Helmert

More information

Problem solving and search

Problem solving and search Problem solving and search Chapter 3 Chapter 3 1 How to Solve a (Simple) Problem 7 2 4 1 2 5 6 3 4 5 8 3 1 6 7 8 Start State Goal State Chapter 3 2 Introduction Simple goal-based agents can solve problems

More information

Artificial Intelligence

Artificial Intelligence Artificial Intelligence Search Marc Toussaint University of Stuttgart Winter 2015/16 (slides based on Stuart Russell s AI course) Outline Problem formulation & examples Basic search algorithms 2/100 Example:

More information

Lecture Plan. Best-first search Greedy search A* search Designing heuristics. Hill-climbing. 1 Informed search strategies. Informed strategies

Lecture Plan. Best-first search Greedy search A* search Designing heuristics. Hill-climbing. 1 Informed search strategies. Informed strategies Lecture Plan 1 Informed search strategies (KA AGH) 1 czerwca 2010 1 / 28 Blind vs. informed search strategies Blind search methods You already know them: BFS, DFS, UCS et al. They don t analyse the nodes

More information

Outline. Best-first search

Outline. Best-first search Outline Best-first search Greedy best-first search A* search Heuristics Admissible Heuristics Graph Search Consistent Heuristics Local search algorithms Hill-climbing search Beam search Simulated annealing

More information

Problem solving and search

Problem solving and search Problem solving and search hapter 3 hapter 3 1 Outline Problem-solving agents Problem types Problem formulation Example problems asic search algorithms hapter 3 3 Restricted form of general agent: Problem-solving

More information

Seminar: Search and Optimization

Seminar: Search and Optimization Seminar: Search and Optimization 4. asic Search lgorithms Martin Wehrle Universität asel October 4, 2012 asics lind Search lgorithms est-first Search Summary asics asics lind Search lgorithms est-first

More information

Summary. Search CSL302 - ARTIFICIAL INTELLIGENCE 1

Summary. Search CSL302 - ARTIFICIAL INTELLIGENCE 1 Summary Search CSL302 - ARTIFICIAL INTELLIGENCE 1 Informed Search CHAPTER 3 Informed (Heuristic) Search qheuristic problem-specific knowledge ofinds solutions more efficiently qnew terms o!(#): cost from

More information

Artificial Intelligence: Search Part 1: Uninformed graph search

Artificial Intelligence: Search Part 1: Uninformed graph search rtificial Intelligence: Search Part 1: Uninformed graph search Thomas Trappenberg January 8, 2009 ased on the slides provided by Russell and Norvig, hapter 3 Search outline Part 1: Uninformed search (tree

More information

Automated Planning & Artificial Intelligence

Automated Planning & Artificial Intelligence Automated Planning & Artificial Intelligence Uninformed and Informed search in state space Humbert Fiorino Humbert.Fiorino@imag.fr http://membres-lig.imag.fr/fiorino Laboratory of Informatics of Grenoble

More information

Informed Search. Topics. Review: Tree Search. What is Informed Search? Best-First Search

Informed Search. Topics. Review: Tree Search. What is Informed Search? Best-First Search Topics Informed Search Best-First Search Greedy Search A* Search Sattiraju Prabhakar CS771: Classes,, Wichita State University 3/6/2005 AI_InformedSearch 2 Review: Tree Search What is Informed Search?

More information

Contents. Foundations of Artificial Intelligence. General Algorithm. Best-First Search

Contents. Foundations of Artificial Intelligence. General Algorithm. Best-First Search Contents Foundations of Artificial Intelligence 4. Informed Search Methods Heuristics, Local Search Methods, Genetic Algorithms Wolfram Burgard, Bernhard Nebel, and Martin Riedmiller Albert-Ludwigs-Universität

More information

CS-E4800 Artificial Intelligence

CS-E4800 Artificial Intelligence CS-E4800 Artificial Intelligence Jussi Rintanen Department of Computer Science Aalto University January 12, 2017 Transition System Models The decision-making and planning at the top-level of many intelligent

More information

Route planning / Search Movement Group behavior Decision making

Route planning / Search Movement Group behavior Decision making Game AI Where is the AI Route planning / Search Movement Group behavior Decision making General Search Algorithm Design Keep a pair of set of states: One, the set of states to explore, called the open

More information

CS 771 Artificial Intelligence. Informed Search

CS 771 Artificial Intelligence. Informed Search CS 771 Artificial Intelligence Informed Search Outline Review limitations of uninformed search methods Informed (or heuristic) search Uses problem-specific heuristics to improve efficiency Best-first,

More information

CS 380: Artificial Intelligence Lecture #4

CS 380: Artificial Intelligence Lecture #4 CS 380: Artificial Intelligence Lecture #4 William Regli Material Chapter 4 Section 1-3 1 Outline Best-first search Greedy best-first search A * search Heuristics Local search algorithms Hill-climbing

More information

Informed search. Soleymani. CE417: Introduction to Artificial Intelligence Sharif University of Technology Spring 2016

Informed search. Soleymani. CE417: Introduction to Artificial Intelligence Sharif University of Technology Spring 2016 Informed search CE417: Introduction to Artificial Intelligence Sharif University of Technology Spring 2016 Soleymani Artificial Intelligence: A Modern Approach, Chapter 3 Outline Best-first search Greedy

More information

Lecture 4: Informed/Heuristic Search

Lecture 4: Informed/Heuristic Search Lecture 4: Informed/Heuristic Search Outline Limitations of uninformed search methods Informed (or heuristic) search uses problem-specific heuristics to improve efficiency Best-first A* RBFS SMA* Techniques

More information

Ar#ficial)Intelligence!!

Ar#ficial)Intelligence!! Introduc*on! Ar#ficial)Intelligence!! Roman Barták Department of Theoretical Computer Science and Mathematical Logic Uninformed (blind) search algorithms can find an (optimal) solution to the problem,

More information

Outline. Solving Problems by Searching. Introduction. Problem-solving agents

Outline. Solving Problems by Searching. Introduction. Problem-solving agents Outline Solving Problems by Searching S/ University of Waterloo Sept 7, 009 Problem solving agents and search Examples Properties of search algorithms Uninformed search readth first Depth first Iterative

More information

Artificial Intelligence. 2. Informed Search

Artificial Intelligence. 2. Informed Search Artificial Intelligence Artificial Intelligence 2. Informed Search Lars Schmidt-Thieme Information Systems and Machine Learning Lab (ISMLL) Institute of Economics and Information Systems & Institute of

More information

Lars Schmidt-Thieme, Information Systems and Machine Learning Lab (ISMLL), University of Hildesheim, Germany, Course on Artificial Intelligence,

Lars Schmidt-Thieme, Information Systems and Machine Learning Lab (ISMLL), University of Hildesheim, Germany, Course on Artificial Intelligence, Course on Artificial Intelligence, winter term 2012/2013 0/25 Artificial Intelligence Artificial Intelligence 2. Informed Search Lars Schmidt-Thieme Information Systems and Machine Learning Lab (ISMLL)

More information

Artificial Intelligence

Artificial Intelligence Artificial Intelligence Informed Search and Exploration Chapter 4 (4.1 4.2) A General Search algorithm: Chapter 3: Search Strategies Task : Find a sequence of actions leading from the initial state to

More information

Informed search algorithms

Informed search algorithms Informed search algorithms This lecture topic Chapter 3.5-3.7 Next lecture topic Chapter 4.1-4.2 (Please read lecture topic material before and after each lecture on that topic) Outline Review limitations

More information

HW#1 due today. HW#2 due Monday, 9/09/13, in class Continue reading Chapter 3

HW#1 due today. HW#2 due Monday, 9/09/13, in class Continue reading Chapter 3 9-04-2013 Uninformed (blind) search algorithms Breadth-First Search (BFS) Uniform-Cost Search Depth-First Search (DFS) Depth-Limited Search Iterative Deepening Best-First Search HW#1 due today HW#2 due

More information

Informed Search Methods

Informed Search Methods Informed Search Methods How can we improve searching strategy by using intelligence? Map example: Heuristic: Expand those nodes closest in as the crow flies distance to goal 8-puzzle: Heuristic: Expand

More information

Outline. Best-first search

Outline. Best-first search Outline Best-first search Greedy best-first search A* search Heuristics Local search algorithms Hill-climbing search Beam search Simulated annealing search Genetic algorithms Constraint Satisfaction Problems

More information

Problem Solving and Search. Geraint A. Wiggins Professor of Computational Creativity Department of Computer Science Vrije Universiteit Brussel

Problem Solving and Search. Geraint A. Wiggins Professor of Computational Creativity Department of Computer Science Vrije Universiteit Brussel Problem Solving and Search Geraint A. Wiggins Professor of Computational Creativity Department of Computer Science Vrije Universiteit Brussel What is problem solving? An agent can act by establishing goals

More information

Informed search algorithms

Informed search algorithms Informed search algorithms This lecture topic Chapter 3.5-3.7 Next lecture topic Chapter 4.1-4.2 (Please read lecture topic material before and after each lecture on that topic) Outline Review limitations

More information

Informed Search Lecture 5

Informed Search Lecture 5 Lecture 5 How can we exploit problem-specific knowledge to find solutions more efficiently? Where does this knowledge come from and under what conditions is it useful? 1 Agenda Review: Uninformed Search

More information

Artificial Intelligence

Artificial Intelligence Artificial Intelligence CSC348 Unit 3: Problem Solving and Search Syedur Rahman Lecturer, CSE Department North South University syedur.rahman@wolfson.oxon.org Artificial Intelligence: Lecture Notes The

More information

Outline for today s lecture. Informed Search I. One issue: How to search backwards? Very briefly: Bidirectional search. Outline for today s lecture

Outline for today s lecture. Informed Search I. One issue: How to search backwards? Very briefly: Bidirectional search. Outline for today s lecture Outline for today s lecture Informed Search I Uninformed Search Briefly: Bidirectional Search (AIMA 3.4.6) Uniform Cost Search (UCS) Informed Search Introduction to Informed search Heuristics 1 st attempt:

More information

CS:4420 Artificial Intelligence

CS:4420 Artificial Intelligence S:4420 rtificial Intelligence Spring 2018 Uninformed Search esare Tinelli The University of Iowa opyright 2004 18, esare Tinelli and Stuart Russell a a These notes were originally developed by Stuart Russell

More information

Artificial Intelligence

Artificial Intelligence Artificial Intelligence Jeff Clune Assistant Professor Evolving Artificial Intelligence Laboratory AI Challenge One Transform to graph Explore the graph, looking for? dust unexplored squares Some good

More information

Planning and search. Lecture 1: Introduction and Revision of Search. Lecture 1: Introduction and Revision of Search 1

Planning and search. Lecture 1: Introduction and Revision of Search. Lecture 1: Introduction and Revision of Search 1 Planning and search Lecture 1: Introduction and Revision of Search Lecture 1: Introduction and Revision of Search 1 Lecturer: Natasha lechina email: nza@cs.nott.ac.uk ontact and web page web page: http://www.cs.nott.ac.uk/

More information

Clustering (Un-supervised Learning)

Clustering (Un-supervised Learning) Clustering (Un-supervised Learning) Partition-based clustering: k-mean Goal: minimize sum of square of distance o Between each point and centers of the cluster. o Between each pair of points in the cluster

More information

Problem Solving and Search. Chapter 3

Problem Solving and Search. Chapter 3 Problem olving and earch hapter 3 Outline Problem-solving agents Problem formulation Example problems asic search algorithms In the simplest case, an agent will: formulate a goal and a problem; Problem-olving

More information

Informed (heuristic) search (cont). Constraint-satisfaction search.

Informed (heuristic) search (cont). Constraint-satisfaction search. CS 1571 Introduction to AI Lecture 5 Informed (heuristic) search (cont). Constraint-satisfaction search. Milos Hauskrecht milos@cs.pitt.edu 539 Sennott Square Administration PS 1 due today Report before

More information

Search. Intelligent agents. Problem-solving. Problem-solving agents. Road map of Romania. The components of a problem. that will take me to the goal!

Search. Intelligent agents. Problem-solving. Problem-solving agents. Road map of Romania. The components of a problem. that will take me to the goal! Search Intelligent agents Reflex agent Problem-solving agent T65 rtificial intelligence and Lisp Peter alenius petda@ida.liu.se epartment of omputer and Information Science Linköping University Percept

More information

Informed Search. Notes about the assignment. Outline. Tree search: Reminder. Heuristics. Best-first search. Russell and Norvig chap.

Informed Search. Notes about the assignment. Outline. Tree search: Reminder. Heuristics. Best-first search. Russell and Norvig chap. Notes about the assignment Informed Search Russell and Norvig chap. 4 If it says return True or False, return True or False, not "True" or "False Comment out or remove print statements before submitting.

More information

DIT411/TIN175, Artificial Intelligence. Peter Ljunglöf. 19 January, 2018

DIT411/TIN175, Artificial Intelligence. Peter Ljunglöf. 19 January, 2018 DIT411/TIN175, Artificial Intelligence Chapter 3: Classical search algorithms CHAPTER 3: CLASSICAL SEARCH ALGORITHMS DIT411/TIN175, Artificial Intelligence Peter Ljunglöf 19 January, 2018 1 DEADLINE FOR

More information

Algorithm. December 7, Shortest path using A Algorithm. Phaneendhar Reddy Vanam. Introduction. History. Components of A.

Algorithm. December 7, Shortest path using A Algorithm. Phaneendhar Reddy Vanam. Introduction. History. Components of A. December 7, 2011 1 2 3 4 5 6 7 The A is a best-first search algorithm that finds the least cost path from an initial configuration to a final configuration. The most essential part of the A is a good heuristic

More information

Problem Solving and Search

Problem Solving and Search Artificial Intelligence Problem Solving and Search Dae-Won Kim School of Computer Science & Engineering Chung-Ang University Outline Problem-solving agents Problem types Problem formulation Example problems

More information

A.I.: Informed Search Algorithms. Chapter III: Part Deux

A.I.: Informed Search Algorithms. Chapter III: Part Deux A.I.: Informed Search Algorithms Chapter III: Part Deux Best-first search Greedy best-first search A * search Heuristics Outline Overview Informed Search: uses problem-specific knowledge. General approach:

More information

Informed Search (Ch )

Informed Search (Ch ) Informed Search (Ch. 3.5-3.6) Informed search In uninformed search, we only had the node information (parent, children, cost of actions) Now we will assume there is some additional information, we will

More information

Problem-solving agents. Solving Problems by Searching. Outline. Example: Romania. Chapter 3

Problem-solving agents. Solving Problems by Searching. Outline. Example: Romania. Chapter 3 Problem-solving agents olving Problems by earching hapter 3 function imple-problem-olving-gent( percept) returns an action static: seq, an action sequence, initially empty state, some description of the

More information

Searching becomes much more demanding:

Searching becomes much more demanding: Searching becomes much more demanding: If S has n nodes, then its B can have up to 2 n 1. If S is infinite, then even B 0 and other nodes of B can be infinite too. Generating successors(b) could involve

More information

Solving problems by searching

Solving problems by searching Solving problems by searching CE417: Introduction to Artificial Intelligence Sharif University of Technology Spring 2014 Soleymani Artificial Intelligence: A Modern Approach, Chapter 3 Outline Problem-solving

More information

Solving problems by searching

Solving problems by searching Solving problems by searching Chapter 3 Some slide credits to Hwee Tou Ng (Singapore) Outline Problem-solving agents Problem types Problem formulation Example problems Basic search algorithms Heuristics

More information

Problem solving and search: Chapter 3, Sections 1 5

Problem solving and search: Chapter 3, Sections 1 5 Problem solving and search: hapter 3, Sections 1 5 1 Outline Problem-solving agents Problem types Problem formulation Example problems asic search algorithms 2 Problem-solving agents estricted form of

More information