0% found this document useful (0 votes)
18 views136 pages

Lec3 AI

The document discusses problem solving through searching. It introduces uninformed (blind) search methods like breadth-first, depth-first, depth limited, iterative deepening, and bidirectional search. It also discusses informed (heuristic) search methods like greedy best-first, A*, IDA*, and beam search which use an evaluation function to guide the search. Finally, it discusses criteria for comparing different search techniques, including completeness, optimality/admissibility, time complexity, and space complexity.

Uploaded by

m88mrabet
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
18 views136 pages

Lec3 AI

The document discusses problem solving through searching. It introduces uninformed (blind) search methods like breadth-first, depth-first, depth limited, iterative deepening, and bidirectional search. It also discusses informed (heuristic) search methods like greedy best-first, A*, IDA*, and beam search which use an evaluation function to guide the search. Finally, it discusses criteria for comparing different search techniques, including completeness, optimality/admissibility, time complexity, and space complexity.

Uploaded by

m88mrabet
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 136

Problem Solving by Searching

Search Methods :
Uninformed (Blind) search
Dr. Manel Mrabet
Search Methods
 Once we have defined the problem space (state representation, the initial state, the
goal state and operators) is all done?

 Let’s consider the River Problem:

A farmer wishes to carry a wolf, a duck and corn across a river, from the south to the
north shore. The farmer is the proud owner of a small rowing boat called Bounty
which he feels is easily up to the job. Unfortunately the boat is only large enough to
carry at most the farmer and one other item. Worse again, if left unattended the wolf
will eat the duck and the duck will eat the corn.

River

boat
Farmer, Wolf,
Duck and Corn
How can the farmer safely transport the wolf, the duck and the corn to the opposite
shore?
Dr. Manel Mrabet 2
Search Methods
 The River Problem:
F=Farmer W=Wolf D=Duck C=Corn /=River

-/FWCD

FWCD/-

How can the farmer safely transport the wolf, the duck and
the corn to the opposite shore?
Dr. Manel Mrabet 3
Search Methods
 Problem formulation:

 State representation: location of farmer and items in both sides of river


[items in South shore / items in North shore] : (FWDC/-, FD/WC, C/FWD …)

 Initial State: farmer, wolf, duck and corn in the south shore
FWDC/-

 Goal State: farmer, duck and corn in the north shore


-/FWDC

 Operators: the farmer takes in the boat at most one item from one side to
the other side
(F-Takes-W, F-Takes-D, F-Takes-C, F-Takes-Self [himself only])

 Path cost: the number of crossings

Dr. Manel Mrabet 4


Search Methods
 State space:
A problem is solved by moving from the initial state to the goal state by applying valid
operators in sequence. Thus the state space is the set of states reachable from a particular
initial state.
F WD C
Initial state

WD C D C W C WD

Dead ends
F F W F D F C

Illegal states
F W C F WD C
D

repeated state F
W
D
C
F WD
C
F
W
D C
intermediate state

F C F W C F D C F W F WD F W C
WD D W D C C D

D C C D WD D W
F W F WD F W C F C F W C F D C

F D F WD F D C
W C C W

F W
D
C F WD C
Dr. Manel
Goal Mrabet
state 5
Search Methods
 Searching for a solution: F WD C

We start with the initial state and WD C DC W C WD


keep using the operators to F FW F D F C

expand the parent nodes till we


find a goal state. FW C
D
F WD C

W C C W

…but the search space might be


F D F WD F DC

large… F C FW C F DC FW F WD FW C
WD D W DC C D

 …really large… DC C D WD D W
FW F WD FW C F C FW C F DC

 So we need some systematic way


to search.
F D F WD F DC
W C C W

D
FW C F WD C

Dr. Manel Mrabet 6


Problem Solving by searching

Basic Search Algorithms


Basic Search Algorithms
 uninformed( Blind) search: breadth-first, depth-first,
