ai search - uwyo.educlan/teach/ai18/search_intro.pdfsearching for a solution is equivalent to...
TRANSCRIPT
![Page 1: AI Search - uwyo.educlan/teach/ai18/search_intro.pdfSearching for a solution is equivalent to searching in a tree (or, generating a tree). Find Solution by Search Tree A frontier is](https://reader036.vdocuments.net/reader036/viewer/2022070801/5f029cc57e708231d40521f3/html5/thumbnails/1.jpg)
AI Search
Chao Lan
![Page 2: AI Search - uwyo.educlan/teach/ai18/search_intro.pdfSearching for a solution is equivalent to searching in a tree (or, generating a tree). Find Solution by Search Tree A frontier is](https://reader036.vdocuments.net/reader036/viewer/2022070801/5f029cc57e708231d40521f3/html5/thumbnails/2.jpg)
Outline
Introduction
Uninformed Search vs. Informed Search
![Page 3: AI Search - uwyo.educlan/teach/ai18/search_intro.pdfSearching for a solution is equivalent to searching in a tree (or, generating a tree). Find Solution by Search Tree A frontier is](https://reader036.vdocuments.net/reader036/viewer/2022070801/5f029cc57e708231d40521f3/html5/thumbnails/3.jpg)
Outline
Introduction
Uninformed Search vs. Informed Search
![Page 4: AI Search - uwyo.educlan/teach/ai18/search_intro.pdfSearching for a solution is equivalent to searching in a tree (or, generating a tree). Find Solution by Search Tree A frontier is](https://reader036.vdocuments.net/reader036/viewer/2022070801/5f029cc57e708231d40521f3/html5/thumbnails/4.jpg)
IntroductionWhat is search?
What are the basic concepts in search?
What are the applications of search?
Find solution by tree search.
What is the data structure of search algorithm?
How to evaluate search algorithm?
![Page 5: AI Search - uwyo.educlan/teach/ai18/search_intro.pdfSearching for a solution is equivalent to searching in a tree (or, generating a tree). Find Solution by Search Tree A frontier is](https://reader036.vdocuments.net/reader036/viewer/2022070801/5f029cc57e708231d40521f3/html5/thumbnails/5.jpg)
What is search?
Search is about an agent
“finding a sequence of actions to achieve its goal when no single action can do”.
We will assume a solution exists and is a fixed sequence of known actions.
![Page 6: AI Search - uwyo.educlan/teach/ai18/search_intro.pdfSearching for a solution is equivalent to searching in a tree (or, generating a tree). Find Solution by Search Tree A frontier is](https://reader036.vdocuments.net/reader036/viewer/2022070801/5f029cc57e708231d40521f3/html5/thumbnails/6.jpg)
Example: 8-Puzzle
![Page 7: AI Search - uwyo.educlan/teach/ai18/search_intro.pdfSearching for a solution is equivalent to searching in a tree (or, generating a tree). Find Solution by Search Tree A frontier is](https://reader036.vdocuments.net/reader036/viewer/2022070801/5f029cc57e708231d40521f3/html5/thumbnails/7.jpg)
Example: Vacuum Cleaner
![Page 8: AI Search - uwyo.educlan/teach/ai18/search_intro.pdfSearching for a solution is equivalent to searching in a tree (or, generating a tree). Find Solution by Search Tree A frontier is](https://reader036.vdocuments.net/reader036/viewer/2022070801/5f029cc57e708231d40521f3/html5/thumbnails/8.jpg)
Example: Route-Finding
![Page 9: AI Search - uwyo.educlan/teach/ai18/search_intro.pdfSearching for a solution is equivalent to searching in a tree (or, generating a tree). Find Solution by Search Tree A frontier is](https://reader036.vdocuments.net/reader036/viewer/2022070801/5f029cc57e708231d40521f3/html5/thumbnails/9.jpg)
IntroductionWhat is search?
What are the basic concepts in search?
What are the applications of search?
Find solution by tree search.
What is the data structure of search algorithm?
How to evaluate search algorithm?
![Page 10: AI Search - uwyo.educlan/teach/ai18/search_intro.pdfSearching for a solution is equivalent to searching in a tree (or, generating a tree). Find Solution by Search Tree A frontier is](https://reader036.vdocuments.net/reader036/viewer/2022070801/5f029cc57e708231d40521f3/html5/thumbnails/10.jpg)
Concepts state space: set of all states reachable from the initial state by any sequence of actions
![Page 11: AI Search - uwyo.educlan/teach/ai18/search_intro.pdfSearching for a solution is equivalent to searching in a tree (or, generating a tree). Find Solution by Search Tree A frontier is](https://reader036.vdocuments.net/reader036/viewer/2022070801/5f029cc57e708231d40521f3/html5/thumbnails/11.jpg)
Concepts state space: set of all states reachable from the initial state by any sequence of actions
initial state: state where agent starts
![Page 12: AI Search - uwyo.educlan/teach/ai18/search_intro.pdfSearching for a solution is equivalent to searching in a tree (or, generating a tree). Find Solution by Search Tree A frontier is](https://reader036.vdocuments.net/reader036/viewer/2022070801/5f029cc57e708231d40521f3/html5/thumbnails/12.jpg)
Concepts state space: set of all states reachable from the initial state by any sequence of actions
initial state: state where agent starts
applicable action: an action that can be taken from the current state
![Page 13: AI Search - uwyo.educlan/teach/ai18/search_intro.pdfSearching for a solution is equivalent to searching in a tree (or, generating a tree). Find Solution by Search Tree A frontier is](https://reader036.vdocuments.net/reader036/viewer/2022070801/5f029cc57e708231d40521f3/html5/thumbnails/13.jpg)
Concepts state space: set of all states reachable from the initial state by any sequence of actions
initial state: state where agent starts
applicable action: an action that can be taken from the current state
transition model: a function mapping (current state,action) to a new state.
![Page 14: AI Search - uwyo.educlan/teach/ai18/search_intro.pdfSearching for a solution is equivalent to searching in a tree (or, generating a tree). Find Solution by Search Tree A frontier is](https://reader036.vdocuments.net/reader036/viewer/2022070801/5f029cc57e708231d40521f3/html5/thumbnails/14.jpg)
Concepts state space: set of all states reachable from the initial state by any sequence of actions
initial state: state where agent starts
applicable action: an action that can be taken from the current state
transition model: a function mapping (current state,action) to a new state.
successor: a state reachable from a given state by a single action
![Page 15: AI Search - uwyo.educlan/teach/ai18/search_intro.pdfSearching for a solution is equivalent to searching in a tree (or, generating a tree). Find Solution by Search Tree A frontier is](https://reader036.vdocuments.net/reader036/viewer/2022070801/5f029cc57e708231d40521f3/html5/thumbnails/15.jpg)
Concepts (Cont.) graph representation of state space (node, link, cost)
![Page 16: AI Search - uwyo.educlan/teach/ai18/search_intro.pdfSearching for a solution is equivalent to searching in a tree (or, generating a tree). Find Solution by Search Tree A frontier is](https://reader036.vdocuments.net/reader036/viewer/2022070801/5f029cc57e708231d40521f3/html5/thumbnails/16.jpg)
Concepts (Cont.) graph representation of state space (node, link, cost)
path: a sequence of states connected by a sequence of actions
![Page 17: AI Search - uwyo.educlan/teach/ai18/search_intro.pdfSearching for a solution is equivalent to searching in a tree (or, generating a tree). Find Solution by Search Tree A frontier is](https://reader036.vdocuments.net/reader036/viewer/2022070801/5f029cc57e708231d40521f3/html5/thumbnails/17.jpg)
Concepts (Cont.) graph representation of state space (node, link, cost)
path: a sequence of states connected by a sequence of actions
step cost: cost of taking an action in one state to reach another state
![Page 18: AI Search - uwyo.educlan/teach/ai18/search_intro.pdfSearching for a solution is equivalent to searching in a tree (or, generating a tree). Find Solution by Search Tree A frontier is](https://reader036.vdocuments.net/reader036/viewer/2022070801/5f029cc57e708231d40521f3/html5/thumbnails/18.jpg)
Concepts (Cont.) graph representation of state space (node, link, cost)
path: a sequence of states connected by a sequence of actions
step cost: cost of taking an action in one state to reach another state
path cost: sum of step costs in the path
![Page 19: AI Search - uwyo.educlan/teach/ai18/search_intro.pdfSearching for a solution is equivalent to searching in a tree (or, generating a tree). Find Solution by Search Tree A frontier is](https://reader036.vdocuments.net/reader036/viewer/2022070801/5f029cc57e708231d40521f3/html5/thumbnails/19.jpg)
Concepts (Cont.) graph representation of state space (node, link, cost)
path: a sequence of states connected by a sequence of actions
step cost: cost of taking an action in one state to reach another state
path cost: sum of step costs in the path
goal test: determine whether a given state is a goal state
![Page 20: AI Search - uwyo.educlan/teach/ai18/search_intro.pdfSearching for a solution is equivalent to searching in a tree (or, generating a tree). Find Solution by Search Tree A frontier is](https://reader036.vdocuments.net/reader036/viewer/2022070801/5f029cc57e708231d40521f3/html5/thumbnails/20.jpg)
Concepts (Cont.) graph representation of state space (node, link, cost)
path: a sequence of states connected by a sequence of actions
step cost: cost of taking an action in one state to reach another state
path cost: sum of step costs in the path
goal test: determine whether a given state is a goal state
solution: a sequence of actions that leads from the initial state to a goal state
![Page 21: AI Search - uwyo.educlan/teach/ai18/search_intro.pdfSearching for a solution is equivalent to searching in a tree (or, generating a tree). Find Solution by Search Tree A frontier is](https://reader036.vdocuments.net/reader036/viewer/2022070801/5f029cc57e708231d40521f3/html5/thumbnails/21.jpg)
Concepts (Cont.) graph representation of state space (node, link, cost)
path: a sequence of states connected by a sequence of actions
step cost: cost of taking an action in one state to reach another state
path cost: sum of step costs in the path
goal test: determine whether a given state is a goal state
solution: a sequence of actions that leads from the initial state to a goal state
optimal solution: a solution with the lowest path cost
![Page 22: AI Search - uwyo.educlan/teach/ai18/search_intro.pdfSearching for a solution is equivalent to searching in a tree (or, generating a tree). Find Solution by Search Tree A frontier is](https://reader036.vdocuments.net/reader036/viewer/2022070801/5f029cc57e708231d40521f3/html5/thumbnails/22.jpg)
ConceptsAbstraction is the process of removing detail from a representation in problem formulation.
![Page 23: AI Search - uwyo.educlan/teach/ai18/search_intro.pdfSearching for a solution is equivalent to searching in a tree (or, generating a tree). Find Solution by Search Tree A frontier is](https://reader036.vdocuments.net/reader036/viewer/2022070801/5f029cc57e708231d40521f3/html5/thumbnails/23.jpg)
IntroductionWhat is search?
What are the basic concepts in search?
What are the applications of search?
Find solution by tree search.
What is the data structure of search algorithm?
How to evaluate search algorithm?
![Page 24: AI Search - uwyo.educlan/teach/ai18/search_intro.pdfSearching for a solution is equivalent to searching in a tree (or, generating a tree). Find Solution by Search Tree A frontier is](https://reader036.vdocuments.net/reader036/viewer/2022070801/5f029cc57e708231d40521f3/html5/thumbnails/24.jpg)
Route-Finding Problem
![Page 25: AI Search - uwyo.educlan/teach/ai18/search_intro.pdfSearching for a solution is equivalent to searching in a tree (or, generating a tree). Find Solution by Search Tree A frontier is](https://reader036.vdocuments.net/reader036/viewer/2022070801/5f029cc57e708231d40521f3/html5/thumbnails/25.jpg)
Touring Problem
Visit each city at least once, and travel back to Arad.
![Page 26: AI Search - uwyo.educlan/teach/ai18/search_intro.pdfSearching for a solution is equivalent to searching in a tree (or, generating a tree). Find Solution by Search Tree A frontier is](https://reader036.vdocuments.net/reader036/viewer/2022070801/5f029cc57e708231d40521f3/html5/thumbnails/26.jpg)
Touring Problem
Visit each city at least once, and travel back to Arad.
Traveling Salesperson Problem
Visit each city exactly once, and travel back to Arad, with the shortest path.
![Page 27: AI Search - uwyo.educlan/teach/ai18/search_intro.pdfSearching for a solution is equivalent to searching in a tree (or, generating a tree). Find Solution by Search Tree A frontier is](https://reader036.vdocuments.net/reader036/viewer/2022070801/5f029cc57e708231d40521f3/html5/thumbnails/27.jpg)
VLSI Layout Problem
Position millions of components
and connections on a chip to
minimize area, circuit delays, stray
capacitances, and maximize
manufacturing yield.
![Page 28: AI Search - uwyo.educlan/teach/ai18/search_intro.pdfSearching for a solution is equivalent to searching in a tree (or, generating a tree). Find Solution by Search Tree A frontier is](https://reader036.vdocuments.net/reader036/viewer/2022070801/5f029cc57e708231d40521f3/html5/thumbnails/28.jpg)
Robot Navigation
Agent can move in a continuous
space with an infinite set of
possible actions and states.
(Route-finding problem focuses on
discrete space with a finite set of
possible actions and states.)
![Page 29: AI Search - uwyo.educlan/teach/ai18/search_intro.pdfSearching for a solution is equivalent to searching in a tree (or, generating a tree). Find Solution by Search Tree A frontier is](https://reader036.vdocuments.net/reader036/viewer/2022070801/5f029cc57e708231d40521f3/html5/thumbnails/29.jpg)
Automatic Assembly Sequencing
Find an order to assemble
different parts of some object.
![Page 30: AI Search - uwyo.educlan/teach/ai18/search_intro.pdfSearching for a solution is equivalent to searching in a tree (or, generating a tree). Find Solution by Search Tree A frontier is](https://reader036.vdocuments.net/reader036/viewer/2022070801/5f029cc57e708231d40521f3/html5/thumbnails/30.jpg)
IntroductionWhat is search?
What are the basic concepts in search?
What are the applications of search?
Find solution by tree search.
What is the data structure of search algorithm?
How to evaluate search algorithm?
![Page 31: AI Search - uwyo.educlan/teach/ai18/search_intro.pdfSearching for a solution is equivalent to searching in a tree (or, generating a tree). Find Solution by Search Tree A frontier is](https://reader036.vdocuments.net/reader036/viewer/2022070801/5f029cc57e708231d40521f3/html5/thumbnails/31.jpg)
Find Solution by Search Tree
Searching for a solution is equivalent to searching in a tree (or, generating a tree).
![Page 32: AI Search - uwyo.educlan/teach/ai18/search_intro.pdfSearching for a solution is equivalent to searching in a tree (or, generating a tree). Find Solution by Search Tree A frontier is](https://reader036.vdocuments.net/reader036/viewer/2022070801/5f029cc57e708231d40521f3/html5/thumbnails/32.jpg)
Find Solution by Search Tree
![Page 33: AI Search - uwyo.educlan/teach/ai18/search_intro.pdfSearching for a solution is equivalent to searching in a tree (or, generating a tree). Find Solution by Search Tree A frontier is](https://reader036.vdocuments.net/reader036/viewer/2022070801/5f029cc57e708231d40521f3/html5/thumbnails/33.jpg)
Find Solution by Search Tree
![Page 34: AI Search - uwyo.educlan/teach/ai18/search_intro.pdfSearching for a solution is equivalent to searching in a tree (or, generating a tree). Find Solution by Search Tree A frontier is](https://reader036.vdocuments.net/reader036/viewer/2022070801/5f029cc57e708231d40521f3/html5/thumbnails/34.jpg)
Find Solution by Search Tree
![Page 35: AI Search - uwyo.educlan/teach/ai18/search_intro.pdfSearching for a solution is equivalent to searching in a tree (or, generating a tree). Find Solution by Search Tree A frontier is](https://reader036.vdocuments.net/reader036/viewer/2022070801/5f029cc57e708231d40521f3/html5/thumbnails/35.jpg)
A frontier is a list of nodes to be expanded, e.g. {Sibiu, Timisoara, Zerind}.
Concept: Frontier
![Page 36: AI Search - uwyo.educlan/teach/ai18/search_intro.pdfSearching for a solution is equivalent to searching in a tree (or, generating a tree). Find Solution by Search Tree A frontier is](https://reader036.vdocuments.net/reader036/viewer/2022070801/5f029cc57e708231d40521f3/html5/thumbnails/36.jpg)
Avoid Repeated State and Loopy Path
Avoid repeated state and loopy path by maintaining a closed set.
![Page 37: AI Search - uwyo.educlan/teach/ai18/search_intro.pdfSearching for a solution is equivalent to searching in a tree (or, generating a tree). Find Solution by Search Tree A frontier is](https://reader036.vdocuments.net/reader036/viewer/2022070801/5f029cc57e708231d40521f3/html5/thumbnails/37.jpg)
IntroductionWhat is search?
What are the basic concepts in search?
What are the applications of search?
Find solution by tree search.
What is the data structure of search algorithm?
How to evaluate search algorithm?
![Page 38: AI Search - uwyo.educlan/teach/ai18/search_intro.pdfSearching for a solution is equivalent to searching in a tree (or, generating a tree). Find Solution by Search Tree A frontier is](https://reader036.vdocuments.net/reader036/viewer/2022070801/5f029cc57e708231d40521f3/html5/thumbnails/38.jpg)
Several concepts in this section are from data structure (COSC3020)...
![Page 39: AI Search - uwyo.educlan/teach/ai18/search_intro.pdfSearching for a solution is equivalent to searching in a tree (or, generating a tree). Find Solution by Search Tree A frontier is](https://reader036.vdocuments.net/reader036/viewer/2022070801/5f029cc57e708231d40521f3/html5/thumbnails/39.jpg)
Concept Review
Node
Edge
Parent Node
Child Node
Root Node
Leaf Node
![Page 40: AI Search - uwyo.educlan/teach/ai18/search_intro.pdfSearching for a solution is equivalent to searching in a tree (or, generating a tree). Find Solution by Search Tree A frontier is](https://reader036.vdocuments.net/reader036/viewer/2022070801/5f029cc57e708231d40521f3/html5/thumbnails/40.jpg)
A node contains four components
1. state: state of current node
2. parent node: state of parent node
3. action: action applied to the parent to generate the node
4. path-cost: cost of path from initial state to the node
Data Structure of a Node
![Page 41: AI Search - uwyo.educlan/teach/ai18/search_intro.pdfSearching for a solution is equivalent to searching in a tree (or, generating a tree). Find Solution by Search Tree A frontier is](https://reader036.vdocuments.net/reader036/viewer/2022070801/5f029cc57e708231d40521f3/html5/thumbnails/41.jpg)
The circled node has
1. State =
2. parent node =
3. action =
4. path-cost =
Example
![Page 42: AI Search - uwyo.educlan/teach/ai18/search_intro.pdfSearching for a solution is equivalent to searching in a tree (or, generating a tree). Find Solution by Search Tree A frontier is](https://reader036.vdocuments.net/reader036/viewer/2022070801/5f029cc57e708231d40521f3/html5/thumbnails/42.jpg)
The circled node has
1. State = Sibiu
2. parent node = Arad
3. action = turn east
4. path-cost = 140
Example
![Page 43: AI Search - uwyo.educlan/teach/ai18/search_intro.pdfSearching for a solution is equivalent to searching in a tree (or, generating a tree). Find Solution by Search Tree A frontier is](https://reader036.vdocuments.net/reader036/viewer/2022070801/5f029cc57e708231d40521f3/html5/thumbnails/43.jpg)
The circled node has
1. State =
2. parent node =
3. action =
4. path-cost =
Example 2
![Page 44: AI Search - uwyo.educlan/teach/ai18/search_intro.pdfSearching for a solution is equivalent to searching in a tree (or, generating a tree). Find Solution by Search Tree A frontier is](https://reader036.vdocuments.net/reader036/viewer/2022070801/5f029cc57e708231d40521f3/html5/thumbnails/44.jpg)
The circled node has
1. State = Fagaras
2. parent node = Sibiu
3. action = turn east
4. path-cost = 239
Example 2
![Page 45: AI Search - uwyo.educlan/teach/ai18/search_intro.pdfSearching for a solution is equivalent to searching in a tree (or, generating a tree). Find Solution by Search Tree A frontier is](https://reader036.vdocuments.net/reader036/viewer/2022070801/5f029cc57e708231d40521f3/html5/thumbnails/45.jpg)
Nodes are stored in a queue, e.g., Q = (Arad, Sibiu, Fagaras).
Data Structure to Store Nodes
![Page 46: AI Search - uwyo.educlan/teach/ai18/search_intro.pdfSearching for a solution is equivalent to searching in a tree (or, generating a tree). Find Solution by Search Tree A frontier is](https://reader036.vdocuments.net/reader036/viewer/2022070801/5f029cc57e708231d40521f3/html5/thumbnails/46.jpg)
Nodes are stored in a queue, e.g., Q = (Arad, Sibiu, Fagaras).
Three queue operations
- empty: return true if there is no node in the queue
- pop: return the first node in the queue, then remove it from the queue
- insert: insert a node to the queue, then return the resulting queue
Data Structure to Store Nodes
Q: what is empty(Q)?
![Page 47: AI Search - uwyo.educlan/teach/ai18/search_intro.pdfSearching for a solution is equivalent to searching in a tree (or, generating a tree). Find Solution by Search Tree A frontier is](https://reader036.vdocuments.net/reader036/viewer/2022070801/5f029cc57e708231d40521f3/html5/thumbnails/47.jpg)
Nodes are stored in a queue, e.g., Q = (Arad, Sibiu, Fagaras).
Three queue operations
- empty: return true if there is no node in the queue
- pop: return the first node in the queue, then remove it from the queue
- insert: insert a node to the queue, then return the resulting queue
Data Structure to Store Nodes
Q: what is empty(Q)? False.
Q: what is pop(Q)?
![Page 48: AI Search - uwyo.educlan/teach/ai18/search_intro.pdfSearching for a solution is equivalent to searching in a tree (or, generating a tree). Find Solution by Search Tree A frontier is](https://reader036.vdocuments.net/reader036/viewer/2022070801/5f029cc57e708231d40521f3/html5/thumbnails/48.jpg)
Nodes are stored in a queue, e.g., Q = (Arad, Sibiu, Fagaras).
Three queue operations
- empty: return true if there is no node in the queue
- pop: return the first node in the queue, then remove it from the queue
- insert: insert a node to the queue, then return the resulting queue
Data Structure to Store Nodes
Q: what is empty(Q)? False.
Q: what is pop(Q)? Arad.
Q: what is insert(Zerind)?
![Page 49: AI Search - uwyo.educlan/teach/ai18/search_intro.pdfSearching for a solution is equivalent to searching in a tree (or, generating a tree). Find Solution by Search Tree A frontier is](https://reader036.vdocuments.net/reader036/viewer/2022070801/5f029cc57e708231d40521f3/html5/thumbnails/49.jpg)
Nodes are stored in a queue, e.g., Q = (Arad, Sibiu, Fagaras).
Three queue operations
- empty: return true if there is no node in the queue
- pop: return the first node in the queue, then remove it from the queue
- insert: insert a node to the queue, then return the resulting queue
Data Structure to Store Nodes
Q: what is empty(Q)? False.
Q: what is pop(Q)? Arad.
Q: what is insert(Zerind)? Q = (Arad, Sibiu, Fagaras, Zerind)
![Page 50: AI Search - uwyo.educlan/teach/ai18/search_intro.pdfSearching for a solution is equivalent to searching in a tree (or, generating a tree). Find Solution by Search Tree A frontier is](https://reader036.vdocuments.net/reader036/viewer/2022070801/5f029cc57e708231d40521f3/html5/thumbnails/50.jpg)
Nodes are stored in a queue, e.g., (Arad, Sibiu, Fagaras).
Three queue operations
- empty: return true if there is no node in the queue
- pop: return the first node in the queue, then remove it from the queue
- insert: insert a node to the queue, then return the resulting queue
Three types of queue
- FIFO (First-In-First-Out): pop the oldest node in the queue
- LIFO (Last-In-First-Out): pop the newest node in the queue
- Priority: pop node with the highest priority in the queue
Data Structure to Store Nodes
![Page 51: AI Search - uwyo.educlan/teach/ai18/search_intro.pdfSearching for a solution is equivalent to searching in a tree (or, generating a tree). Find Solution by Search Tree A frontier is](https://reader036.vdocuments.net/reader036/viewer/2022070801/5f029cc57e708231d40521f3/html5/thumbnails/51.jpg)
Nodes are stored in a queue, e.g., (Arad, Sibiu, Fagaras).
Three queue operations
- empty: return true if there is no node in the queue
- pop: return the first node in the queue, then remove it from the queue
- insert: insert a node to the queue, then return the resulting queue
Three types of queue
- FIFO (First-In-First-Out): pop the oldest node in the queue
- LIFO (Last-In-First-Out): pop the newest node in the queue
- Priority: pop node with the highest priority in the queue
Data Structure to Store Nodes
Q: what is pop(Q) if FIFO?
Q: what is pop(Q) if LIFO?
Q: what about pop(Q) if priority?
![Page 52: AI Search - uwyo.educlan/teach/ai18/search_intro.pdfSearching for a solution is equivalent to searching in a tree (or, generating a tree). Find Solution by Search Tree A frontier is](https://reader036.vdocuments.net/reader036/viewer/2022070801/5f029cc57e708231d40521f3/html5/thumbnails/52.jpg)
IntroductionWhat is search?
What are the basic concepts in search?
What are the applications of search?
Find solution by tree search.
What is the data structure of search algorithm?
How to evaluate search algorithm?
![Page 53: AI Search - uwyo.educlan/teach/ai18/search_intro.pdfSearching for a solution is equivalent to searching in a tree (or, generating a tree). Find Solution by Search Tree A frontier is](https://reader036.vdocuments.net/reader036/viewer/2022070801/5f029cc57e708231d40521f3/html5/thumbnails/53.jpg)
Four metrics to evaluate a search algorithm
1. Completeness: is the algorithm guaranteed to find a solution (if it exists)?
2. Optimality: does the algorithm find the optimal solution?
3. Time Complexity: how long does it take to find a solution?
4. Space Complexity: how much memory is needed to perform search?
Evaluate Search Algorithm
![Page 54: AI Search - uwyo.educlan/teach/ai18/search_intro.pdfSearching for a solution is equivalent to searching in a tree (or, generating a tree). Find Solution by Search Tree A frontier is](https://reader036.vdocuments.net/reader036/viewer/2022070801/5f029cc57e708231d40521f3/html5/thumbnails/54.jpg)
Is the following search algorithm complete?
Example
Search Algorithm 1 - always turn left
![Page 55: AI Search - uwyo.educlan/teach/ai18/search_intro.pdfSearching for a solution is equivalent to searching in a tree (or, generating a tree). Find Solution by Search Tree A frontier is](https://reader036.vdocuments.net/reader036/viewer/2022070801/5f029cc57e708231d40521f3/html5/thumbnails/55.jpg)
Is the following search algorithm complete?
Example
Search Algorithm 1 - always turn left (not complete)
![Page 56: AI Search - uwyo.educlan/teach/ai18/search_intro.pdfSearching for a solution is equivalent to searching in a tree (or, generating a tree). Find Solution by Search Tree A frontier is](https://reader036.vdocuments.net/reader036/viewer/2022070801/5f029cc57e708231d40521f3/html5/thumbnails/56.jpg)
Complexities of a search algorithm are often measure indirectly, e.g.,
- branching factor (# successors), depth, maximum length
- # nodes |V| + # edges |E|
- time = # generated nodes
- space = # stored nodes
Complexities of Search Algorithm