Best-First Search! Minimizing Space or Time!! RBFS! Save space, take more time!

Size: px
Start display at page:

Download "Best-First Search! Minimizing Space or Time!! RBFS! Save space, take more time!"

Transcription

1 Best-First Search! Minimizing Space or Time!! RBFS! Save space, take more time! RBFS-1

2 RBFS general properties! Similar to A* algorithm developed for heuristic search! RBFS-2

3 RBFS general properties 2! Similar to A* algorithm developed for heuristic search!» Both are recursive in the same sense! RBFS-3

4 RBFS general properties 3! Similar to A* algorithm developed for heuristic search!» Both are recursive in the same sense! Difference between A* and RBFS! RBFS-4

5 RBFS general properties 3! Similar to A* algorithm developed for heuristic search!» Both are recursive in the same sense! Difference between A* and RBFS!» A* keeps in memory all of the already generated nodes! RBFS-5

6 RBFS general properties 4! Similar to A* algorithm developed for heuristic search!» Both are recursive in the same sense! Difference between A* and RBFS!» A* keeps in memory all of the already generated nodes!» RBFS only keeps the current search path and the sibling nodes along the path! RBFS-6

7 RBFS space 2!» When does RBFS suspend the search of a subtree?! RBFS-7

8 RBFS space 3!» When does RBFS suspend the search of a subtree?! > When it no longer looks the best! RBFS-8

9 RBFS space 3!» When does RBFS suspend the search of a subtree?! > When it no longer looks the best!» What does it do when a subtree is suspended?! RBFS-9

10 RBFS space 3!» When does RBFS suspend the search of a subtree?! > When it no longer looks the best!» What does it do when a subtree is suspended?! > It forgets the subtree to save space! RBFS-10

11 RBFS space 4!» When does RBFS suspend the search of a subtree?! > When it no longer looks the best!» What does it do when a subtree is suspended?! > It forgets the subtree to save space!» What is the space complexity?! RBFS-11

12 RBFS space 5!» When does RBFS suspend the search of a subtree?! > When it no longer looks the best!» What does it do when a subtree is suspended?! > It forgets the subtree to save space!» What is the space complexity?! > Linear the depth of the search! RBFS-12

13 RBFS space 6!» When does RBFS suspend the search of a subtree?! > When it no longer looks the best!» What does it do when a subtree is suspended?! > It forgets the subtree to save space!» What is the space complexity?! > Linear the depth of the search! Same as IDA* RBFS-13

14 RBFS memory!» When RBFS suspends searching a subtree, what does it remember?! RBFS-14

15 RBFS memory 2!» When RBFS suspends searching a subtree, what does it remember?! > An updated f-value of the root of the subtree! RBFS-15

16 Updated f-values!» How does RBFS update the f-values?! RBFS-16

17 Updated f-values 2!» How does RBFS update the f-values?! > Backing up the f-values in the same way as A* does! RBFS-17

18 f-value notation! Static f-value!» f(n)! > Value returned by the evaluation function! > Always the same! RBFS-18

19 f-value notation 2! Static f-value!» f(n)! > Value returned by the evaluation function! > Always the same! Backed-up value!» F(N)! > Changes during the search! Depends upon descendants of N RBFS-19

20 F(N) definition! RBFS backs up f-values in the same way as A*!» How is F(N) defined?! RBFS-20

21 F(N) definition 2! RBFS backs up f-values in the same way as A*!» How is F(N) defined?! > If N has never been expanded?! RBFS-21

22 F(N) definition 3! RBFS backs up f-values in the same way as A*!» How is F(N) defined?! > If N has never been expanded?! F(N) = f(n) RBFS-22

23 F(N) definition 4! RBFS backs up f-values in the same way as A*!» How is F(N) defined?! > If N has never been expanded?! F(N) = f(n) > If N has been expanded?! RBFS-23

24 F(N) definition 5! RBFS backs up f-values in the same way as A*!» How is F(N) defined?! > If N has never been expanded?! F(N) = f(n)! > If N has been expanded?! f ( T ) = min ( F ( S j ) ) Where S j are the subtrees of N RBFS-24

25 Subtree exploration!» How does RBFS explore subtrees?! RBFS-25

26 Subtree exploration 2!» How does RBFS explore subtrees?! > As in A*, within a given f-bound! RBFS-26

27 Subtree exploration 3!» How does RBFS explore subtrees?! > As in A*, within a given f-bound!» How is the bound determined?! RBFS-27

28 RBFS subtree exploration 4!» How does RBFS explore subtrees?! > As in A*, within a given f-bound!» How is the bound determined?! > From the F-values of the siblings along the current search path! RBFS-28

29 Subtree exploration 5!» How does RBFS explore subtrees?! > As in A*, within a given f-bound!» How is the bound determined?! > From the F-values of the siblings along the current search path! > The smallest F-value! The closest competitor RBFS-29

30 Subtree exploration 6! Suppose N is currently the best node! RBFS-30

31 Subtree exploration 7! Suppose N is currently the best node! > N is expanded! RBFS-31

32 Subtree exploration 8! Suppose N is currently the best node! > N is expanded! > N s children are expanded! RBFS-32

33 Subtree exploration 9! Suppose N is currently the best node! > N is expanded! > N s children are expanded!» Until when?! RBFS-33

34 Subtree exploration 10! Suppose N is currently the best node! > N is expanded! > N s children are expanded!» Until when?! > F(N) > Bound! RBFS-34

