Lecture 4
Lecture 4
November 5, 2024
Breadth-First Search (BFS)
• Type: Uninformed
• Strategy: Explores all nodes level by level.
• Advantages:
• Complete and will always find a solution if one exists.
• Guarantees the shortest path if all actions have the same cost.
• Disadvantages:
• Explores all possibilities, which can be inefficient in large spaces.
• High memory consumption.
2/30
Depth-First Search (DFS)
• Type: Uninformed
• Strategy: Explores as far down one branch as possible before backtracking.
• Advantages:
• Low memory consumption.
• Can be useful for problems where solutions are deep in the search space.
• Disadvantages:
• Not guaranteed to find the shortest path.
• Can get stuck in deep, irrelevant paths.
3/30
Uniform-Cost Search (UCS)
• Type: Uninformed
• Strategy: Expands the node with the lowest path cost, ensuring the cheapest
path to the goal.
• Advantages:
• Guaranteed to find the optimal solution.
• Complete.
• Disadvantages:
• Can be slow if all actions have similar costs.
• Can explore in irrelevant directions.
4/30
Informed Search Overview
5/30
Greedy Best-First Search
• Type: Informed.
• Strategy: Expands the node that appears to be closest to the goal according to
the heuristic.
• Heuristic: Uses only h(n) (estimate of cost to reach the goal).
• Advantages:
• Often faster than uninformed search methods.
• Useful when a good heuristic is available.
• Disadvantages:
• Not complete; may get stuck in loops or local minima.
• Not guaranteed to find the optimal solution.
6/30
A* Search
• Type: Informed.
• Strategy: Expands the node with the lowest combined cost f(n) = g(n) + h(n),
where:
• g(n): Cost to reach node n from the start.
• h(n): Estimated cost from node n to the goal.
• Advantages:
• Complete and optimal if h(n) is admissible (never overestimates).
• Balances path cost and estimated cost to the goal.
• Disadvantages:
• Memory-intensive due to the need to store all explored nodes.
• Can be slow in large search spaces if h(n) is not efficient.
7/30
Introduction to Adversarial Search
8/30
Search Algorithms
10/30
Formalization of Deterministicc Games
11/30
Zero-Sum and Variable Sum Games
13/30
Minimax Efficiency
14/30
Adversarial Search (Minimax)
16/30
Min-Max Example 2
17/30
Quiz 1
19/30
Properties of Mini-Max Algorithm
20/30
Alpha-Beta Pruning: An Optimization for Mini-Max
21/30
Conditions and Key Points for Alpha-Beta Pruning
22/30
Step 1
• Step 1: Start at root (Node A), set α = −∞, β = +∞, pass values to Node B.
• Step 2: At Node D, MAX updates α to 3 (from terminal nodes 2, 3).
• Step 3: Backtrack to Node B, MIN updates β to 3.
• Step 4: Traverse Node E, MAX updates α to 5. Prune right child as α ≥ β .
24/30
Phase 2