graph search - khoury college of computer sciencesexample: romania on holiday in romania; currently...
TRANSCRIPT
![Page 1: Graph Search - Khoury College of Computer SciencesExample: Romania On holiday in Romania; currently in Arad. Flight leaves tomorrow from Bucharest Formulate goal: Be in Bucharest Formulate](https://reader034.vdocument.in/reader034/viewer/2022042808/5f8555bcecf4e100036478a7/html5/thumbnails/1.jpg)
Graph Search
Rob Platt Northeastern University
Some images and slides are used from:AIMA, Chris Amato, Stacy Marcella, CS188 UC Berkeley
![Page 2: Graph Search - Khoury College of Computer SciencesExample: Romania On holiday in Romania; currently in Arad. Flight leaves tomorrow from Bucharest Formulate goal: Be in Bucharest Formulate](https://reader034.vdocument.in/reader034/viewer/2022042808/5f8555bcecf4e100036478a7/html5/thumbnails/2.jpg)
Applications of graph search
![Page 3: Graph Search - Khoury College of Computer SciencesExample: Romania On holiday in Romania; currently in Arad. Flight leaves tomorrow from Bucharest Formulate goal: Be in Bucharest Formulate](https://reader034.vdocument.in/reader034/viewer/2022042808/5f8555bcecf4e100036478a7/html5/thumbnails/3.jpg)
What is graph search?
Graph search: find a path from start to goal
– what are the states?
– what are the actions (transitions)?
– how is this a graph?
Start state Goal state
![Page 4: Graph Search - Khoury College of Computer SciencesExample: Romania On holiday in Romania; currently in Arad. Flight leaves tomorrow from Bucharest Formulate goal: Be in Bucharest Formulate](https://reader034.vdocument.in/reader034/viewer/2022042808/5f8555bcecf4e100036478a7/html5/thumbnails/4.jpg)
What is graph search?
Graph search: find a path from start to goal
– what are the states?
– what are the actions (transitions)?
– how is this a graph?
Start state Goal state
![Page 5: Graph Search - Khoury College of Computer SciencesExample: Romania On holiday in Romania; currently in Arad. Flight leaves tomorrow from Bucharest Formulate goal: Be in Bucharest Formulate](https://reader034.vdocument.in/reader034/viewer/2022042808/5f8555bcecf4e100036478a7/html5/thumbnails/5.jpg)
What is graph search?
Graph search: find a path from start to goal
– what are the states?
– what are the actions (transitions)?
– how is this a graph?
Start state
Goal state
![Page 6: Graph Search - Khoury College of Computer SciencesExample: Romania On holiday in Romania; currently in Arad. Flight leaves tomorrow from Bucharest Formulate goal: Be in Bucharest Formulate](https://reader034.vdocument.in/reader034/viewer/2022042808/5f8555bcecf4e100036478a7/html5/thumbnails/6.jpg)
What is graph search?
Graph search: find a path from start to goal
– what are the states?
– what are the actions (transitions)?
– how is this a graph?
Start state
Goal state
![Page 7: Graph Search - Khoury College of Computer SciencesExample: Romania On holiday in Romania; currently in Arad. Flight leaves tomorrow from Bucharest Formulate goal: Be in Bucharest Formulate](https://reader034.vdocument.in/reader034/viewer/2022042808/5f8555bcecf4e100036478a7/html5/thumbnails/7.jpg)
What is a graph?
Graph:
Edges:
Vertices:
Directed graph
![Page 8: Graph Search - Khoury College of Computer SciencesExample: Romania On holiday in Romania; currently in Arad. Flight leaves tomorrow from Bucharest Formulate goal: Be in Bucharest Formulate](https://reader034.vdocument.in/reader034/viewer/2022042808/5f8555bcecf4e100036478a7/html5/thumbnails/8.jpg)
What is a graph?
Graph:
Edges:
Vertices:
Undirected graph
![Page 9: Graph Search - Khoury College of Computer SciencesExample: Romania On holiday in Romania; currently in Arad. Flight leaves tomorrow from Bucharest Formulate goal: Be in Bucharest Formulate](https://reader034.vdocument.in/reader034/viewer/2022042808/5f8555bcecf4e100036478a7/html5/thumbnails/9.jpg)
What is a graph?
Graph:
Edges:
Vertices: Also called states
Also called transitions
![Page 10: Graph Search - Khoury College of Computer SciencesExample: Romania On holiday in Romania; currently in Arad. Flight leaves tomorrow from Bucharest Formulate goal: Be in Bucharest Formulate](https://reader034.vdocument.in/reader034/viewer/2022042808/5f8555bcecf4e100036478a7/html5/thumbnails/10.jpg)
Defining a graph: example
![Page 11: Graph Search - Khoury College of Computer SciencesExample: Romania On holiday in Romania; currently in Arad. Flight leaves tomorrow from Bucharest Formulate goal: Be in Bucharest Formulate](https://reader034.vdocument.in/reader034/viewer/2022042808/5f8555bcecf4e100036478a7/html5/thumbnails/11.jpg)
Defining a graph: example
How many states?
![Page 12: Graph Search - Khoury College of Computer SciencesExample: Romania On holiday in Romania; currently in Arad. Flight leaves tomorrow from Bucharest Formulate goal: Be in Bucharest Formulate](https://reader034.vdocument.in/reader034/viewer/2022042808/5f8555bcecf4e100036478a7/html5/thumbnails/12.jpg)
Defining a graph: example
![Page 13: Graph Search - Khoury College of Computer SciencesExample: Romania On holiday in Romania; currently in Arad. Flight leaves tomorrow from Bucharest Formulate goal: Be in Bucharest Formulate](https://reader034.vdocument.in/reader034/viewer/2022042808/5f8555bcecf4e100036478a7/html5/thumbnails/13.jpg)
Defining a graph: example
Pairs of states that are “connected” by one turn of the cube.
![Page 14: Graph Search - Khoury College of Computer SciencesExample: Romania On holiday in Romania; currently in Arad. Flight leaves tomorrow from Bucharest Formulate goal: Be in Bucharest Formulate](https://reader034.vdocument.in/reader034/viewer/2022042808/5f8555bcecf4e100036478a7/html5/thumbnails/14.jpg)
Example: Romania
● On holiday in Romania; currently in Arad. Flight leaves tomorrow from Bucharest
● Formulate goal: Be in Bucharest● Formulate problem:
● states: various cities● actions: drive between cities
● Find solution:● sequence of cities, e.g., Arad,
Sibiu, Fagaras, Bucharest
![Page 15: Graph Search - Khoury College of Computer SciencesExample: Romania On holiday in Romania; currently in Arad. Flight leaves tomorrow from Bucharest Formulate goal: Be in Bucharest Formulate](https://reader034.vdocument.in/reader034/viewer/2022042808/5f8555bcecf4e100036478a7/html5/thumbnails/15.jpg)
Graph search
Given: a graph, G
Problem: find a path from A to B
– A: start state
– B: goal state
![Page 16: Graph Search - Khoury College of Computer SciencesExample: Romania On holiday in Romania; currently in Arad. Flight leaves tomorrow from Bucharest Formulate goal: Be in Bucharest Formulate](https://reader034.vdocument.in/reader034/viewer/2022042808/5f8555bcecf4e100036478a7/html5/thumbnails/16.jpg)
Graph search
Given: a graph, G
Problem: find a path from A to B
– A: start state
– B: goal state
How?
![Page 17: Graph Search - Khoury College of Computer SciencesExample: Romania On holiday in Romania; currently in Arad. Flight leaves tomorrow from Bucharest Formulate goal: Be in Bucharest Formulate](https://reader034.vdocument.in/reader034/viewer/2022042808/5f8555bcecf4e100036478a7/html5/thumbnails/17.jpg)
Problem formulation
A problem is defined by four items:
● initial state e.g., “at Arad”
● successor function S(x) = set of action–state pairs
e.g., S(Arad) = { Arad → Zerind, Zerind , . . .}⟨ ⟩
● goal test, can be explicit, e.g., x = “at Bucharest” implicit, e.g., NoDirt(x)
● path cost (additive)
e.g., sum of distances, number of actions executed, etc. c(x, a, y) is the step cost, assumed to be ≥ 0
● A solution is a sequence of actions leading from the initial state to a goal state
![Page 18: Graph Search - Khoury College of Computer SciencesExample: Romania On holiday in Romania; currently in Arad. Flight leaves tomorrow from Bucharest Formulate goal: Be in Bucharest Formulate](https://reader034.vdocument.in/reader034/viewer/2022042808/5f8555bcecf4e100036478a7/html5/thumbnails/18.jpg)
A search tree
Start at A
![Page 19: Graph Search - Khoury College of Computer SciencesExample: Romania On holiday in Romania; currently in Arad. Flight leaves tomorrow from Bucharest Formulate goal: Be in Bucharest Formulate](https://reader034.vdocument.in/reader034/viewer/2022042808/5f8555bcecf4e100036478a7/html5/thumbnails/19.jpg)
A search tree
Successors of A
![Page 20: Graph Search - Khoury College of Computer SciencesExample: Romania On holiday in Romania; currently in Arad. Flight leaves tomorrow from Bucharest Formulate goal: Be in Bucharest Formulate](https://reader034.vdocument.in/reader034/viewer/2022042808/5f8555bcecf4e100036478a7/html5/thumbnails/20.jpg)
A search tree
Successors of A
parent children
![Page 21: Graph Search - Khoury College of Computer SciencesExample: Romania On holiday in Romania; currently in Arad. Flight leaves tomorrow from Bucharest Formulate goal: Be in Bucharest Formulate](https://reader034.vdocument.in/reader034/viewer/2022042808/5f8555bcecf4e100036478a7/html5/thumbnails/21.jpg)
A search tree
Let's expand S next
![Page 22: Graph Search - Khoury College of Computer SciencesExample: Romania On holiday in Romania; currently in Arad. Flight leaves tomorrow from Bucharest Formulate goal: Be in Bucharest Formulate](https://reader034.vdocument.in/reader034/viewer/2022042808/5f8555bcecf4e100036478a7/html5/thumbnails/22.jpg)
A search tree
Successors of S
![Page 23: Graph Search - Khoury College of Computer SciencesExample: Romania On holiday in Romania; currently in Arad. Flight leaves tomorrow from Bucharest Formulate goal: Be in Bucharest Formulate](https://reader034.vdocument.in/reader034/viewer/2022042808/5f8555bcecf4e100036478a7/html5/thumbnails/23.jpg)
A search tree
A was already visited!
![Page 24: Graph Search - Khoury College of Computer SciencesExample: Romania On holiday in Romania; currently in Arad. Flight leaves tomorrow from Bucharest Formulate goal: Be in Bucharest Formulate](https://reader034.vdocument.in/reader034/viewer/2022042808/5f8555bcecf4e100036478a7/html5/thumbnails/24.jpg)
A search tree
A was already visited!So, prune it!
![Page 25: Graph Search - Khoury College of Computer SciencesExample: Romania On holiday in Romania; currently in Arad. Flight leaves tomorrow from Bucharest Formulate goal: Be in Bucharest Formulate](https://reader034.vdocument.in/reader034/viewer/2022042808/5f8555bcecf4e100036478a7/html5/thumbnails/25.jpg)
A search tree
In what order should we expand states?
– here, we expanded S, but we could also have expanded Z or T
– different search algorithms expand in different orders
![Page 26: Graph Search - Khoury College of Computer SciencesExample: Romania On holiday in Romania; currently in Arad. Flight leaves tomorrow from Bucharest Formulate goal: Be in Bucharest Formulate](https://reader034.vdocument.in/reader034/viewer/2022042808/5f8555bcecf4e100036478a7/html5/thumbnails/26.jpg)
Breadth first search (BFS)
![Page 27: Graph Search - Khoury College of Computer SciencesExample: Romania On holiday in Romania; currently in Arad. Flight leaves tomorrow from Bucharest Formulate goal: Be in Bucharest Formulate](https://reader034.vdocument.in/reader034/viewer/2022042808/5f8555bcecf4e100036478a7/html5/thumbnails/27.jpg)
Breadth first search (BFS)
![Page 28: Graph Search - Khoury College of Computer SciencesExample: Romania On holiday in Romania; currently in Arad. Flight leaves tomorrow from Bucharest Formulate goal: Be in Bucharest Formulate](https://reader034.vdocument.in/reader034/viewer/2022042808/5f8555bcecf4e100036478a7/html5/thumbnails/28.jpg)
Breadth first search (BFS)
Start node
![Page 29: Graph Search - Khoury College of Computer SciencesExample: Romania On holiday in Romania; currently in Arad. Flight leaves tomorrow from Bucharest Formulate goal: Be in Bucharest Formulate](https://reader034.vdocument.in/reader034/viewer/2022042808/5f8555bcecf4e100036478a7/html5/thumbnails/29.jpg)
Breadth first search (BFS)
![Page 30: Graph Search - Khoury College of Computer SciencesExample: Romania On holiday in Romania; currently in Arad. Flight leaves tomorrow from Bucharest Formulate goal: Be in Bucharest Formulate](https://reader034.vdocument.in/reader034/viewer/2022042808/5f8555bcecf4e100036478a7/html5/thumbnails/30.jpg)
Breadth first search (BFS)
![Page 31: Graph Search - Khoury College of Computer SciencesExample: Romania On holiday in Romania; currently in Arad. Flight leaves tomorrow from Bucharest Formulate goal: Be in Bucharest Formulate](https://reader034.vdocument.in/reader034/viewer/2022042808/5f8555bcecf4e100036478a7/html5/thumbnails/31.jpg)
Breadth first search (BFS)
![Page 32: Graph Search - Khoury College of Computer SciencesExample: Romania On holiday in Romania; currently in Arad. Flight leaves tomorrow from Bucharest Formulate goal: Be in Bucharest Formulate](https://reader034.vdocument.in/reader034/viewer/2022042808/5f8555bcecf4e100036478a7/html5/thumbnails/32.jpg)
Breadth first search (BFS)
We're going to maintain a queue called the fringe
– initialize the fringe as an empty queue
Fringe
![Page 33: Graph Search - Khoury College of Computer SciencesExample: Romania On holiday in Romania; currently in Arad. Flight leaves tomorrow from Bucharest Formulate goal: Be in Bucharest Formulate](https://reader034.vdocument.in/reader034/viewer/2022042808/5f8555bcecf4e100036478a7/html5/thumbnails/33.jpg)
Breadth first search (BFS)
– add A to the fringe
fringeFringeA
![Page 34: Graph Search - Khoury College of Computer SciencesExample: Romania On holiday in Romania; currently in Arad. Flight leaves tomorrow from Bucharest Formulate goal: Be in Bucharest Formulate](https://reader034.vdocument.in/reader034/viewer/2022042808/5f8555bcecf4e100036478a7/html5/thumbnails/34.jpg)
Breadth first search (BFS)
-- remove A from the fringe
-- add successors of A to the fringe
fringe
FringeBC
![Page 35: Graph Search - Khoury College of Computer SciencesExample: Romania On holiday in Romania; currently in Arad. Flight leaves tomorrow from Bucharest Formulate goal: Be in Bucharest Formulate](https://reader034.vdocument.in/reader034/viewer/2022042808/5f8555bcecf4e100036478a7/html5/thumbnails/35.jpg)
Breadth first search (BFS)
-- remove B from the fringe
-- add successors of B to the fringe
fringe
FringeCDE
![Page 36: Graph Search - Khoury College of Computer SciencesExample: Romania On holiday in Romania; currently in Arad. Flight leaves tomorrow from Bucharest Formulate goal: Be in Bucharest Formulate](https://reader034.vdocument.in/reader034/viewer/2022042808/5f8555bcecf4e100036478a7/html5/thumbnails/36.jpg)
Breadth first search (BFS)
fringe
FringeDEFG
-- remove C from the fringe
-- add successors of C to the fringe
![Page 37: Graph Search - Khoury College of Computer SciencesExample: Romania On holiday in Romania; currently in Arad. Flight leaves tomorrow from Bucharest Formulate goal: Be in Bucharest Formulate](https://reader034.vdocument.in/reader034/viewer/2022042808/5f8555bcecf4e100036478a7/html5/thumbnails/37.jpg)
Breadth first search (BFS)
fringe
FringeDEFG
Which state gets removed next from the fringe?
![Page 38: Graph Search - Khoury College of Computer SciencesExample: Romania On holiday in Romania; currently in Arad. Flight leaves tomorrow from Bucharest Formulate goal: Be in Bucharest Formulate](https://reader034.vdocument.in/reader034/viewer/2022042808/5f8555bcecf4e100036478a7/html5/thumbnails/38.jpg)
Breadth first search (BFS)
fringe
FringeDEFG
Which state gets removed next from the fringe?
What kind of a queue is this?
![Page 39: Graph Search - Khoury College of Computer SciencesExample: Romania On holiday in Romania; currently in Arad. Flight leaves tomorrow from Bucharest Formulate goal: Be in Bucharest Formulate](https://reader034.vdocument.in/reader034/viewer/2022042808/5f8555bcecf4e100036478a7/html5/thumbnails/39.jpg)
Breadth first search (BFS)
fringe
FringeDEFG
Which state gets removed next from the fringe?
What kind of a queue is this?
FIFO Queue!(first in first out)
![Page 40: Graph Search - Khoury College of Computer SciencesExample: Romania On holiday in Romania; currently in Arad. Flight leaves tomorrow from Bucharest Formulate goal: Be in Bucharest Formulate](https://reader034.vdocument.in/reader034/viewer/2022042808/5f8555bcecf4e100036478a7/html5/thumbnails/40.jpg)
Breadth first search (BFS)
![Page 41: Graph Search - Khoury College of Computer SciencesExample: Romania On holiday in Romania; currently in Arad. Flight leaves tomorrow from Bucharest Formulate goal: Be in Bucharest Formulate](https://reader034.vdocument.in/reader034/viewer/2022042808/5f8555bcecf4e100036478a7/html5/thumbnails/41.jpg)
Breadth first search (BFS)
What is the purpose of the explored set?
![Page 42: Graph Search - Khoury College of Computer SciencesExample: Romania On holiday in Romania; currently in Arad. Flight leaves tomorrow from Bucharest Formulate goal: Be in Bucharest Formulate](https://reader034.vdocument.in/reader034/viewer/2022042808/5f8555bcecf4e100036478a7/html5/thumbnails/42.jpg)
BFS Properties
Is BFS complete?– is it guaranteed to find a solution if one exists?
![Page 43: Graph Search - Khoury College of Computer SciencesExample: Romania On holiday in Romania; currently in Arad. Flight leaves tomorrow from Bucharest Formulate goal: Be in Bucharest Formulate](https://reader034.vdocument.in/reader034/viewer/2022042808/5f8555bcecf4e100036478a7/html5/thumbnails/43.jpg)
BFS Properties
Is BFS complete?– is it guaranteed to find a solution if one exists?
What is the time complexity of BFS?– how many states are expanded before finding a sol'n?
– b: branching factor– d: depth of shallowest solution– complexity = ???
![Page 44: Graph Search - Khoury College of Computer SciencesExample: Romania On holiday in Romania; currently in Arad. Flight leaves tomorrow from Bucharest Formulate goal: Be in Bucharest Formulate](https://reader034.vdocument.in/reader034/viewer/2022042808/5f8555bcecf4e100036478a7/html5/thumbnails/44.jpg)
BFS Properties
Is BFS complete?– is it guaranteed to find a solution if one exists?
What is the time complexity of BFS?– how many states are expanded before finding a solution?
– b: branching factor– d: depth of shallowest solution– complexity =
![Page 45: Graph Search - Khoury College of Computer SciencesExample: Romania On holiday in Romania; currently in Arad. Flight leaves tomorrow from Bucharest Formulate goal: Be in Bucharest Formulate](https://reader034.vdocument.in/reader034/viewer/2022042808/5f8555bcecf4e100036478a7/html5/thumbnails/45.jpg)
BFS Properties
Is BFS complete?– is it guaranteed to find a solution if one exists?
What is the time complexity of BFS?– how many states are expanded before finding a solution?
– b: branching factor– d: depth of shallowest solution– complexity =
What is the space complexity of BFS?– how much memory is required?
– complexity = ???
![Page 46: Graph Search - Khoury College of Computer SciencesExample: Romania On holiday in Romania; currently in Arad. Flight leaves tomorrow from Bucharest Formulate goal: Be in Bucharest Formulate](https://reader034.vdocument.in/reader034/viewer/2022042808/5f8555bcecf4e100036478a7/html5/thumbnails/46.jpg)
BFS Properties
Is BFS complete?– is it guaranteed to find a solution if one exists?
What is the time complexity of BFS?– how many states are expanded before finding a solution?
– b: branching factor– d: depth of shallowest solution– complexity =
What is the space complexity of BFS?– how much memory is required?
– complexity =
![Page 47: Graph Search - Khoury College of Computer SciencesExample: Romania On holiday in Romania; currently in Arad. Flight leaves tomorrow from Bucharest Formulate goal: Be in Bucharest Formulate](https://reader034.vdocument.in/reader034/viewer/2022042808/5f8555bcecf4e100036478a7/html5/thumbnails/47.jpg)
BFS Properties
Is BFS complete?– is it guaranteed to find a solution if one exists?
What is the time complexity of BFS?– how many states are expanded before finding a solution?
– b: branching factor– d: depth of shallowest solution– complexity =
What is the space complexity of BFS?– how much memory is required?
– complexity =
Is BFS optimal?– is it guaranteed to find the best solution (shortest path)?
![Page 48: Graph Search - Khoury College of Computer SciencesExample: Romania On holiday in Romania; currently in Arad. Flight leaves tomorrow from Bucharest Formulate goal: Be in Bucharest Formulate](https://reader034.vdocument.in/reader034/viewer/2022042808/5f8555bcecf4e100036478a7/html5/thumbnails/48.jpg)
Uniform Cost Search (UCS)
![Page 49: Graph Search - Khoury College of Computer SciencesExample: Romania On holiday in Romania; currently in Arad. Flight leaves tomorrow from Bucharest Formulate goal: Be in Bucharest Formulate](https://reader034.vdocument.in/reader034/viewer/2022042808/5f8555bcecf4e100036478a7/html5/thumbnails/49.jpg)
Uniform Cost Search (UCS)
Notice the distances between cities
![Page 50: Graph Search - Khoury College of Computer SciencesExample: Romania On holiday in Romania; currently in Arad. Flight leaves tomorrow from Bucharest Formulate goal: Be in Bucharest Formulate](https://reader034.vdocument.in/reader034/viewer/2022042808/5f8555bcecf4e100036478a7/html5/thumbnails/50.jpg)
Uniform Cost Search (UCS)
Notice the distances between cities– does BFS take these distances into account?
![Page 51: Graph Search - Khoury College of Computer SciencesExample: Romania On holiday in Romania; currently in Arad. Flight leaves tomorrow from Bucharest Formulate goal: Be in Bucharest Formulate](https://reader034.vdocument.in/reader034/viewer/2022042808/5f8555bcecf4e100036478a7/html5/thumbnails/51.jpg)
Uniform Cost Search (UCS)
Notice the distances between cities– does BFS take these distances into account?– does BFS find the path w/ shortest milage?
![Page 52: Graph Search - Khoury College of Computer SciencesExample: Romania On holiday in Romania; currently in Arad. Flight leaves tomorrow from Bucharest Formulate goal: Be in Bucharest Formulate](https://reader034.vdocument.in/reader034/viewer/2022042808/5f8555bcecf4e100036478a7/html5/thumbnails/52.jpg)
Uniform Cost Search (UCS)
Notice the distances between cities– does BFS take these distances into account?– does BFS find the path w/ shortest milage?– compare S-F-B with S-R-P-B. Which costs less?
![Page 53: Graph Search - Khoury College of Computer SciencesExample: Romania On holiday in Romania; currently in Arad. Flight leaves tomorrow from Bucharest Formulate goal: Be in Bucharest Formulate](https://reader034.vdocument.in/reader034/viewer/2022042808/5f8555bcecf4e100036478a7/html5/thumbnails/53.jpg)
Uniform Cost Search (UCS)
Notice the distances between cities– does BFS take these distances into account?– does BFS find the path w/ shortest milage?– compare S-F-B with S-R-P-B. Which costs less?
How do we fix this?
![Page 54: Graph Search - Khoury College of Computer SciencesExample: Romania On holiday in Romania; currently in Arad. Flight leaves tomorrow from Bucharest Formulate goal: Be in Bucharest Formulate](https://reader034.vdocument.in/reader034/viewer/2022042808/5f8555bcecf4e100036478a7/html5/thumbnails/54.jpg)
Uniform Cost Search (UCS)
Notice the distances between cities– does BFS take these distances into account?– does BFS find the path w/ shortest milage?– compare S-F-B with S-R-P-B. Which costs less?
How do we fix this?UCS!
![Page 55: Graph Search - Khoury College of Computer SciencesExample: Romania On holiday in Romania; currently in Arad. Flight leaves tomorrow from Bucharest Formulate goal: Be in Bucharest Formulate](https://reader034.vdocument.in/reader034/viewer/2022042808/5f8555bcecf4e100036478a7/html5/thumbnails/55.jpg)
Uniform Cost Search (UCS)
Same as BFS except: expand node w/ smallest path cost
Length of path
![Page 56: Graph Search - Khoury College of Computer SciencesExample: Romania On holiday in Romania; currently in Arad. Flight leaves tomorrow from Bucharest Formulate goal: Be in Bucharest Formulate](https://reader034.vdocument.in/reader034/viewer/2022042808/5f8555bcecf4e100036478a7/html5/thumbnails/56.jpg)
Uniform Cost Search (UCS)
Same as BFS except: expand node w/ smallest path cost
Length of path
Cost of going from state A to B:
Minimum cost of path going from start state to B:
![Page 57: Graph Search - Khoury College of Computer SciencesExample: Romania On holiday in Romania; currently in Arad. Flight leaves tomorrow from Bucharest Formulate goal: Be in Bucharest Formulate](https://reader034.vdocument.in/reader034/viewer/2022042808/5f8555bcecf4e100036478a7/html5/thumbnails/57.jpg)
Uniform Cost Search (UCS)
Same as BFS except: expand node w/ smallest path cost
Length of path
Cost of going from state A to B:
Minimum cost of path going from start state to B:
BFS: expands states in order of hops from start
UCS: expands states in order of
![Page 58: Graph Search - Khoury College of Computer SciencesExample: Romania On holiday in Romania; currently in Arad. Flight leaves tomorrow from Bucharest Formulate goal: Be in Bucharest Formulate](https://reader034.vdocument.in/reader034/viewer/2022042808/5f8555bcecf4e100036478a7/html5/thumbnails/58.jpg)
Uniform Cost Search (UCS)
Same as BFS except: expand node w/ smallest path cost
Length of path
Cost of going from state A to B:
Minimum cost of path going from start state to B:
BFS: expands states in order of hops from start
UCS: expands states in order of How?
![Page 59: Graph Search - Khoury College of Computer SciencesExample: Romania On holiday in Romania; currently in Arad. Flight leaves tomorrow from Bucharest Formulate goal: Be in Bucharest Formulate](https://reader034.vdocument.in/reader034/viewer/2022042808/5f8555bcecf4e100036478a7/html5/thumbnails/59.jpg)
Uniform Cost Search (UCS)
Simple answer: change the FIFO to a priority queue– the priority of each element in the queue is its path cost.
![Page 60: Graph Search - Khoury College of Computer SciencesExample: Romania On holiday in Romania; currently in Arad. Flight leaves tomorrow from Bucharest Formulate goal: Be in Bucharest Formulate](https://reader034.vdocument.in/reader034/viewer/2022042808/5f8555bcecf4e100036478a7/html5/thumbnails/60.jpg)
Uniform Cost Search (UCS)
![Page 61: Graph Search - Khoury College of Computer SciencesExample: Romania On holiday in Romania; currently in Arad. Flight leaves tomorrow from Bucharest Formulate goal: Be in Bucharest Formulate](https://reader034.vdocument.in/reader034/viewer/2022042808/5f8555bcecf4e100036478a7/html5/thumbnails/61.jpg)
UCS
FringeA
Path Cost0
Explored set:
![Page 62: Graph Search - Khoury College of Computer SciencesExample: Romania On holiday in Romania; currently in Arad. Flight leaves tomorrow from Bucharest Formulate goal: Be in Bucharest Formulate](https://reader034.vdocument.in/reader034/viewer/2022042808/5f8555bcecf4e100036478a7/html5/thumbnails/62.jpg)
UCS
140 11875
Explored set: A
FringeASTZ
Path Cost014011875
![Page 63: Graph Search - Khoury College of Computer SciencesExample: Romania On holiday in Romania; currently in Arad. Flight leaves tomorrow from Bucharest Formulate goal: Be in Bucharest Formulate](https://reader034.vdocument.in/reader034/viewer/2022042808/5f8555bcecf4e100036478a7/html5/thumbnails/63.jpg)
UCS
140 11875
146
Explored set: A, Z
FringeASTZO
Path Cost014011875146
![Page 64: Graph Search - Khoury College of Computer SciencesExample: Romania On holiday in Romania; currently in Arad. Flight leaves tomorrow from Bucharest Formulate goal: Be in Bucharest Formulate](https://reader034.vdocument.in/reader034/viewer/2022042808/5f8555bcecf4e100036478a7/html5/thumbnails/64.jpg)
UCS
140 11875
146229
Explored set: A, Z, T
FringeASTZOL
Path Cost014011875146229
![Page 65: Graph Search - Khoury College of Computer SciencesExample: Romania On holiday in Romania; currently in Arad. Flight leaves tomorrow from Bucharest Formulate goal: Be in Bucharest Formulate](https://reader034.vdocument.in/reader034/viewer/2022042808/5f8555bcecf4e100036478a7/html5/thumbnails/65.jpg)
UCS
140 11875
239 220 146229
Explored set: A, Z, T, S
FringeASTZOLFR
Path Cost014011875146229239220
![Page 66: Graph Search - Khoury College of Computer SciencesExample: Romania On holiday in Romania; currently in Arad. Flight leaves tomorrow from Bucharest Formulate goal: Be in Bucharest Formulate](https://reader034.vdocument.in/reader034/viewer/2022042808/5f8555bcecf4e100036478a7/html5/thumbnails/66.jpg)
UCS
140 11875
239 220 146229
Explored set: A, Z, T, S, O
FringeASTZOLFR
Path Cost014011875146229239220
![Page 67: Graph Search - Khoury College of Computer SciencesExample: Romania On holiday in Romania; currently in Arad. Flight leaves tomorrow from Bucharest Formulate goal: Be in Bucharest Formulate](https://reader034.vdocument.in/reader034/viewer/2022042808/5f8555bcecf4e100036478a7/html5/thumbnails/67.jpg)
UCS
140 11875
239 220
336 317
146229
Explored set: A, Z, T, S, O, R
FringeASTZOLFRCP
Path Cost014011875146229239220336317
![Page 68: Graph Search - Khoury College of Computer SciencesExample: Romania On holiday in Romania; currently in Arad. Flight leaves tomorrow from Bucharest Formulate goal: Be in Bucharest Formulate](https://reader034.vdocument.in/reader034/viewer/2022042808/5f8555bcecf4e100036478a7/html5/thumbnails/68.jpg)
UCS
140 11875
239 220
336 317
146229
299
Explored set: A, Z, T, S, O, R, L
FringeASTZOLFRCPM
Path Cost014011875146229239220336317299
![Page 69: Graph Search - Khoury College of Computer SciencesExample: Romania On holiday in Romania; currently in Arad. Flight leaves tomorrow from Bucharest Formulate goal: Be in Bucharest Formulate](https://reader034.vdocument.in/reader034/viewer/2022042808/5f8555bcecf4e100036478a7/html5/thumbnails/69.jpg)
UCS
140 11875
239 220
336 317
146229
299
Explored set: A, Z, T, S, R, L
FringeASTZTLFRCPM
Path Cost014011875146229239220336317299
When does this end?
![Page 70: Graph Search - Khoury College of Computer SciencesExample: Romania On holiday in Romania; currently in Arad. Flight leaves tomorrow from Bucharest Formulate goal: Be in Bucharest Formulate](https://reader034.vdocument.in/reader034/viewer/2022042808/5f8555bcecf4e100036478a7/html5/thumbnails/70.jpg)
UCS
140 11875
239 220
336 317
146229
299
Explored set: A, Z, T, S, R, L
FringeASTZTLFRCPM
Path Cost014011875146229239220336317299
When does this end?– when the goal state is removed from the queue
![Page 71: Graph Search - Khoury College of Computer SciencesExample: Romania On holiday in Romania; currently in Arad. Flight leaves tomorrow from Bucharest Formulate goal: Be in Bucharest Formulate](https://reader034.vdocument.in/reader034/viewer/2022042808/5f8555bcecf4e100036478a7/html5/thumbnails/71.jpg)
UCS
140 11875
239 220
336 317
146229
299
Explored set: A, Z, T, S, R, L
FringeASTZTLFRCPM
Path Cost014011875146229239220336317299
When does this end?– when the goal state is removed from the queue– NOT when the goal state is expanded
![Page 72: Graph Search - Khoury College of Computer SciencesExample: Romania On holiday in Romania; currently in Arad. Flight leaves tomorrow from Bucharest Formulate goal: Be in Bucharest Formulate](https://reader034.vdocument.in/reader034/viewer/2022042808/5f8555bcecf4e100036478a7/html5/thumbnails/72.jpg)
UCS
![Page 73: Graph Search - Khoury College of Computer SciencesExample: Romania On holiday in Romania; currently in Arad. Flight leaves tomorrow from Bucharest Formulate goal: Be in Bucharest Formulate](https://reader034.vdocument.in/reader034/viewer/2022042808/5f8555bcecf4e100036478a7/html5/thumbnails/73.jpg)
UCS Properties
Is UCS complete?– is it guaranteed to find a solution if one exists?
What is the time complexity of UCS?– how many states are expanded before finding a solution?
– b: branching factor– C*: cost of optimal solution– e: min one-step cost– complexity =
What is the space complexity of BFS?– how much memory is required?
– complexity =
Is BFS optimal?– is it guaranteed to find the best solution (shortest path)?
![Page 74: Graph Search - Khoury College of Computer SciencesExample: Romania On holiday in Romania; currently in Arad. Flight leaves tomorrow from Bucharest Formulate goal: Be in Bucharest Formulate](https://reader034.vdocument.in/reader034/viewer/2022042808/5f8555bcecf4e100036478a7/html5/thumbnails/74.jpg)
S
a
b
d p
a
c
e
p
h
f
r
q
q c G
a
qe
p
h
f
r
q
q c G
a
Strategy: expand cheapest node first:
Fringe is a priority queue (priority: cumulative cost)
3 9 1
16411
5
713
8
1011
17 11
0
6Cost contours
UCS vs BFS
![Page 75: Graph Search - Khoury College of Computer SciencesExample: Romania On holiday in Romania; currently in Arad. Flight leaves tomorrow from Bucharest Formulate goal: Be in Bucharest Formulate](https://reader034.vdocument.in/reader034/viewer/2022042808/5f8555bcecf4e100036478a7/html5/thumbnails/75.jpg)
UCS vs BFS
S
a
b
d p
a
c
e
p
h
f
r
q
q c G
a
qe
p
h
f
r
q
q c G
a
Search
Tiers
Strategy: expand a shallowest node frst
Implementaton: Fringe is a FIFO queue
![Page 76: Graph Search - Khoury College of Computer SciencesExample: Romania On holiday in Romania; currently in Arad. Flight leaves tomorrow from Bucharest Formulate goal: Be in Bucharest Formulate](https://reader034.vdocument.in/reader034/viewer/2022042808/5f8555bcecf4e100036478a7/html5/thumbnails/76.jpg)
UCS vs BFS
Start Goal
…
c 3
c 2
c 1
Remember: UCS explores increasing cost contours
The good: UCS is complete and optmal!
The bad:
Explores optons in every “directon”
No informaton about goal locaton
We’ll fx that soon!
![Page 77: Graph Search - Khoury College of Computer SciencesExample: Romania On holiday in Romania; currently in Arad. Flight leaves tomorrow from Bucharest Formulate goal: Be in Bucharest Formulate](https://reader034.vdocument.in/reader034/viewer/2022042808/5f8555bcecf4e100036478a7/html5/thumbnails/77.jpg)
Depth First Search (DFS)
![Page 78: Graph Search - Khoury College of Computer SciencesExample: Romania On holiday in Romania; currently in Arad. Flight leaves tomorrow from Bucharest Formulate goal: Be in Bucharest Formulate](https://reader034.vdocument.in/reader034/viewer/2022042808/5f8555bcecf4e100036478a7/html5/thumbnails/78.jpg)
DFS
fringeFringeA
![Page 79: Graph Search - Khoury College of Computer SciencesExample: Romania On holiday in Romania; currently in Arad. Flight leaves tomorrow from Bucharest Formulate goal: Be in Bucharest Formulate](https://reader034.vdocument.in/reader034/viewer/2022042808/5f8555bcecf4e100036478a7/html5/thumbnails/79.jpg)
DFS
fringe
FringeABC
![Page 80: Graph Search - Khoury College of Computer SciencesExample: Romania On holiday in Romania; currently in Arad. Flight leaves tomorrow from Bucharest Formulate goal: Be in Bucharest Formulate](https://reader034.vdocument.in/reader034/viewer/2022042808/5f8555bcecf4e100036478a7/html5/thumbnails/80.jpg)
DFS
fringe
FringeABCFG
![Page 81: Graph Search - Khoury College of Computer SciencesExample: Romania On holiday in Romania; currently in Arad. Flight leaves tomorrow from Bucharest Formulate goal: Be in Bucharest Formulate](https://reader034.vdocument.in/reader034/viewer/2022042808/5f8555bcecf4e100036478a7/html5/thumbnails/81.jpg)
DFS
FringeABCFGHI
![Page 82: Graph Search - Khoury College of Computer SciencesExample: Romania On holiday in Romania; currently in Arad. Flight leaves tomorrow from Bucharest Formulate goal: Be in Bucharest Formulate](https://reader034.vdocument.in/reader034/viewer/2022042808/5f8555bcecf4e100036478a7/html5/thumbnails/82.jpg)
DFS
FringeABCFGHI
Which state gets removed next from the fringe?
![Page 83: Graph Search - Khoury College of Computer SciencesExample: Romania On holiday in Romania; currently in Arad. Flight leaves tomorrow from Bucharest Formulate goal: Be in Bucharest Formulate](https://reader034.vdocument.in/reader034/viewer/2022042808/5f8555bcecf4e100036478a7/html5/thumbnails/83.jpg)
DFS
FringeABCFGHI
Which state gets removed next from the fringe?
What kind of a queue is this?
![Page 84: Graph Search - Khoury College of Computer SciencesExample: Romania On holiday in Romania; currently in Arad. Flight leaves tomorrow from Bucharest Formulate goal: Be in Bucharest Formulate](https://reader034.vdocument.in/reader034/viewer/2022042808/5f8555bcecf4e100036478a7/html5/thumbnails/84.jpg)
DFS
FringeABCFGHI
Which state gets removed next from the fringe?
What kind of a queue is this? LIFO Queue!(last in first out)
![Page 85: Graph Search - Khoury College of Computer SciencesExample: Romania On holiday in Romania; currently in Arad. Flight leaves tomorrow from Bucharest Formulate goal: Be in Bucharest Formulate](https://reader034.vdocument.in/reader034/viewer/2022042808/5f8555bcecf4e100036478a7/html5/thumbnails/85.jpg)
DFS vs BFS: which one is this?
![Page 86: Graph Search - Khoury College of Computer SciencesExample: Romania On holiday in Romania; currently in Arad. Flight leaves tomorrow from Bucharest Formulate goal: Be in Bucharest Formulate](https://reader034.vdocument.in/reader034/viewer/2022042808/5f8555bcecf4e100036478a7/html5/thumbnails/86.jpg)
DFS vs BFS: which one is this?
![Page 87: Graph Search - Khoury College of Computer SciencesExample: Romania On holiday in Romania; currently in Arad. Flight leaves tomorrow from Bucharest Formulate goal: Be in Bucharest Formulate](https://reader034.vdocument.in/reader034/viewer/2022042808/5f8555bcecf4e100036478a7/html5/thumbnails/87.jpg)
BFS/UCS: which is this?
![Page 88: Graph Search - Khoury College of Computer SciencesExample: Romania On holiday in Romania; currently in Arad. Flight leaves tomorrow from Bucharest Formulate goal: Be in Bucharest Formulate](https://reader034.vdocument.in/reader034/viewer/2022042808/5f8555bcecf4e100036478a7/html5/thumbnails/88.jpg)
BFS/UCS: which is this?
![Page 89: Graph Search - Khoury College of Computer SciencesExample: Romania On holiday in Romania; currently in Arad. Flight leaves tomorrow from Bucharest Formulate goal: Be in Bucharest Formulate](https://reader034.vdocument.in/reader034/viewer/2022042808/5f8555bcecf4e100036478a7/html5/thumbnails/89.jpg)
DFS Properties: Graph search version
Is DFS complete?– only if you track the explored set in memory
What is the time complexity of DFS (graph version)?– how many states are expanded before finding a solution?
– complexity = number of states in the graph
What is the space complexity of DFS (graph version)?– how much memory is required?
– complexity = number of states in the graph
Is DFS optimal?– is it guaranteed to find the best solution (shortest path)?
This is the “graph search” version of the algorithm
![Page 90: Graph Search - Khoury College of Computer SciencesExample: Romania On holiday in Romania; currently in Arad. Flight leaves tomorrow from Bucharest Formulate goal: Be in Bucharest Formulate](https://reader034.vdocument.in/reader034/viewer/2022042808/5f8555bcecf4e100036478a7/html5/thumbnails/90.jpg)
DFS Properties: Graph search version
Is DFS complete?– only if you track the explored set in memory
What is the time complexity of DFS (graph version)?– how many states are expanded before finding a solution?
– complexity = number of states in the graph
What is the space complexity of DFS (graph version)?– how much memory is required?
– complexity = number of states in the graph
Is DFS optimal?– is it guaranteed to find the best solution (shortest path)?
This is the “graph search” version of the algorithm
So why would we ever use this algorithm?
![Page 91: Graph Search - Khoury College of Computer SciencesExample: Romania On holiday in Romania; currently in Arad. Flight leaves tomorrow from Bucharest Formulate goal: Be in Bucharest Formulate](https://reader034.vdocument.in/reader034/viewer/2022042808/5f8555bcecf4e100036478a7/html5/thumbnails/91.jpg)
DFS: Tree search version
Suppose you don't track the explored set.– why wouldn't you want to do that?
This is the “tree search” version of the algorithm
![Page 92: Graph Search - Khoury College of Computer SciencesExample: Romania On holiday in Romania; currently in Arad. Flight leaves tomorrow from Bucharest Formulate goal: Be in Bucharest Formulate](https://reader034.vdocument.in/reader034/viewer/2022042808/5f8555bcecf4e100036478a7/html5/thumbnails/92.jpg)
DFS: Tree search version
Suppose you don't track the explored set.– why wouldn't you want to do that?
This is the “tree search” version of the algorithm
What is the space complexity of DFS (tree version)?– how much memory is required?
– b: branching factor– m: maximum depth of any node– complexity =
![Page 93: Graph Search - Khoury College of Computer SciencesExample: Romania On holiday in Romania; currently in Arad. Flight leaves tomorrow from Bucharest Formulate goal: Be in Bucharest Formulate](https://reader034.vdocument.in/reader034/viewer/2022042808/5f8555bcecf4e100036478a7/html5/thumbnails/93.jpg)
DFS: Tree search version
Suppose you don't track the explored set.– why wouldn't you want to do that?
This is the “tree search” version of the algorithm
What is the space complexity of DFS (tree version)?– how much memory is required?
– b: branching factor– m: maximum depth of any node– complexity = This is why we might
want to use DFS
![Page 94: Graph Search - Khoury College of Computer SciencesExample: Romania On holiday in Romania; currently in Arad. Flight leaves tomorrow from Bucharest Formulate goal: Be in Bucharest Formulate](https://reader034.vdocument.in/reader034/viewer/2022042808/5f8555bcecf4e100036478a7/html5/thumbnails/94.jpg)
DFS: Tree search version
Suppose you don't track the explored set.– why wouldn't you want to do that?
This is the “tree search” version of the algorithm
What is the space complexity of DFS (tree version)?– how much memory is required?
– b: branching factor– m: maximum depth of any node– complexity =
What is the time complexity of DFS (tree version)?– how many states are expanded before finding a solution?
– complexity =
![Page 95: Graph Search - Khoury College of Computer SciencesExample: Romania On holiday in Romania; currently in Arad. Flight leaves tomorrow from Bucharest Formulate goal: Be in Bucharest Formulate](https://reader034.vdocument.in/reader034/viewer/2022042808/5f8555bcecf4e100036478a7/html5/thumbnails/95.jpg)
DFS: Tree search version
Suppose you don't track the explored set.– why wouldn't you want to do that?
This is the “tree search” version of the algorithm
What is the space complexity of DFS (tree version)?– how much memory is required?
– b: branching factor– m: maximum depth of any node– complexity =
What is the time complexity of DFS (tree version)?– how many states are expanded before finding a solution?
– complexity =
Is it complete?
![Page 96: Graph Search - Khoury College of Computer SciencesExample: Romania On holiday in Romania; currently in Arad. Flight leaves tomorrow from Bucharest Formulate goal: Be in Bucharest Formulate](https://reader034.vdocument.in/reader034/viewer/2022042808/5f8555bcecf4e100036478a7/html5/thumbnails/96.jpg)
DFS: Tree search version
Suppose you don't track the explored set.– why wouldn't you want to do that?
This is the “tree search” version of the algorithm
What is the space complexity of DFS (tree version)?– how much memory is required?
– b: branching factor– m: maximum depth of any node– complexity =
What is the time complexity of DFS (tree version)?– how many states are expanded before finding a solution?
– complexity =
Is it complete?NO!
![Page 97: Graph Search - Khoury College of Computer SciencesExample: Romania On holiday in Romania; currently in Arad. Flight leaves tomorrow from Bucharest Formulate goal: Be in Bucharest Formulate](https://reader034.vdocument.in/reader034/viewer/2022042808/5f8555bcecf4e100036478a7/html5/thumbnails/97.jpg)
DFS: Tree search version
Suppose you don't track the explored set.– why wouldn't you want to do that?
This is the “tree search” version of the algorithm
What is the space complexity of DFS (tree version)?– how much memory is required?
– b: branching factor– m: maximum depth of any node– complexity =
What is the time complexity of DFS (tree version)?– how many states are expanded before finding a solution?
– complexity =
Is it complete?NO!
What do we do???
![Page 98: Graph Search - Khoury College of Computer SciencesExample: Romania On holiday in Romania; currently in Arad. Flight leaves tomorrow from Bucharest Formulate goal: Be in Bucharest Formulate](https://reader034.vdocument.in/reader034/viewer/2022042808/5f8555bcecf4e100036478a7/html5/thumbnails/98.jpg)
IDS: Iterative deepening search
What is IDS?– do depth-limited DFS in stages, increasing the maximum depth at each stage
![Page 99: Graph Search - Khoury College of Computer SciencesExample: Romania On holiday in Romania; currently in Arad. Flight leaves tomorrow from Bucharest Formulate goal: Be in Bucharest Formulate](https://reader034.vdocument.in/reader034/viewer/2022042808/5f8555bcecf4e100036478a7/html5/thumbnails/99.jpg)
IDS: Iterative deepening search
What is IDS?– do depth-limited DFS in stages, increasing the maximum depth at each stage
What is depth limited search?– any guesses?
![Page 100: Graph Search - Khoury College of Computer SciencesExample: Romania On holiday in Romania; currently in Arad. Flight leaves tomorrow from Bucharest Formulate goal: Be in Bucharest Formulate](https://reader034.vdocument.in/reader034/viewer/2022042808/5f8555bcecf4e100036478a7/html5/thumbnails/100.jpg)
IDS: Iterative deepening search
What is IDS?– do depth-limited DFS in stages, increasing the maximum depth at each stage
What is depth limited search?– do DFS up to a certain pre-specified depth
![Page 101: Graph Search - Khoury College of Computer SciencesExample: Romania On holiday in Romania; currently in Arad. Flight leaves tomorrow from Bucharest Formulate goal: Be in Bucharest Formulate](https://reader034.vdocument.in/reader034/viewer/2022042808/5f8555bcecf4e100036478a7/html5/thumbnails/101.jpg)
IDS: Iterative deepening search
…b
Idea: get DFS’s space advantage with BFS’s tme / shallow-soluton advantages
Run a DFS with depth limit 1. If no soluton…
Run a DFS with depth limit 2. If no soluton…
Run a DFS with depth limit 3. …..
Isn’t that wastefully redundant?
Generally most work happens in the lowest level searched, so not so bad!
![Page 102: Graph Search - Khoury College of Computer SciencesExample: Romania On holiday in Romania; currently in Arad. Flight leaves tomorrow from Bucharest Formulate goal: Be in Bucharest Formulate](https://reader034.vdocument.in/reader034/viewer/2022042808/5f8555bcecf4e100036478a7/html5/thumbnails/102.jpg)
IDS
![Page 103: Graph Search - Khoury College of Computer SciencesExample: Romania On holiday in Romania; currently in Arad. Flight leaves tomorrow from Bucharest Formulate goal: Be in Bucharest Formulate](https://reader034.vdocument.in/reader034/viewer/2022042808/5f8555bcecf4e100036478a7/html5/thumbnails/103.jpg)
IDS
What is the space complexity of IDS (tree version)?– how much memory is required?
– b: branching factor– m: maximum depth of any node– complexity =
What is the time complexity of DFS (tree version)?– how many states are expanded before finding a solution?
– complexity =
Is it complete?
![Page 104: Graph Search - Khoury College of Computer SciencesExample: Romania On holiday in Romania; currently in Arad. Flight leaves tomorrow from Bucharest Formulate goal: Be in Bucharest Formulate](https://reader034.vdocument.in/reader034/viewer/2022042808/5f8555bcecf4e100036478a7/html5/thumbnails/104.jpg)
IDS
What is the space complexity of IDS (tree version)?– how much memory is required?
– b: branching factor– m: maximum depth of any node– complexity =
What is the time complexity of DFS (tree version)?– how many states are expanded before finding a solution?
– complexity =
Is it complete? YES!!!
Is it optimal?
![Page 105: Graph Search - Khoury College of Computer SciencesExample: Romania On holiday in Romania; currently in Arad. Flight leaves tomorrow from Bucharest Formulate goal: Be in Bucharest Formulate](https://reader034.vdocument.in/reader034/viewer/2022042808/5f8555bcecf4e100036478a7/html5/thumbnails/105.jpg)
IDS
What is the space complexity of IDS (tree version)?– how much memory is required?
– b: branching factor– m: maximum depth of any node– complexity =
What is the time complexity of DFS (tree version)?– how many states are expanded before finding a solution?
– complexity =
Is it complete? YES!!!
Is it optimal? YES!!!
![Page 106: Graph Search - Khoury College of Computer SciencesExample: Romania On holiday in Romania; currently in Arad. Flight leaves tomorrow from Bucharest Formulate goal: Be in Bucharest Formulate](https://reader034.vdocument.in/reader034/viewer/2022042808/5f8555bcecf4e100036478a7/html5/thumbnails/106.jpg)
General thoughts about search
If your model is wrong, then your solution will be wrong.
• In November 2010, Nicaraguan troops unknowingly crossed the border to Costa Rica, removed that country's flag and replaced it with their own. The reason: Google Maps told the troops' commander the territory belonged to Nicaragua.