depth limited, iterative deepening, and bidirectional search

 informed (Heuristic) search: search is guided by an


evaluation function: Greedy best-first, A*, IDA*, and beam
search

 optimization in which the search is to find an optimal value


of an objective function: hill climbing, simulated annealing,
genetic algorithms, Ant Colony Optimization

 Game playing, an adversarial search: minimax algorithm,


alpha-beta pruning
Dr. Manel Mrabet 8
What Criteria are used to Compare
different search techniques ?
As we are going to consider different techniques to search the
problem space, we need to consider what criteria we will use to
compare them.

 Completeness: Is the technique guaranteed to find an answer


(if there is one).

 Optimality/Admissibility : does it always find a least-cost


solution?
- an admissible algorithm will find a solution with minimum cost

 Time Complexity: How long does it take to find a solution.

 Space Complexity: How much memory does it take to find a


solution.
Dr. Manel Mrabet 9
Time and Space Complexity ?
Time and space complexity are measured in terms of:

 The average number of new nodes we create when expanding


a new node is the (effective) branching factor b.

 The (maximum) branching factor b is defined as the maximum


nodes created when a new node is expanded.

 The length of a path to a goal is the depth d.

 The maximum length of any path in the state space m.

Dr. Manel Mrabet 10


Uninformed search strategies
(Blind search)
Uninformed (blind) strategies use only the information available in the
problem definition. These strategies order nodes without using any
domain specific information

 Contrary to Informed search techniques where it’s strategies that


know whether one non-goal state is “more promising” than another.

 Breadth-first search
 Uniform-cost search
 Depth-first search
 Depth-limited search
 Iterative deepening search
 Bidirectional search

Dr. Manel Mrabet 11


Basic Search Algorithms
Uninformed Search

Breadth First Search (BFS)


Breadth First Search (BFS)

Dr. Manel Mrabet 13


Breadth First Search (BFS)

Main idea: Expand all nodes at depth (i) before expanding nodes at depth (i + 1)
Level-order Traversal.
Implementation: Use of a First-In-First-Out queue (FIFO). Nodes visited first
are expanded first. Enqueue nodes in FIFO (first-in, first-out) order.
• Complete? Yes.
• Optimal? Yes, if path cost is nondecreasing function of depth
• Time Complexity: O(bd)
• Space Complexity: O(bd), note that every node in the fringe is kept in the queue.
Dr. Manel Mrabet 14
Breadth First Search
 QUEUING-FN:- successors added to end
of queue Arad

Zerind Sibiu Timisoara

Arad
Arad Oradea
Oradea Fagaras
Arad Lugoj
Rimnicu Vilcea

Shallow nodes are expanded before deeper nodes.


Dr. Manel Mrabet 15
Basic Search Algorithms
Uninformed Search

Uniform Cost Search (UCS)


Uniform Cost Search (UCS)

5 2
[5] [2]
1 4 1 7
[6] [3] [9]
[9]
Goal state
4 5

[x] = g(n) [7] [8]


path cost of node n

Dr. Manel Mrabet 17


Uniform Cost Search (UCS)

5 2
[5] [2]

Dr. Manel Mrabet 18


Uniform Cost Search (UCS)

5 2
[5] [2]

1 7
[3] [9]

Dr. Manel Mrabet 19


Uniform Cost Search (UCS)

5 2
[5] [2]

1 7
[3] [9]
4 5

[7] [8]

Dr. Manel Mrabet 20


Uniform Cost Search (UCS)

5 2
[5] [2]
1 4 1 7
[6] [3] [9]
[9]
4 5

[7] [8]

Dr. Manel Mrabet 21


Uniform Cost Search (UCS)

5 2
[5] [2]
Goal state
1 4 1
path cost 7
g(n)=[6] [3] [9]
[9]
4 5

[7] [8]

Dr. Manel Mrabet 22


Uniform Cost Search (UCS)

5 2
[5] [2]
1 4 1 7
[6] [3] [9]
[9]
4 5

