IT 228 Chapter3
IT 228 Chapter3
Artificial
Intelligence
Unit 3: Informed and Uninformed Search
Problem Solving by Searching
Four general steps of problem Solving.
Goal Formulation: what are the world successful states?
Problem Formulation: the process of deciding what actions and states
to consider, and follows goal
Search: Determine the possible sequence of actions that lead to the
states of known values and then choosing the best sequence.
Execute: Give the solution perform the actions.
Path Cost: sum of cost of each path from initial state to goal state.
A solution is a path from initial state to goal state.
4 5 6 7
2 3
4 5 6 7
Solution ?
BFS Solution: 1,2,3,4,5,6,7
0=1, 1=2,2=4,3=8,4=16,5=32
20, 21, 22, 23, 24, 25
Time complexity: 0(bd)
6 ? ? ?
16 1016 350 years 10 Exabyte's
S 6
D
5
9 6
2
A
3 2
C E
B 1
9
2 7 2 7
5
G1 G
3
G2
F 8
Depth-first search
Depth-first search always expands one of the nodes at the deepest
level of the tree.
Only when the search hits a dead end (a non-goal node with no
expansion) does the search go back and expand nodes at shallower
levels.
For a state space with branching factor b and maximum depth m
depth-first search requires storage of only (bm) nodes, in contrast to
the (bd) that would be required by breadth-first search in the case
where the shallowest goal is at depth d.
Expand deepest unexpanded note. Fringe is implemented as LIFO.
(=stack)
2 3
4 5 6 7
2 3
4 5 6 7
Depth 2
4 5 6 7
Depth 3
8 9 10 11 12 13 14 15
2 3
4 5 6 7
Depth 2
4 5 6 7
Depth 3
8 9 10 11 12 13 14 15
3 Depth 1
2 No goal Found increase level
4 5 6 7 Depth 2
Goal No Need to Go
Found !!! Further Depth
Sibiu Bucharest
253 0
Path: Arad Sibiu Fagaras Bucharest
02/19/2025 Unit-3, Informed and Uninformed Search 55
Performance Evaluation
Complete: No, Can get stuck in loop
Time: O(bm)
Space: O(bm),Keep all nodes in memory.
Optimal: No, (Think about previous search)
42 km 10 km
Sibiu Bucharest
253 0
4 5 8
7 3 9
3
4 5
1 6 1 5 6 1 6
4 5 8 4 8 4 5 8
7 3 9 7 3 9 7 3 9
4
5
4 1 6 1 6
5 8 4 5 8
7 3 9 7 3 9
Despite the many local maxima in this graph, the global maximum
can still be found using simulated annealing. Unfortunately, the
applicability of simulated annealing is problem-specific because it
relies on finding lucky jumps that improve the position. In such
extreme examples, hill climbing will most probably produce a local
maximum.
02/19/2025 Unit-3, Informed and Uninformed Search 66
Means-Ends Analysis
Identify the procedure that causes a transition from the current state
to a goal state, or at least to an intermediate state that is nearer the
goal state.
The procedure above, reduces the observed difference between the
current state and goal state.
Until the goal state is reached or no more procedure are available.
Describe the current state, goal state and the difference between the two.
Use this difference, possible with the description of the current and goal state
to select a promising procedure.
Use the promising procedure and update the current state.
If the goal is reached then success otherwise fail.
Properties of Game
• Game theorists
• Deterministic, turn-taking, two-player, zero-sum games of perfect
information.
-2 2 1 1 3 4 -1 1 0 2 5 6
-2 2 1 1 3 4 -1 1 0 2 5 6
α = -∞ α=6
β= ∞ 6 β = +∞ 2
Compare(∞,6)=6 Compare β(+∞,2)=2
Now β=6 Check (α >= β):true
α = -∞
So no need to check
Compare (-∞,7)=7 Pruned
β=6 further
Now α = 7
Check (α >= β):true
α=6
α = -∞ (now 6)
So no need to check compare(6,1)=6
Compare(-∞,4)=4
Compare (4,6)=6 6 7 further Compare (6,2)=6 2
β = +∞ α value: no
Pruned change
Β= +∞
4 6 7 9 1 2 0 1