35 Subtree exploration 10! Suppose N is currently the best node! > N is expanded! > N s children are expanded!» Until when?! > F(N) > Bound!» Then what happens?! RBFS-35

36 Subtree exploration 11! Suppose N is currently the best node! > N is expanded! > N s children are expanded!» Until when?! > F(N) > Bound!» Then what happens?! > Nodes below N are forgotten! RBFS-36

37 Subtree exploration 12! Suppose N is currently the best node! > N is expanded! > N s children are expanded!» Until when?! > F(N) > Bound!» Then what happens?! > Nodes below N are forgotten! > N s F-value is updated! RBFS-37

38 Subtree exploration 13! Suppose N is currently the best node! > N is expanded! > N s children are expanded!» Until when?! > F(N) > Bound!» Then what happens?! > Nodes below N are forgotten! > N s F-value is updated! > RBFS selects which node to expand next! RBFS-38

39 F-value inheritance! F-values can be inherited from a node s parents! RBFS-39

40 F-value inheritance 2! F-values can be inherited from a node s parents! Let N be a node about to be expanded! RBFS-40

41 F-value inheritance 3! F-values can be inherited from a node s parents! Let N be a node about to be expanded!» If F(N) > f(n) then N had already been expanded! RBFS-41

42 F-value inheritance 4! F-values can be inherited from a node s parents! Let N be a node about to be expanded!» If F(N) > f(n) then N had already been expanded!» F(N) was determined from N s children! RBFS-42

43 F-value inheritance 5! F-values can be inherited from a node s parents! Let N be a node about to be expanded!» If F(N) > f(n) then N had already been expanded!» F(N) was determined from N s children!» Children have been removed from memory! RBFS-43

44 F-value inheritance 6! F-values can be inherited from a node s parents! Let N be a node about to be expanded!» If F(N) > f(n) then N had already been expanded!» F(N) was determined from N s children!» Children have been removed from memory! Suppose a child N k of N is generated again! RBFS-44

45 F-value inheritance 7! F-values can be inherited from a node s parents! Let N be a node about to be expanded!» If F(N) > f(n) then N had already been expanded!» F(N) was determined from N s children!» Children have been removed from memory! Suppose a child N k of N is generated again!» Compute f(n k )! RBFS-45

46 F-value inheritance 8! F-values can be inherited from a node s parents! Let N be a node about to be expanded!» If F(N) > f(n) then N had already been expanded!» F(N) was determined from N s children!» Children have been removed from memory! Suppose a child N k of N is generated again!» Compute f(n k )!» F(N k ) = max ( F(N), f(n k ) )! RBFS-46

47 F-value inheritance 9! F-values can be inherited from a node s parents! Let N be a node about to be expanded!» If F(N) > f(n) then N had already been expanded!» F(N) was determined from N s children!» Children have been removed from memory! Suppose a child N k of N is generated again!» Compute f(n k )!» F(N k ) = max ( F(N), f(n k ) )! > N k s F-value can be inherited from N! RBFS-47

48 F-value inheritance 10! F-values can be inherited from a node s parents! Let N be a node about to be expanded!» If F(N) > f(n) then N had already been expanded!» F(N) was determined from N s children!» Children have been removed from memory! Suppose a child N k of N is generated again!» Compute f(n k )!» F(N k ) = max ( F(N), f(n k ) )! > N k s F-value can be inherited from N! N k was generated earlier RBFS-48

49 F-value inheritance 11! F-values can be inherited from a node s parents! Let N be a node about to be expanded!» If F(N) > f(n) then N had already been expanded!» F(N) was determined from N s children!» Children have been removed from memory! Suppose a child N k of N is generated again!» Compute f(n k )!» F(N k ) = max ( F(N), f(n k ) )! > N k s F-value can be inherited from N! N k was generated earlier F(N k ) was F(N), otherwise F(N) would be smaller RBFS-49

50 Fig 12.2 snapshots! S = A E 2 9 = = B F 2 11 = = C G 3 11 = = D 3 T 11 = S f = 7 f = 9 A E S is expanded!! A is found to be the best child! f(n) in mocha = g(n) in clover + h(n) in magenta RBFS-50

51 Fig 12.2 snapshots 2! S = A E 2 9 = = B F 2 11 = = C G 3 11 = = D 3 T 11 = S f = 7 f = 9 A E f = 8 f = 10 B C A is expanded with bound 9!! C has F-value 10!! Stop expansion, backup F value! f(n) in mocha = g(n) in clover + h(n) in magenta RBFS-51

52 Fig 12.2 snapshots 3! S = A E 2 9 = = B F 2 11 = = C G 3 11 = = D 3 T 11 = S f = 10 f = 9 A E Forget expansion from A!! A has backed up F value 10!! E is best to expand next! f(n) in mocha = g(n) in clover + h(n) in magenta RBFS-52

53 Fig 12.2 snapshots 4! S = A E 2 9 = = B F 2 11 = = C G 3 11 = = D 3 T 11 = S f = 10 f = 9 A E F f = 11 E is expanded with bound 10!! F has F-value 11!! Stop expansion, backup F value! f(n) in mocha = g(n) in clover + h(n) in magenta RBFS-53

54 Fig 12.2 snapshots 5! S = A E 2 9 = = B F 2 11 = = C G 3 11 = = D 3 T 11 = S f = 10 f = 11 A E Forget expansion from E!! E has backed up F value 11!! A is best to expand next! f(n) in mocha = g(n) in clover + h(n) in magenta RBFS-54