[7] [8]

Dr. Manel Mrabet 23


Uniform Cost Search (UCS)
 In case of equal step costs, Breadth First search finds
the optimal solution.

 For any step-cost function, Uniform Cost search


expands the node n with the lowest path cost.

 UCS takes into account the total cost: g(n).

 UCS is guided by path costs rather than depths.


Nodes are ordered according to their path cost.
Dr. Manel Mrabet 24
Uniform Cost Search (UCS)
 Main idea: Expand the cheapest node. Where the cost is the path cost g(n).

 Implementation:
Enqueue nodes in order of cost g(n).
QUEUING-FN:- insert in order of increasing path cost.
Enqueue new node at the appropriate position in the queue so that we
dequeue the cheapest node.

 Complete? Yes.
 Optimal? Yes, if path cost is nondecreasing function of depth
 Time Complexity: O(bd)
 Space Complexity: O(bd), note that every node in the fringe keep in the queue.

Dr. Manel Mrabet 25


Basic Search Algorithms
Uninformed Search

Depth First Search (DFS)


Depth First Search (DFS)

Dr. Manel Mrabet 27


Depth First Search (DFS)
Main idea: Expand node at the deepest level (breaking ties left to right).

Implementation: use of a Last-In-First-Out queue or stack(LIFO). Enqueue


nodes in LIFO (last-in, first-out) order.

• Complete? No (Yes on finite trees, with no loops).

• Optimal? No

• Time Complexity: O(bm), where m is the maximum depth.

• Space Complexity: O(bm), where m is the maximum depth.


Dr. Manel Mrabet 28
Depth First Search

Dr. Manel Mrabet 29


Depth-First Search (DFS)
 QUEUING-FN:- insert successors at
front of queue Arad

Zerind Sibiu Timisoara

Arad Oradea

Zerind Sibiu Timisoara

Dr. Manel Mrabet 30


Basic Search Algorithms
Uninformed Search

Depth-Limited Search (DLS)


Depth-Limited Search (DLS)

Depth Bound = 3
Dr. Manel Mrabet 32
Depth-Limited Search (DLS)
It is simply DFS with a depth bound.
 Searching is not permitted beyond the depth bound.

 Works well if we know what the depth of the solution is.

 Termination is guaranteed.

 If the solution is beneath the depth bound, the search


cannot find the goal (hence this search algorithm is
incomplete).

 Otherwise use Iterative deepening search (IDS).


Dr. Manel Mrabet 33
Depth-Limited Search (DLS)
Main idea: Expand node at the deepest level, but limit depth to L.

Implementation:
Enqueue nodes in LIFO (last-in, first-out) order. But limit depth to L

•Complete? Yes if there is a goal state at a depth less than L

• Optimal? No

• Time Complexity: O(bL), where L is the cutoff.

• Space Complexity: O(bL), where L is the cutoff.


Dr. Manel Mrabet 34
Basic Search Algorithms
Uninformed Search

Iterative Deepening Search (IDS)


Iterative Deepening Search (IDS)

function ITERATIVE-DEEPENING-SEARCH():

for depth = 0 to infinity do


if DEPTH-LIMITED-SEARCH(depth) succeeds
then return its result
end
return failure

Dr. Manel Mrabet 36


Iterative Deepening Search (IDS)
 Key idea: Iterative deepening search (IDS) applies DLS repeatedly
with increasing depth. It terminates when a solution is found or no
solutions exists.

 IDS combines the benefits of BFS and DFS: Like DFS the memory
requirements are very modest (O(bd)). Like BFS, it is complete
when the branching factor is finite.

 The total number of generated nodes is :

N(IDS)=(d)b + (d-1) b2 + …+(1)bd

 In general, iterative deepening is the preferred uninformed search


method when there is a large search space and the depth of the
solution is not known. Dr. Manel Mrabet 37
Iterative Deepening Search (IDS)

L=0

L=1

L=2

