Chapter4 :Uninformed (Blind)Search
Searching through a state space
Evaluating Search strategies
Search Tree
Breadth First Search (BFS)
Depth first Search
The basic search algorithm
Which path to find?
Evaluating Search strategies
1.Completeness: Is the strategy guaranteed to find a solution if one exists? 2. Optimality: Does the solution have low cost or the minimal cost? | |
3. What is the search cost associated with the time and memory required to find a solution? | Time complexity: Time taken Space complexity: Space used |
search strategies
a. Depth first search
b. Breadth first search
c. Iterative deepening search
d. Iterative broadening search
We can transform graph to tree for simplicity
No duplicate nodes
No duplicate nodes
Search Tree
Path=A-C-D-F-G
Branching Factor of D =2
Breadth First Search (BFS)
implies the expansion in a FIFO (First In First Out) order.
BFS illustration (Level)
Properties of Breadth-First Search
Suppose the search tree can be modeled as a b-ary tree . Then the time and space complexity of the algorithm is O(bd) where d is the depth of the solution.
Advantages of BFS | Disadvantages |
Finds the path of minimal length to the goal. | Requires the generation and storage of a tree whose size is exponential . |
Depth first Search
DFS illustrated
กำหนด Search Space ดังนี้
Initial State = A
Goal State = G
แปลงเป็น
Search Tree
แถวข้อมูลที่ใช้งาน
Search Space
เริ่มกระบวนการค้น
แถวข้อมูลที่ใช้งาน
แถวข้อมูลที่ใช้งาน
แถวข้อมูลที่ใช้งาน
แถวข้อมูลที่ใช้งาน
แถวข้อมูลที่ใช้งาน
If the search tree has infinite depth, the algorithm may not terminate.