55 Fig 12.2 snapshots 6! S = A E 2 9 = = B F 2 11 = = C G 3 11 = = D 3 T 11 = S f = 10 f = 11 A E f = 10 f = 10 f = 12 B C D When B and C are! regenerated, they! inherit F value 10 from! the parent! A is expanded with bound 11!! D has F-value 12!! Stop expansion, backup F value! f(n) in mocha = g(n) in clover + h(n) in magenta RBFS-55

56 Fig 12.2 snapshots 7! S = A E 2 9 = = B F 2 11 = = C G 3 11 = = D 3 T 11 = S f = 12 f = 11 A E Forget expansion from A!! A has backed up F value 12!! E is best to expand next! f(n) in mocha = g(n) in clover + h(n) in magenta RBFS-56

57 Fig 12.2 snapshots 8! S S 7 = A 2 2 E A E f = 11 8 = = = = B F 2 11 = C G 3 11 = D 3 T 11 = T F G f = 11 f = 11 f = 11 E is expanded with bound 12!! Reach goal, search ends! f(n) in mocha = g(n) in clover + h(n) in magenta RBFS-57

58 Algorithm! Function NewF (N, F(N), Bound)! If F(N) > Bound then NewF := F(N)! else if goal(n) then exit search with success! else if N has no children then NewF := infinity! else! dead end! for each child N k of N do!!if f(n) < F(N) then F(N k ) := max( F(N), Ff(N k ))!!else F(N k ) := f(n k )!!sort children N k in increasing order of F-value!!while F(N 1 ) Bound and F(N 1 ) < infinity do!! Bound1 := min(bound, F-value of N 2!! F(N 1 ) := NewF(N 1, F(N 1 ), Bound1)!! reorder nodes N 1, N 2, according to new F(N 1 )!!end!!newf := F(N 1 )! RBFS-58

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

This lecture. Lecture 6: Search 5. Other Time and Space Variations of A* Victor R. Lesser. RBFS - Recursive Best-First Search Algorithm

This lecture. Lecture 6: Search 5. Other Time and Space Variations of A* Victor R. Lesser. RBFS - Recursive Best-First Search Algorithm Lecture 6: Search 5 Victor R. Lesser CMPSCI 683 Fall 2010 This lecture Other Time and Space Variations of A* Finish off RBFS SMA* Anytime A* RTA* (maybe if have time) RBFS - Recursive Best-First Search

More information

Search : Lecture 2. September 9, 2003

Search : Lecture 2. September 9, 2003 Search 6.825: Lecture 2 September 9, 2003 1 Problem-Solving Problems When your environment can be effectively modeled as having discrete states and actions deterministic, known world dynamics known initial

More information

2-3 Tree. Outline B-TREE. catch(...){ printf( "Assignment::SolveProblem() AAAA!"); } ADD SLIDES ON DISJOINT SETS

2-3 Tree. Outline B-TREE. catch(...){ printf( Assignment::SolveProblem() AAAA!); } ADD SLIDES ON DISJOINT SETS Outline catch(...){ printf( "Assignment::SolveProblem() AAAA!"); } Balanced Search Trees 2-3 Trees 2-3-4 Trees Slide 4 Why care about advanced implementations? Same entries, different insertion sequence:

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

Informed State Space Search B4B36ZUI, LS 2018

Informed State Space Search B4B36ZUI, LS 2018 Informed State Space Search B4B36ZUI, LS 2018 Branislav Bošanský, Martin Schaefer, David Fiedler, Jaromír Janisch {name.surname}@agents.fel.cvut.cz Artificial Intelligence Center, Czech Technical University

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

Heuristic Search: Intro

Heuristic Search: Intro Heuristic Search: Intro Blind search can be applied to all problems Is inefficient, as does not incorporate knowledge about the problem to guide the search Such knowledge can be used when deciding which

More information

Informed search algorithms. Chapter 4

Informed search algorithms. Chapter 4 Informed search algorithms Chapter 4 Outline Best-first search Greedy best-first search A * search Heuristics Memory Bounded A* Search Best-first search Idea: use an evaluation function f(n) for each node

More information

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

Heuristic (Informed) Search

Heuristic (Informed) Search Heuristic (Informed) Search (Where we try to choose smartly) R&N: Chap., Sect..1 3 1 Search Algorithm #2 SEARCH#2 1. INSERT(initial-node,Open-List) 2. Repeat: a. If empty(open-list) then return failure

More information

INF2220: algorithms and data structures Series 1

INF2220: algorithms and data structures Series 1 Universitetet i Oslo Institutt for Informatikk I. Yu, D. Karabeg INF2220: algorithms and data structures Series 1 Topic Function growth & estimation of running time, trees Issued: 24. 08. 2016 Exercise

More information

mywbut.com Informed Search Strategies-II

mywbut.com Informed Search Strategies-II Informed Search Strategies-II 1 3.3 Iterative-Deepening A* 3.3.1 IDA* Algorithm Iterative deepening A* or IDA* is similar to iterative-deepening depth-first, but with the following modifications: The depth

More information

Binary Trees

Binary Trees Binary Trees 4-7-2005 Opening Discussion What did we talk about last class? Do you have any code to show? Do you have any questions about the assignment? What is a Tree? You are all familiar with what

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

ARTIFICIAL INTELLIGENCE LECTURE 3. Ph. D. Lect. Horia Popa Andreescu rd year, semester 5

ARTIFICIAL INTELLIGENCE LECTURE 3. Ph. D. Lect. Horia Popa Andreescu rd year, semester 5 ARTIFICIAL INTELLIGENCE LECTURE 3 Ph. D. Lect. Horia Popa Andreescu 2012-2013 3 rd year, semester 5 The slides for this lecture are based (partially) on chapter 4 of the Stuart Russel Lecture Notes [R,

More information

Best-First Search Minimizing Space or Time. IDA* Save space, take more time

Best-First Search Minimizing Space or Time. IDA* Save space, take more time Best-First Search Minimizing Space or Time IDA* Save space, take more time IDA*-1 A* space complexity» What does the space complexity of A* depend upon? IDA*-2 A* space complexity 2» What does the space

More information

Advanced A* Improvements

Advanced A* Improvements Advanced A* Improvements 1 Iterative Deepening A* (IDA*) Idea: Reduce memory requirement of A* by applying cutoff on values of f Consistent heuristic function h Algorithm IDA*: 1. Initialize cutoff to

More information

ITCS 6150 Intelligent Systems. Lecture 5 Informed Searches

ITCS 6150 Intelligent Systems. Lecture 5 Informed Searches ITCS 6150 Intelligent Systems Lecture 5 Informed Searches Informed Searches We are informed (in some way) about future states and future paths We use this information to make better decisions about which

More information

Recursive Best-First Search with Bounded Overhead

Recursive Best-First Search with Bounded Overhead Recursive Best-First Search with Bounded Overhead Matthew Hatem and Scott Kiesel and Wheeler Ruml with support from NSF grant IIS-1150068 Wheeler Ruml (UNH) Recursive Best-First Search with Bounded Overhead

More information

Binary Trees, Binary Search Trees

Binary Trees, Binary Search Trees Binary Trees, Binary Search Trees Trees Linear access time of linked lists is prohibitive Does there exist any simple data structure for which the running time of most operations (search, insert, delete)

More information

Best-First Search! Minimizing Space or Time!! IDA*! Save space, take more time!!

Best-First Search! Minimizing Space or Time!! IDA*! Save space, take more time!! Best-First Search! Minimizing Space or Time!! IDA*! Save space, take more time!! IDA*-1 A* space complexity!» What does the space complexity of A* depend upon?! IDA*-2 A* space complexity 2!» What does

More information

Comparative Study of RBFS & ARBFS Algorithm

Comparative Study of RBFS & ARBFS Algorithm IOSR Journal of Computer Engineering (IOSR-JCE) e-issn: 78-066, p- ISSN: 78-877Volume 0, Issue 5 (Mar. - Apr. 0), PP 05-0 Comparative Study of RBFS & ARBFS Algorithm Disha Sharma, Sanjay Kumar Dubey (Information

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

Artificial Intelligence

Artificial Intelligence Artificial Intelligence Information Systems and Machine Learning Lab (ISMLL) Tomáš Horváth 10 rd November, 2010 Informed Search and Exploration Example (again) Informed strategy we use a problem-specific

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

Mustafa Jarrar: Lecture Notes on Artificial Intelligence Birzeit University, Chapter 3 Informed Searching. Mustafa Jarrar. University of Birzeit

Mustafa Jarrar: Lecture Notes on Artificial Intelligence Birzeit University, Chapter 3 Informed Searching. Mustafa Jarrar. University of Birzeit Mustafa Jarrar: Lecture Notes on Artificial Intelligence Birzeit University, 2018 Chapter 3 Informed Searching Mustafa Jarrar University of Birzeit Jarrar 2018 1 Watch this lecture and download the slides

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

Trees : Part 1. Section 4.1. Theory and Terminology. A Tree? A Tree? Theory and Terminology. Theory and Terminology

Trees : Part 1. Section 4.1. Theory and Terminology. A Tree? A Tree? Theory and Terminology. Theory and Terminology Trees : Part Section. () (2) Preorder, Postorder and Levelorder Traversals Definition: A tree is a connected graph with no cycles Consequences: Between any two vertices, there is exactly one unique path

More information

Artificial Intelligence

Artificial Intelligence Artificial Intelligence Information Systems and Machine Learning Lab (ISMLL) Tomáš Horváth 16 rd November, 2011 Informed Search and Exploration Example (again) Informed strategy we use a problem-specific

More information

Data Structures and Algorithms

Data Structures and Algorithms Data Structures and Algorithms CS245-2008S-19 B-Trees David Galles Department of Computer Science University of San Francisco 19-0: Indexing Operations: Add an element Remove an element Find an element,

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

EE 368. Weeks 5 (Notes)

EE 368. Weeks 5 (Notes) EE 368 Weeks 5 (Notes) 1 Chapter 5: Trees Skip pages 273-281, Section 5.6 - If A is the root of a tree and B is the root of a subtree of that tree, then A is B s parent (or father or mother) and B is A

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

Monotonicity. Admissible Search: That finds the shortest path to the Goal. Monotonicity: local admissibility is called MONOTONICITY

Monotonicity. Admissible Search: That finds the shortest path to the Goal. Monotonicity: local admissibility is called MONOTONICITY Monotonicity Admissible Search: That finds the shortest path to the Goal Monotonicity: local admissibility is called MONOTONICITY This property ensures consistently minimal path to each state they encounter

More information

CS 380/480 Foundations of Artificial Intelligence Winter 2007 Assignment 2 Solutions to Selected Problems

CS 380/480 Foundations of Artificial Intelligence Winter 2007 Assignment 2 Solutions to Selected Problems CS 380/480 Foundations of Artificial Intelligence Winter 2007 Assignment 2 Solutions to Selected Problems 1. Search trees for the state-space graph given below: We only show the search trees corresponding

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

Introduction HEURISTIC SEARCH. Introduction. Heuristics. Two main concerns of AI researchers. Two problems with the search process

Introduction HEURISTIC SEARCH. Introduction. Heuristics. Two main concerns of AI researchers. Two problems with the search process HEURISTIC SERCH George F Luger RTIFICIL INTELLIGENCE 6th edition Structures and Strategies for Complex Problem Solving Introduction Two main concerns of I researchers 1) Representation of the knowledge

More information

3 SOLVING PROBLEMS BY SEARCHING

3 SOLVING PROBLEMS BY SEARCHING 48 3 SOLVING PROBLEMS BY SEARCHING A goal-based agent aims at solving problems by performing actions that lead to desirable states Let us first consider the uninformed situation in which the agent is not

More information

Lecture 4: Search 3. Victor R. Lesser. CMPSCI 683 Fall 2010

Lecture 4: Search 3. Victor R. Lesser. CMPSCI 683 Fall 2010 Lecture 4: Search 3 Victor R. Lesser CMPSCI 683 Fall 2010 First Homework 1 st Programming Assignment 2 separate parts (homeworks) First part due on (9/27) at 5pm Second part due on 10/13 at 5pm Send homework

More information

Binary Heaps in Dynamic Arrays

Binary Heaps in Dynamic Arrays Yufei Tao ITEE University of Queensland We have already learned that the binary heap serves as an efficient implementation of a priority queue. Our previous discussion was based on pointers (for getting

More information

15.083J Integer Programming and Combinatorial Optimization Fall Enumerative Methods

15.083J Integer Programming and Combinatorial Optimization Fall Enumerative Methods 5.8J Integer Programming and Combinatorial Optimization Fall 9 A knapsack problem Enumerative Methods Let s focus on maximization integer linear programs with only binary variables For example: a knapsack

More information

Trees. (Trees) Data Structures and Programming Spring / 28

Trees. (Trees) Data Structures and Programming Spring / 28 Trees (Trees) Data Structures and Programming Spring 2018 1 / 28 Trees A tree is a collection of nodes, which can be empty (recursive definition) If not empty, a tree consists of a distinguished node r

More information

INF2220: algorithms and data structures Series 1

INF2220: algorithms and data structures Series 1 Universitetet i Oslo Institutt for Informatikk A. Maus, R.K. Runde, I. Yu INF2220: algorithms and data structures Series 1 Topic Trees & estimation of running time (Exercises with hints for solution) Issued:

More information

Quiz 1 Solutions. (a) f(n) = n g(n) = log n Circle all that apply: f = O(g) f = Θ(g) f = Ω(g)

Quiz 1 Solutions. (a) f(n) = n g(n) = log n Circle all that apply: f = O(g) f = Θ(g) f = Ω(g) Introduction to Algorithms March 11, 2009 Massachusetts Institute of Technology 6.006 Spring 2009 Professors Sivan Toledo and Alan Edelman Quiz 1 Solutions Problem 1. Quiz 1 Solutions Asymptotic orders

More information

Section 5.5. Left subtree The left subtree of a vertex V on a binary tree is the graph formed by the left child L of V, the descendents

Section 5.5. Left subtree The left subtree of a vertex V on a binary tree is the graph formed by the left child L of V, the descendents Section 5.5 Binary Tree A binary tree is a rooted tree in which each vertex has at most two children and each child is designated as being a left child or a right child. Thus, in a binary tree, each vertex

More information

Trees. Eric McCreath

Trees. Eric McCreath Trees Eric McCreath 2 Overview In this lecture we will explore: general trees, binary trees, binary search trees, and AVL and B-Trees. 3 Trees Trees are recursive data structures. They are useful for:

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

Trees. Q: Why study trees? A: Many advance ADTs are implemented using tree-based data structures.

Trees. Q: Why study trees? A: Many advance ADTs are implemented using tree-based data structures. Trees Q: Why study trees? : Many advance DTs are implemented using tree-based data structures. Recursive Definition of (Rooted) Tree: Let T be a set with n 0 elements. (i) If n = 0, T is an empty tree,

More information

Multi-Way Search Tree

Multi-Way Search Tree Multi-Way Search Tree A multi-way search tree is an ordered tree such that Each internal node has at least two and at most d children and stores d -1 data items (k i, D i ) Rule: Number of children = 1

More information

Informed search methods

Informed search methods Informed search methods Tuomas Sandholm Computer Science Department Carnegie Mellon University Read Section 3.5-3.7 of Russell and Norvig Informed Search Methods Heuristic = to find, to discover Heuristic

More information

TREES AND ORDERS OF GROWTH 7

TREES AND ORDERS OF GROWTH 7 TREES AND ORDERS OF GROWTH 7 COMPUTER SCIENCE 61A March 12, 2015 1 Trees in OOP 1.1 Our Implementation Previously, we have seen trees defined as an abstract data type using lists. Let s look at another

More information

Position Paper: The Collapse Macro in Best-first Search Algorithms and an Iterative Variant of RBFS

Position Paper: The Collapse Macro in Best-first Search Algorithms and an Iterative Variant of RBFS Position Paper: The Collapse Macro in Best-first Search Algorithms and an Iterative Variant of RBFS Ariel Felner Information Systems Engineering Ben-Gurion University Be er-sheva, Israel 85104 felner@bgu.ac.il

More information

Laboratory Module Trees

Laboratory Module Trees Purpose: understand the notion of 2-3 trees to build, in C, a 2-3 tree 1 2-3 Trees 1.1 General Presentation Laboratory Module 7 2-3 Trees 2-3 Trees represent a the simplest type of multiway trees trees

More information

Informed (Heuristic) Search. Idea: be smart about what paths to try.

Informed (Heuristic) Search. Idea: be smart about what paths to try. Informed (Heuristic) Search Idea: be smart about what paths to try. 1 Blind Search vs. Informed Search What s the difference? How do we formally specify this? A node is selected for expansion based on

More information

Dr. Mustafa Jarrar. Chapter 4 Informed Searching. Sina Institute, University of Birzeit

Dr. Mustafa Jarrar. Chapter 4 Informed Searching. Sina Institute, University of Birzeit Lecture Notes, Advanced Artificial Intelligence (SCOM7341) Sina Institute, University of Birzeit 2 nd Semester, 2012 Advanced Artificial Intelligence (SCOM7341) Chapter 4 Informed Searching Dr. Mustafa

More information

Priority Queues and Binary Heaps

Priority Queues and Binary Heaps Yufei Tao ITEE University of Queensland In this lecture, we will learn our first tree data structure called the binary heap which serves as an implementation of the priority queue. Priority Queue A priority

More information

Dr. Mustafa Jarrar. Chapter 4 Informed Searching. Artificial Intelligence. Sina Institute, University of Birzeit

Dr. Mustafa Jarrar. Chapter 4 Informed Searching. Artificial Intelligence. Sina Institute, University of Birzeit Lecture Notes on Informed Searching University of Birzeit, Palestine 1 st Semester, 2014 Artificial Intelligence Chapter 4 Informed Searching Dr. Mustafa Jarrar Sina Institute, University of Birzeit mjarrar@birzeit.edu

More information

Recitation 9. Prelim Review

Recitation 9. Prelim Review Recitation 9 Prelim Review 1 Heaps 2 Review: Binary heap min heap 1 2 99 4 3 PriorityQueue Maintains max or min of collection (no duplicates) Follows heap order invariant at every level Always balanced!

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

7.1 Introduction. A (free) tree T is A simple graph such that for every pair of vertices v and w there is a unique path from v to w

7.1 Introduction. A (free) tree T is A simple graph such that for every pair of vertices v and w there is a unique path from v to w Chapter 7 Trees 7.1 Introduction A (free) tree T is A simple graph such that for every pair of vertices v and w there is a unique path from v to w Tree Terminology Parent Ancestor Child Descendant Siblings

More information

CS Fall 2010 B-trees Carola Wenk

CS Fall 2010 B-trees Carola Wenk CS 3343 -- Fall 2010 B-trees Carola Wenk 10/19/10 CS 3343 Analysis of Algorithms 1 External memory dictionary Task: Given a large amount of data that does not fit into main memory, process it into a dictionary

More information

CSI33 Data Structures

CSI33 Data Structures Outline Department of Mathematics and Computer Science Bronx Community College November 13, 2017 Outline Outline 1 C++ Supplement.1: Trees Outline C++ Supplement.1: Trees 1 C++ Supplement.1: Trees Uses

More information

mywbut.com Informed Search Strategies-I

mywbut.com Informed Search Strategies-I Informed Search Strategies-I 1 3.1 Introduction We have outlined the different types of search strategies. In the earlier chapter we have looked at different blind search strategies. Uninformed search

More information

Uses for Trees About Trees Binary Trees. Trees. Seth Long. January 31, 2010

Uses for Trees About Trees Binary Trees. Trees. Seth Long. January 31, 2010 Uses for About Binary January 31, 2010 Uses for About Binary Uses for Uses for About Basic Idea Implementing Binary Example: Expression Binary Search Uses for Uses for About Binary Uses for Storage Binary

More information

Effective use of memory in linear space best first search

Effective use of memory in linear space best first search Effective use of memory in linear space best first search Marko Robnik-Šikonja University of Ljubljana, Faculty of Electrical Engineering and Computer Science, Tržaška 5, 00 Ljubljana, Slovenia e-mail:

More information

Basic Data Structures (Version 7) Name:

Basic Data Structures (Version 7) Name: Prerequisite Concepts for Analysis of Algorithms Basic Data Structures (Version 7) Name: Email: Concept: mathematics notation 1. log 2 n is: Code: 21481 (A) o(log 10 n) (B) ω(log 10 n) (C) Θ(log 10 n)

More information

Recursive Best-First Search with Bounded Overhead

Recursive Best-First Search with Bounded Overhead Recursive Best-First Search with Bounded Overhead Matthew Hatem and Scott Kiesel and Wheeler Ruml Department of Computer Science University of New Hampshire Durham, NH 03824 USA mhatem and skiesel and

More information

Lecture 6: Analysis of Algorithms (CS )

Lecture 6: Analysis of Algorithms (CS ) Lecture 6: Analysis of Algorithms (CS583-002) Amarda Shehu October 08, 2014 1 Outline of Today s Class 2 Traversals Querying Insertion and Deletion Sorting with BSTs 3 Red-black Trees Height of a Red-black

More information

Here is a recursive algorithm that solves this problem, given a pointer to the root of T : MaxWtSubtree [r]

Here is a recursive algorithm that solves this problem, given a pointer to the root of T : MaxWtSubtree [r] CSE 101 Final Exam Topics: Order, Recurrence Relations, Analyzing Programs, Divide-and-Conquer, Back-tracking, Dynamic Programming, Greedy Algorithms and Correctness Proofs, Data Structures (Heap, Binary

More information

TREES AND ORDERS OF GROWTH 7

TREES AND ORDERS OF GROWTH 7 TREES AND ORDERS OF GROWTH 7 COMPUTER SCIENCE 61A October 17, 2013 1 Trees In computer science, trees are recursive data structures that are widely used in various settings. This is a diagram of a simple

More information

Graph Algorithms Using Depth First Search

Graph Algorithms Using Depth First Search Graph Algorithms Using Depth First Search Analysis of Algorithms Week 8, Lecture 1 Prepared by John Reif, Ph.D. Distinguished Professor of Computer Science Duke University Graph Algorithms Using Depth

More information

CMPS 2200 Fall 2017 B-trees Carola Wenk

CMPS 2200 Fall 2017 B-trees Carola Wenk CMPS 2200 Fall 2017 B-trees Carola Wenk 9/18/17 CMPS 2200 Intro. to Algorithms 1 External memory dictionary Task: Given a large amount of data that does not fit into main memory, process it into a dictionary

More information

CS 380: ARTIFICIAL INTELLIGENCE PROBLEM SOLVING: INFORMED SEARCH, A* Santiago Ontañón

CS 380: ARTIFICIAL INTELLIGENCE PROBLEM SOLVING: INFORMED SEARCH, A* Santiago Ontañón S 380: RTIFIIL INTELLIGENE PROLEM SOLVING: INFORMED SERH, * Santiago Ontañón so367@drexel.edu Note on Graph Search Repeated-state checking: When the search state is a graph strategies like DFS can get

More information

CSE 530A. B+ Trees. Washington University Fall 2013

CSE 530A. B+ Trees. Washington University Fall 2013 CSE 530A B+ Trees Washington University Fall 2013 B Trees A B tree is an ordered (non-binary) tree where the internal nodes can have a varying number of child nodes (within some range) B Trees When a key

More information

Solutions. (a) Claim: A d-ary tree of height h has at most 1 + d +...

Solutions. (a) Claim: A d-ary tree of height h has at most 1 + d +... Design and Analysis of Algorithms nd August, 016 Problem Sheet 1 Solutions Sushant Agarwal Solutions 1. A d-ary tree is a rooted tree in which each node has at most d children. Show that any d-ary tree

More information

(2,4) Trees. 2/22/2006 (2,4) Trees 1

(2,4) Trees. 2/22/2006 (2,4) Trees 1 (2,4) Trees 9 2 5 7 10 14 2/22/2006 (2,4) Trees 1 Outline and Reading Multi-way search tree ( 10.4.1) Definition Search (2,4) tree ( 10.4.2) Definition Search Insertion Deletion Comparison of dictionary

More information

CS 171: Introduction to Computer Science II. Binary Search Trees

CS 171: Introduction to Computer Science II. Binary Search Trees CS 171: Introduction to Computer Science II Binary Search Trees Binary Search Trees Symbol table applications BST definitions and terminologies Search and insert Traversal Ordered operations Delete Symbol

More information

Trees. Tree Structure Binary Tree Tree Traversals

Trees. Tree Structure Binary Tree Tree Traversals Trees Tree Structure Binary Tree Tree Traversals The Tree Structure Consists of nodes and edges that organize data in a hierarchical fashion. nodes store the data elements. edges connect the nodes. The

More information

Trees. CSE 373 Data Structures

Trees. CSE 373 Data Structures Trees CSE 373 Data Structures Readings Reading Chapter 7 Trees 2 Why Do We Need Trees? Lists, Stacks, and Queues are linear relationships Information often contains hierarchical relationships File directories

More information

Artificial Intelligence

Artificial Intelligence Artificial Intelligence Dr. Malek Mouhoub Department of Computer Science University of Regina Fall 2005 Malek Mouhoub, CS820 Fall 2005 1 3. State-Space Search 3. State-Space Search Graph Theory Uninformed

More information

Trees! Ellen Walker! CPSC 201 Data Structures! Hiram College!

Trees! Ellen Walker! CPSC 201 Data Structures! Hiram College! Trees! Ellen Walker! CPSC 201 Data Structures! Hiram College! ADTʼs Weʼve Studied! Position-oriented ADT! List! Stack! Queue! Value-oriented ADT! Sorted list! All of these are linear! One previous item;

More information

Lec 17 April 8. Topics: binary Trees expression trees. (Chapter 5 of text)

Lec 17 April 8. Topics: binary Trees expression trees. (Chapter 5 of text) Lec 17 April 8 Topics: binary Trees expression trees Binary Search Trees (Chapter 5 of text) Trees Linear access time of linked lists is prohibitive Heap can t support search in O(log N) time. (takes O(N)

More information

Tree Travsersals and BST Iterators

Tree Travsersals and BST Iterators Tree Travsersals and BST Iterators PIC 10B May 25, 2016 PIC 10B Tree Travsersals and BST Iterators May 25, 2016 1 / 17 Overview of Lecture 1 Sorting a BST 2 In-Order Travsersal 3 Pre-Order Traversal 4

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

CE 221 Data Structures and Algorithms

CE 221 Data Structures and Algorithms CE 221 Data Structures and Algorithms Chapter 4: Trees (Binary) Text: Read Weiss, 4.1 4.2 Izmir University of Economics 1 Preliminaries - I (Recursive) Definition: A tree is a collection of nodes. The

More information

n 1 i = n + i = n + f(n 1)

n 1 i = n + i = n + f(n 1) 2 Binary Search Trees Lab Objective: A tree is a linked list where each node in the list may refer to more than one other node. This structural flexibility makes trees more useful and efficient than regular

More information

Advanced Algorithms. Class Notes for Thursday, September 18, 2014 Bernard Moret

Advanced Algorithms. Class Notes for Thursday, September 18, 2014 Bernard Moret Advanced Algorithms Class Notes for Thursday, September 18, 2014 Bernard Moret 1 Amortized Analysis (cont d) 1.1 Side note: regarding meldable heaps When we saw how to meld two leftist trees, we did not

More information

Lecture 11: Multiway and (2,4) Trees. Courtesy to Goodrich, Tamassia and Olga Veksler

Lecture 11: Multiway and (2,4) Trees. Courtesy to Goodrich, Tamassia and Olga Veksler Lecture 11: Multiway and (2,4) Trees 9 2 5 7 10 14 Courtesy to Goodrich, Tamassia and Olga Veksler Instructor: Yuzhen Xie Outline Multiway Seach Tree: a new type of search trees: for ordered d dictionary

More information

Chapter 3 Solving Problems by Searching Informed (heuristic) search strategies More on heuristics

Chapter 3 Solving Problems by Searching Informed (heuristic) search strategies More on heuristics Chapter 3 Solving Problems by Searching 3.5 3.6 Informed (heuristic) search strategies More on heuristics CS5811 - Advanced Artificial Intelligence Nilufer Onder Department of Computer Science Michigan

More information

CSI33 Data Structures

CSI33 Data Structures Outline Department of Mathematics and Computer Science Bronx Community College October 19, 2016 Outline Outline 1 Chapter 7: Trees Outline Chapter 7: Trees 1 Chapter 7: Trees Uses Of Trees Chapter 7: Trees

More information

Tree. A path is a connected sequence of edges. A tree topology is acyclic there is no loop.

Tree. A path is a connected sequence of edges. A tree topology is acyclic there is no loop. Tree A tree consists of a set of nodes and a set of edges connecting pairs of nodes. A tree has the property that there is exactly one path (no more, no less) between any pair of nodes. A path is a connected

More information

Data Structures Question Bank Multiple Choice

Data Structures Question Bank Multiple Choice Section 1. Fundamentals: Complexity, Algorthm Analysis 1. An algorithm solves A single problem or function Multiple problems or functions Has a single programming language implementation 2. A solution

More information

1 Tree Sort LECTURE 4. OHSU/OGI (Winter 2009) ANALYSIS AND DESIGN OF ALGORITHMS

1 Tree Sort LECTURE 4. OHSU/OGI (Winter 2009) ANALYSIS AND DESIGN OF ALGORITHMS OHSU/OGI (Winter 2009) CS532 ANALYSIS AND DESIGN OF ALGORITHMS LECTURE 4 1 Tree Sort Suppose a sequence of n items is given. We can sort it using TreeInsert and DeleteMin: TreeSort Initialize an empty

More information

COMP Analysis of Algorithms & Data Structures

COMP Analysis of Algorithms & Data Structures COMP 3170 - Analysis of Algorithms & Data Structures Shahin Kamali Lecture 9 - Jan. 22, 2018 CLRS 12.2, 12.3, 13.2, read problem 13-3 University of Manitoba COMP 3170 - Analysis of Algorithms & Data Structures

More information

Multiway Search Trees

Multiway Search Trees Multiway Search Trees Intuitive Definition A multiway search tree is one with nodes that have two or more children. Within each node is stored a given key, which is associated to an item we wish to access

More information

Notes. Video Game AI: Lecture 5 Planning for Pathfinding. Lecture Overview. Knowledge vs Search. Jonathan Schaeffer this Friday

Notes. Video Game AI: Lecture 5 Planning for Pathfinding. Lecture Overview. Knowledge vs Search. Jonathan Schaeffer this Friday Notes Video Game AI: Lecture 5 Planning for Pathfinding Nathan Sturtevant COMP 3705 Jonathan Schaeffer this Friday Planning vs localization We cover planning today Localization is just mapping a real-valued

More information

CS F-11 B-Trees 1

CS F-11 B-Trees 1 CS673-2016F-11 B-Trees 1 11-0: Binary Search Trees Binary Tree data structure All values in left subtree< value stored in root All values in the right subtree>value stored in root 11-1: Generalizing BSTs

More information

Data Structures Lesson 9

Data Structures Lesson 9 Data Structures Lesson 9 BSc in Computer Science University of New York, Tirana Assoc. Prof. Marenglen Biba 1-1 Chapter 21 A Priority Queue: The Binary Heap Priority Queue The priority queue is a fundamental

More information

CS301 - Data Structures Glossary By

CS301 - Data Structures Glossary By CS301 - Data Structures Glossary By Abstract Data Type : A set of data values and associated operations that are precisely specified independent of any particular implementation. Also known as ADT Algorithm

More information