L=3
Dr. Manel Mrabet 38
Iterative Deepening Search (IDS)

Dr. Manel Mrabet 39


Iterative Deepening Search (IDS)

Dr. Manel Mrabet 40


Basic Search Algorithms
Uninformed Search

Bi-Directional Search (BDS)


Bi-directional Search (BDS)
 Main idea: Start searching from
both the initial state and the goal
state, meet in the middle.

 Complete? Yes
 Optimal? Yes
 Time Complexity: O(bd/2), where
d is the depth of the solution.
 Space Complexity: O(bd/2), where
d is the depth of the solution.
Dr. Manel Mrabet 42
Basic Search Algorithms

Comparison of search algorithms


Comparison of search
algorithms

b: Branching factor
d: Depth of solution
m: Maximum depth

l : Depth Limit
Dr. Manel Mrabet 44
Blind Search Algorithms

Tree Search:
BFS, DFS, DLS, IDS
Basic Search Algorithms

Breadth First Search


BFS
Breadth First Search
 Application1:
Given the following state space (tree search), give the sequence
of visited nodes when using BFS (assume that the nodeO is the
goal state):
A

B C D E

F G H I J

K L M N

O
Dr. Manel Mrabet 47
Breadth First Search
 A,

B C D E

Dr. Manel Mrabet 48


Breadth First Search
 A,
 B,

B C D E

F G

Dr. Manel Mrabet 49


Breadth First Search
 A,
 B,C

B C D E

F G H

Dr. Manel Mrabet 50


Breadth First Search
 A,
 B,C,D

B C D E

F G H I J

Dr. Manel Mrabet 51


Breadth First Search
 A,
 B,C,D,E

B C D E

F G H I J

Dr. Manel Mrabet 52


Breadth First Search
 A,
 B,C,D,E,
 F,
A

B C D E

F G H I J

Dr. Manel Mrabet 53


Breadth First Search
 A,
 B,C,D,E,
 F,G
A

B C D E

F G H I J

K L

Dr. Manel Mrabet 54


Breadth First Search
 A,
 B,C,D,E,
 F,G,H
A

B C D E

F G H I J

K L

Dr. Manel Mrabet 55


Breadth First Search
 A,
 B,C,D,E,
 F,G,H,I
A

B C D E

F G H I J

K L M

Dr. Manel Mrabet 56


Breadth First Search
 A,
 B,C,D,E,
 F,G,H,I,J,
A

B C D E

F G H I J

K L M N

Dr. Manel Mrabet 57


Breadth First Search
 A,
 B,C,D,E,
 F,G,H,I,J,
 K, A

B C D E

F G H I J

K L M N

Dr. Manel Mrabet 58


Breadth First Search
 A,
 B,C,D,E,
 F,G,H,I,J,
 K,L A

B C D E

F G H I J

K L M N

O
Dr. Manel Mrabet 59
Breadth First Search
 A,
 B,C,D,E,
 F,G,H,I,J,
 K,L, M, A

B C D E

F G H I J

K L M N

O
Dr. Manel Mrabet 60
Breadth First Search
 A,
 B,C,D,E,
 F,G,H,I,J,
 K,L, M,N, A

B C D E

F G H I J

K L M N

O
Dr. Manel Mrabet 61
Breadth First Search
 A,
 B,C,D,E,
 F,G,H,I,J,
 K,L, M,N, A
 Goal state: O
B C D E

F G H I J

K L M N

O
Dr. Manel Mrabet 62
Breadth First Search
 The returned solution is the sequence of operators in the path:
A, B, G, L, O

B C D E

F G H I J

K L M N

O
Dr. Manel Mrabet 63
Basic Search Algorithms

Depth First Search


DFS
Depth First Search (DFS)
 Application2:
Given the following state space (tree search), give the sequence
of visited nodes when using DFS (assume that the nodeO is the
goal state):
A

B C D E

F G H I J

K L M N

O
Dr. Manel Mrabet 65
Depth First Search
 A,

B C D E

Dr. Manel Mrabet 66


Depth First Search
 A,B,

B C D E

F G

Dr. Manel Mrabet 67


Depth First Search
 A,B,F,

B C D E

F G

Dr. Manel Mrabet 68


Depth First Search
 A,B,F,
 G,

B C D E

F G

K L

Dr. Manel Mrabet 69


Depth First Search
 A,B,F,
 G,K,

B C D E

F G

K L

Dr. Manel Mrabet 70


Depth First Search
 A,B,F,
 G,K,
 L,
A

B C D E

F G

K L

O
Dr. Manel Mrabet 71
Depth First Search
 A,B,F,
 G,K,
 L, O: Goal State
A

B C D E

F G

K L

O
Dr. Manel Mrabet 72
Depth First Search
The returned solution is the sequence of operators in the path:
A, B, G, L, O

B C D E

F G

K L

O
Dr. Manel Mrabet 73
Basic Search Algorithms

Depth-Limited Search
DLS
Depth-Limited Search (DLS)
 Application3:
Given the following state space (tree search), give the sequence
of visited nodes when using DLS (Limit = 2):

Limit = 0 A

Limit = 1 B C D E

Limit = 2 F G H I J

K L M N

O
Dr. Manel Mrabet 75
Depth-Limited Search (DLS)
 A,

B C D E

Limit = 2

Dr. Manel Mrabet 76


Depth-Limited Search (DLS)
 A,B,

B C D E

Limit = 2 F G

Dr. Manel Mrabet 77


Depth-Limited Search (DLS)
 A,B,F,

B C D E

Limit = 2 F G

Dr. Manel Mrabet 78


Depth-Limited Search (DLS)
 A,B,F,
 G,

B C D E

Limit = 2 F G

Dr. Manel Mrabet 79


Depth-Limited Search (DLS)
 A,B,F,
 G,
 C,
A

B C D E

Limit = 2 F G H

Dr. Manel Mrabet 80


Depth-Limited Search (DLS)
 A,B,F,
 G,
 C,H,
A

B C D E

Limit = 2 F G H

Dr. Manel Mrabet 81


Depth-Limited Search (DLS)
 A,B,F,
 G,
 C,H,
 D, A

B C D E

Limit = 2 F G H I J

Dr. Manel Mrabet 82


Depth-Limited Search (DLS)
 A,B,F,
 G,
 C,H,
 D,I A

B C D E

Limit = 2 F G H I J

Dr. Manel Mrabet 83


Depth-Limited Search (DLS)
 A,B,F,
 G,
 C,H,
 D,I A
 J,
B C D E

Limit = 2 F G H I J

Dr. Manel Mrabet 84


Depth-Limited Search (DLS)
 A,B,F,
 G,
 C,H,
 D,I A
 J,
 E B C D E

Limit = 2 F G H I J

Dr. Manel Mrabet 85


Depth-Limited Search (DLS)
 A,B,F,
 G,
 C,H,
 D,I A
 J,
 E, Failure B C D E

Limit = 2 F G H I J

Dr. Manel Mrabet 86


Depth-Limited Search (DLS)
 DLS algorithm returns Failure (no solution)
 The reason is that the goal is beyond the limit (Limit =2): the
goal depth is (d=4)
A

B C D E

Limit = 2 F G H I J

K L M N

O
Dr. Manel Mrabet 87
Basic Search Algorithms

Iterative Deepening Search


IDS
Iterative Deepening Search (IDS)
 Application4:
Given the following state space (tree search), give the sequence
of visited nodes when using IDS:

Limit = 0 A

Limit = 1 B C D E

Limit = 2 F G H I J

Limit = 3 K L M N

Limit = 4 O
Dr. Manel Mrabet 89
Iterative Deepening Search
(IDS)

DLS with bound = 0


Iterative Deepening Search (IDS)
 A,

Limit = 0 A

Dr. Manel Mrabet 91


Iterative Deepening Search (IDS)
 A, Failure

Limit = 0 A

Dr. Manel Mrabet 92


Iterative Deepening Search
(IDS)

DLS with bound = 1


Iterative Deepening Search (IDS)
 A,

Limit = 1 B C D E

Dr. Manel Mrabet 94


Iterative Deepening Search (IDS)
 A,B,

Limit = 1 B C D E

Dr. Manel Mrabet 95


Iterative Deepening Search (IDS)
 A,B,
 C,

Limit = 1 B C D E

Dr. Manel Mrabet 96


Iterative Deepening Search (IDS)
 A,B,
 C,
 D,
A

Limit = 1 B C D E

Dr. Manel Mrabet 97


Iterative Deepening Search (IDS)
 A,B
 C,
 D,
 E, A

Limit = 1 B C D E

Dr. Manel Mrabet 98


Iterative Deepening Search (IDS)
 A,B,
 C,
 D,
 E, Failure A

Limit = 1 B C D E

Dr. Manel Mrabet 99


Iterative Deepening Search (IDS)
 A,

B C D E

Limit = 2

Dr. Manel Mrabet 100


Iterative Deepening Search (IDS)
 A,B,

B C D E

Limit = 2 F G

Dr. Manel Mrabet 101


Iterative Deepening Search (IDS)
 A,B,F,

B C D E

Limit = 2 F G

Dr. Manel Mrabet 102


Iterative Deepening Search (IDS)
 A,B,F,
 G,

B C D E

Limit = 2 F G

Dr. Manel Mrabet 103


Iterative Deepening Search (IDS)
 A,B,F,
 G,
 C,
A

B C D E

Limit = 2 F G H

Dr. Manel Mrabet 104


Iterative Deepening Search (IDS)
 A,B,F,
 G,
 C,H,
A

B C D E

Limit = 2 F G H

Dr. Manel Mrabet 105


Iterative Deepening Search (IDS)
 A,B,F,
 G,
 C,H,
 D, A

B C D E

Limit = 2 F G H I J

Dr. Manel Mrabet 106


Iterative Deepening Search (IDS)
 A,B,F,
 G,
 C,H,
 D,I A

B C D E

Limit = 2 F G H I J

Dr. Manel Mrabet 107


Iterative Deepening Search (IDS)
 A,B,F,
 G,
 C,H,
 D,I A
 J,
B C D E

Limit = 2 F G H I J

Dr. Manel Mrabet 108


Iterative Deepening Search (IDS)
 A,B,F,
 G,
 C,H,
 D,I A
 J,
 E B C D E

Limit = 2 F G H I J

Dr. Manel Mrabet 109


Iterative Deepening Search (IDS)
 A,B,F,
 G,
 C,H,
 D,I A
 J,
 E, Failure B C D E

Limit = 2 F G H I J

K L M N

O
Dr. Manel Mrabet 110
Iterative Deepening Search
(IDS)

DLS with bound = 3


Iterative Deepening Search (IDS)
 A,

B C D E

Limit = 3

Dr. Manel Mrabet 112


Iterative Deepening Search (IDS)
 A,B,

B C D E

F G

Limit = 3

Dr. Manel Mrabet 113


Iterative Deepening Search (IDS)
 A,B,F,

B C D E

F G

Limit = 3

Dr. Manel Mrabet 114


Iterative Deepening Search (IDS)
 A,B,F,
 G,

B C D E

F G

Limit = 3 K L

Dr. Manel Mrabet 115


Iterative Deepening Search (IDS)
 A,B,F,
 G,K,

B C D E

F G

Limit = 3 K L

Dr. Manel Mrabet 116


Iterative Deepening Search (IDS)
 A,B,F,
 G,K,
 L,
A

B C D E

F G

Limit = 3 K L

Dr. Manel Mrabet 117


Iterative Deepening Search (IDS)
 A,B,F,
 G,K,
 L,
 C, A

B C D E

F G H

Limit = 3 K L

Dr. Manel Mrabet 118


Iterative Deepening Search (IDS)
 A,B,F,
 G,K,
 L,
 C,H, A

B C D E

F G H

Limit = 3 K L

Dr. Manel Mrabet 119


Iterative Deepening Search (IDS)
 A,B,F,
 G,K,
 L,
 C,H, A
 D,
B C D E

F G H I J

Limit = 3 K L

Dr. Manel Mrabet 120


Iterative Deepening Search (IDS)
 A,B,F,
 G,K,
 L,
 C,H, A
 D,I,
B C D E

F G H I J

Limit = 3 K L M

Dr. Manel Mrabet 121


Iterative Deepening Search (IDS)
 A,B,F,
 G,K,
 L,
 C,H, A
 D,I,M,
B C D E

F G H I J

Limit = 3 K L M

Dr. Manel Mrabet 122


Iterative Deepening Search (IDS)
 A,B,F,
 G,K,
 L,
 C,H, A
 D,I,M,
 J, B C D E

F G H I J

Limit = 3 K L M N

Dr. Manel Mrabet 123


Iterative Deepening Search (IDS)
 A,B,F,
 G,K,
 L,
 C,H, A
 D,I,M,
 J,N, B C D E

F G H I J

Limit = 3 K L M N

Dr. Manel Mrabet 124


Iterative Deepening Search (IDS)
 A,B,F,
 G,K,
 L,
 C,H, A
 D,I,M,
 J,N, B C D E
 E,
F G H I J

Limit = 3 K L M N

Dr. Manel Mrabet 125


Iterative Deepening Search (IDS)
 A,B,F,
 G,K,
 L,
 C,H, A
 D,I,M,
 J,N, B C D E
 E,Failure
F G H I J

Limit = 3 K L M N

O
Dr. Manel Mrabet 126
Iterative Deepening Search
(IDS)

DLS with bound = 4


Iterative Deepening Search (IDS)
 A,

B C D E

Limit = 4
Dr. Manel Mrabet 128
Iterative Deepening Search (IDS)
 A,B,

B C D E

F G

Limit = 4
Dr. Manel Mrabet 129
Iterative Deepening Search (IDS)
 A,B,F,

B C D E

F G

Limit = 4
Dr. Manel Mrabet 130
Iterative Deepening Search (IDS)
 A,B,F,
 G,

B C D E

F G

K L

Limit = 4
Dr. Manel Mrabet 131
Iterative Deepening Search (IDS)
 A,B,F,
 G,K,

B C D E

F G

K L

Limit = 4
Dr. Manel Mrabet 132
Iterative Deepening Search (IDS)
 A,B,F,
 G,K,
 L,
A

B C D E

F G

K L

Limit = 4 O
Dr. Manel Mrabet 133
Iterative Deepening Search (IDS)
 A,B,F,
 G,K,
 L, O: Goal State
A

B C D E

F G

K L

Limit = 4 O
Dr. Manel Mrabet 134
Iterative Deepening Search (IDS)
The returned solution is the sequence of operators in the path:
A, B, G, L, O

B C D E

F G

K L

O
Dr. Manel Mrabet 135
Summary
 Search: process of constructing sequences of actions that achieve a goal given a
problem.
 The studied methods assume that the environment is observable, deterministic,
static and completely known.
 Goal formulation is the first step in solving problems by searching. It facilitates
problem formulation.
 Formulating a problem requires specifying four components: Initial states,
operators, goal test and path cost function. Environment is represented as a
state space.
 A solution is a path from the initial state to a goal state.
 Search algorithms are judged on the basis of completeness, optimality, time
complexity and space complexity.
 Several search strategies: BFS, DFS, DLS, IDS,…

 All uninformed searches have an exponential time complexity – hopeless as a


viable problem solving mechanism (unless you have a quantum computer!)
Dr. Manel Mrabet 136

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy