0% found this document useful (0 votes)
62 views48 pages

Uninformed Search Algorithms: Csed, Tiet

The document discusses various search algorithms used in artificial intelligence problems to find solutions. It describes uninformed or blind search methods like depth-first search, breadth-first search, and depth-first search with iterative deepening that explore the state space without any guidance. It also covers informed search methods like A* that use heuristic functions to guide the search towards the goal state. Examples are provided to illustrate depth-first and breadth-first search on a sample search tree.

Uploaded by

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

Uninformed Search Algorithms: Csed, Tiet

The document discusses various search algorithms used in artificial intelligence problems to find solutions. It describes uninformed or blind search methods like depth-first search, breadth-first search, and depth-first search with iterative deepening that explore the state space without any guidance. It also covers informed search methods like A* that use heuristic functions to guide the search towards the goal state. Examples are provided to illustrate depth-first and breadth-first search on a sample search tree.

Uploaded by

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

UNINFORMED SEARCH

ALGORITHMS

CSED, TIET
SEARCH ALGORITHMS
 In AI, the problems are represented as state spaces i.e. initial
state, final state(s) and set of intermediate states.
 So, in AI problems certain algorithms are required to search the
for a sequence of steps to be taken to find the solution.
 Hence search is a characteristic of all AI problems.

 The goodness of a search algorithm can be judged by the time


taken by the algorithm to find the solution and the space
required for storing the intermediate state and the solution path.
 Search algorithms are broadly classified as Uninformed or
Uniformed searching techiques.
UNINFORMED / BLIND SEARCHING
METHODS

 Blind search occurs when we do not have any information


about the direction in which we are going while searching.
 In these types of algorithms , the nodes in the state space are
explored until a goal is found or failure occurs or the space is
exhausted or certain time is limited.
 Various types of uniformed search algorithms include:
 Depth-FirstSearch (DFS)
 Breadth-First Search (BFS)
 DFS with iterative deepening
 Generate and Test
INFORMED SEARCHING METHODS
 Informed search is used when some information is available to
guide the search through all possible states.
 The information can be in the form of cost of each path to the
goal sate with the help of a function called heuristic function.
 These costs include both the exact cost and the estimates of
costs in finding the solution through current node.
 Various informed searching algorithms include:
 Branch and Bound
 Beam Search
 Simple Hill Climbing
 Steepest Ascent Climbing
 Best-first Search & greedy best-first
 A* and A* with iterative deepening
DEPTH-FIRST SEARCH
 Depth-first search is performed by moving downward in the
tree in depth-first fashion.
 The leftmost branch is explored till either the goal node is
found or leaf node is reached.
 If the goal is found, then search terminates by giving the
solution from root node to goal node.
 Otherwise, backtracking is done for the elements from the
right side of the leaf node till the root node.
 If still the solution is found, then the next branch is explored
in the similar way.
 DFS is implemented with the help of queue.

 The newly generated children are placed at the head of


the queue so that they are processed first.
DEPTH-FIRST SEARCH ALGORITHM
1) Place the starting node s on the queue.
2) If the queue is empty, then return failure and stop.
3) If the first element of the queue is goal then return success
and stop. Otherwise go to step 4.
4) Remove and expand the first element from the queue by
adding its children at the front of the queue.
5) Return to step 2.
EXAMPLE- DEPTH FIRST SEARCH
 Consider the following search tree with initial state A and goal
node I.

B C

D E F

G H
EXAMPLE- DEPTH FIRST SEARCH
CONTD….
Step Operation Queue
Contents
1 Add starting node A in queue {A}
2 Remove A and check for goal state-No {B,C}
Add children of A i.e. B and C to the front of queue
3 Remove B and check for goal state-No {D,E,C}
Add children of B i.e. D and E to the front of queue
4 Remove D and check for goal state-No {G,E,C}
Add children of D i.e. G to the front of queue
5 Remove G and check for goal state-No {E,C}
Since G has no child so nothing is added to the front
6 Remove E and check for goal state-No {C}
Since E has no child so nothing is added to the front
7 Remove C and check for goal state-No {F}
Add children of C i.e. F to the front of queue
8 Remove F and check for goal state-No {H}
Add children of F i.e. H to the front of queue
9 Remove H and check for goal state-No {}
Since there is no child of H so queue is empty return failure
EXAMPLE- DEPTH FIRST SEARCH
CONTD….
 So, the depth first traversal is:
A→B → D →G →E →C →F →H
 If the goal node is E, then the search would have stop at E i.e.
A→B → D →G →E
BREADTH-FIRST SEARCHING
 BFS is performed by exploring all the nodes at a given
depth before moving to the next level.
 The space require for BFS is high if the branching factor
( the average number of children of a node) is large.
 Still it is used as we are exploring all the nodes at one level
before going to the next level. So it is guaranteed that goal
is not left at the lower level.
 BFS is implemented with the help of queue.

 The newly generated children are placed at the end of


the queue.
BREADTH-FIRST SEARCH
ALGORITHM
1) Place the starting node s on the queue.
2) If the queue is empty, then return failure and stop.
3) If the first element of the queue is goal then return success
and stop. Otherwise go to step 4.
4) Remove and expand the first element from the queue by
adding its children at the end of the queue.
5) Return to step 2.
EXAMPLE- BREADTH FIRST SEARCH
 Consider the following search tree with initial state A and goal
node I.

B C

D E F

G H
EXAMPLE- BREADTH FIRST SEARCH CONTD….
Step Operation Queue
Contents
1 Add starting node A in queue {A}
2 Remove A and check for goal state-No {B,C}
Add children of A i.e. B and C to the end of queue
3 Remove B and check for goal state-No {C,D,E}
Add children of B i.e. D and E to the end of queue
4 Remove C and check for goal state-No {D,E,F}
Add children of C i.e. F to the end of queue
5 Remove D and check for goal state-No {E,F,G}
Add child of D i.e. G to the end of queue
6 Remove E and check for goal state-No {F,G}
Since E has no child so nothing is added to the end
7 Remove F and check for goal state-No {G,H}
Add children of F i.e. H to the end of queue
8 Remove G and check for goal state-No {H}
Since G has no child so nothing is added to the end
9 Remove H and check for goal state-No {}
Since there is no child of H so queue is empty return failure
EXAMPLE- BREADTH FIRST SEARCH CONTD….

 So, the depth first traversal is:


A→B → C →D →E →F →G →H
 If the goal node is E, then the search would have stop at E i.e.
A→B → C →D →E
DIFFERENCE BETWEEN DFS AND BFS
Depth First Search Breadth First Search
1. Explores all the nodes in the depth 1. Explores all the nodes in the
first fashion. breadth first fashion
2. May caught in blind alley i.e. 2. Never caught at blind alley because
searching at a greater depth in the left it explores all the nodes at the lower
path of the search tree while the depth before moving to the next node.
solution may lie on the right part.
3. It uses less space because only 3. It uses more space as all the nodes
current nodes at the current path need of the current level needs to be stored.
to be stored. The space increases with increase in
branching factor.
4. It may find the first solution which 4. It always finds the optimal solution
may not be optimal. if one exists.
DEPTH- FIRST SEARCH WITH ITERATIVE
DEEPENING (DFS-ID)
 In order to solve the problem of blind alley, there is
need to control the search at higher depth in DFS.
 So, DFS with iterative deepening is used in which the
level of depth is fixed for searching the solution.
 The search is started with a small depth . If the
solution is not found, then the level of depth is
increased by one and then the search is performed
again in depth first fashion.
 Thus, deepening of depth continues till a solution is
found.
EXAMPLE- DFS-ID
 Consider the following search tree with initial state A and goal
node I.

B C

D E F

G H
EXAMPLE- DFS-ID CONTD…..
 At Depth =1
The starting node is A. The initial queue is {A}. Since it is not a
goal node, the queue will be empty and the DFS-ID will stop.
 At Depth=2

Step Operation Stack


Content
1 Add starting node A to the queue {A}
2 Remove A and check for goal state-No {B,C}
Add child of A to the front of queue.
3 Remove B and check for goal state-No {C}
But children of B will not be added because that belongs to
depth 3
4 Remove C and check for goal state-No {}
But child of C will not be added because that belongs to depth
3. Since queue is empty, the DFS-ID will stop.
EXAMPLE- DFS-ID CONTD…..
 At Depth =3
Step Operation Stack
Content
1 Add starting node A to the queue {A}
2 Remove A and check for goal state-No {B,C}
Add child of A to the front of queue.
3 Remove B and check for goal state-No {D,E,C}
Add children of B to the front.
4 Remove D and check for goal state-No { E,C}
But child of D will not be added because that belongs to depth
4.
5 Remove E and check for goal state-No {C}
6 Remove C and check for goal state-No {F }
Add child of C to the front of queue
7 Remove F and check for goal state-No {}
But child of F will not be added because that belongs to depth
4. The queue will be empty, so DFS-ID will stop.
EXAMPLE- DFS-ID CONTD…..
 At Depth =4
Step Operation Queue
Contents
1 Add starting node A in queue {A}
2 Remove A and check for goal state-No {B,C}
Add children of A i.e. B and C to the front of queue
3 Remove B and check for goal state-No {D,E,C}
Add children of B i.e. D and E to the front of queue
4 Remove D and check for goal state-No {G,E,C}
Add children of D i.e. G to the front of queue
5 Remove G and check for goal state-No {E,C}
Since G has no child so nothing is added to the front
6 Remove E and check for goal state-No {C}
Since E has no child so nothing is added to the front
7 Remove C and check for goal state-No {F}
Add children of C i.e. F to the front of queue
8 Remove F and check for goal state-No {H}
Add children of F i.e. H to the front of queue
9 Remove H and check for goal state-No {}
So, the queue is empty return failure
EXAMPLE- DFS-ID CONTD…..
 So, the depth first traversal withiterative deepening is:
A→B → D →G →E →C →F →H
 If the goal node is E, then the search would have stopped at step
4 of depth 3 and traversal will be A→B → D →G →E
PROBLEM-I
 Find the solution to the following 8- puzzle problem using DFS
and BFS algorithms:

Initial State Final State


2 3 1 2 3
1 8 4 8 4
7 6 5 7 6 5
SOLUTION- PROBLEM I
 The search space tree is:
2 3
A 1 8 4
7 6 5

2 3
2 3 2 8 3
1 8 4 1 4 1 8 4
B 7 6 5
C 7 6 5
D 7 6 5

1 2 3 2 8 3 2 8 3 2 8 3 2 3 4
E 8 4
F 1 6 4
G H1 4 1
I 4 1 8
7 6 5 7 5 7 6 5 7 6 5 7 6 5

1 2 3 1 2 3 2 8 3 2 8 3 8 3 2 8 3 2 8 2 8 3 2 3 4 2 3 4
7 8 4 8 4 1 6 4 1 6 4 2 1 4 7 1 4 1 4 3 1 4 5 1 8 1 8 5
6 5 7 6 5 7 5 7 5 7 6 5 6 5 7 6 5 7 6 7 6 5 7 6

J K L M N O P Q R S
SOLUTION- PROBLEM I CONTD……
DFS : Initial State – A Goal State – K
Step Operation Queue Contents
1 Add starting node. {A}
2 Remove A add child of A at the front {B,C,D}
3 Remove B add child of B at the front { E,C,D}

4 Remove E add child of E at the front {J,K,C,D}

5 Remove J and there is no child of J {K,C,D}

6 K is the goal state stop

Therefore DFS solution is A→B →E →J →K


SOLUTION- PROBLEM I CONTD……
BFS : Initial State – A Goal State – K
Step Operation Queue Contents
1 Add starting node. {A}
2 Remove A add child of A at the end {B,C,D}
3 Remove B add child of B at the end {C,D,E}
4 Remove C add child of C at the end {D,E,F,G,H}
5 Remove D add of child of D at the end {E,F,G,H,I}
6 Remove E and child of E at the end {F,G,H,I,J,K}
7 Remove F and child of F at the end {G,H,I,J,K,L,M}
8 Remove G and child of G at the end {H,I,J,K,L,M,N,O}
9 Remove H and child of H at the end {I,J,K,L,M,N,O,P,Q}
10 Remove I and child of I at the end {J,K,L,M,N,O,P,Q,R,S}
11 Remove J and there is no child of J {K,L,M,N,O,P,Q,R,S}
12 K is the goal so stop

Therefore BFS solution is A→B →C →D →E →F →G →H →I →J →K


PROBLEM-2
We have two jugs, one with capacity 4L and other 3L. There are
no markings on the jugs.
We can pour water from pump into the jugs or from one jug to
another.
We can also pour water from the jugs to the ground.
The goal is to get 2L water in any of the jug.
Q1: Design production rules (operators) for the problem?
Q2: Construct a space search tree by expanding any one side
(left or right side) upto the depth where the goal state is
obtained?
Q3: From the space tree, find the solution for the problem?
Q4: Trace the contents of the queue using DF, BFS from initial
to goal state?
SOLUTION- PROBLEM 2
 Let (x,y) denote the amount of water in the 4L and 3L jugs. The
production rules for the problem are:
Description Rules
1. Fill 4-L jug (x,y) → (4,y)
x<4
2. Fill 3-L jug (x,y) → (x,3)
y<3
3. Empty 4-L jug on ground (x,y) → (0,y)
x>0
4. Empty 3-L jug on ground (x,y) → (x,0)
y>0
5. Pour some water from 3-L jug to fill 4-L jug (x,y) → (4, y - (4 - x))
0 < x+y ≥ 4 and y > 0
6. Pour some water from 4-L jug to fill 3-L jug (x,y) → (x - (3-y), 3)
0 < x+y ≥ 3 and x > 0
7. Pour all of water from 3-L jug into 4-L jug (x,y) → (x+y, 0)
0 < x+y ≤ 4 and y ≥ 0
8. Pour all of water from 4-L jug into 3-L jug (x,y) → (0, x+y)
0 < x+y ≤ 3 and x ≥ 0
SOLUTION- PROBLEM 2 CONTD…..
 The required search space tree is:
A
(0,0)

(4,0) B (0,3)

C (4,3) D (3,0)

E F(4,0) G
(3,3) (4,0)

(1,3) (4,3) (4,2) (4,3) (1,3)


H I J K L
SOLUTION- PROBLEM 2 CONTD…..
 The solution from the search tree can be found by tracing from the root node to the
goal node:
(0,0) → (0,3) → (3,0) → (3,3) → (4,2)

Depth first traversal and queue contents from A to J


A
B
CD
ED
HD
D
FG
IJG
JG
Stop
A → B → C →E →H →D →F →I →J
SOLUTION- PROBLEM 2 CONTD…..
 Breadth first traversal and queue contents from A to J:
A
B
CD
DE
EFG
FGH
GHIJ
HIJKL
IJKL
JKL
STOP
A→B →C →D →E →F →G →H →I →J
UNIFORM COST SEARCH (UCS)
 If all the edges in the search graph do not have the same cost
then breadth-first search generalizes to uniform-cost search.
 Instead of expanding nodes in order of their depth from the
root, uniform-cost search expands nodes in order of their cost
from the root.
 At each step, the next node n to be expanded is one whose cost
g(n) is lowest where g(n) is the sum of the edge costs from the
root to node n.
 OPEN is thus maintained as a priority queue i.e. the nodes in
OPEN are stored in the priority of their cost from the root node
(g(n)).
UNIFORM COST SEARCH (UCS)
 In UCS, whenever a node is expanded, it is checked whether
the node is a newly generated node or it is already in OPEN or
CLOSED.
 If it is a newly generated node then it is added in OPEN.

 If it is already in OPEN/CLOSED, then it is checked that the


new path cost to reach this node is less then earlier or not. If
new cost is more then the node is rejected, else this new path is
updated.
 In case the node is in CLOSED and the new path cost is better
then the cost is updated and the same improvement is
propagated.
UCS ALGORITHM
Insert start node (S,,gS)) to OPEN
Loop until OPEN is empty or success is returned
(n,p,g(n))  remove-head(OPEN) and add it CLOSED
If n is a goal node return success and path to n.
else
successors MOVEGEN(n)
for each successor m do switch
case
case 1: if m  OPEN and
m  CLOSED
compute g(m) = g(n) + cost (n,m)
add (m,n,g(m)) to OPEN according to priority of g(m)
case 2: if m  OPEN
compute newg(m)=g(n)+cost(n,m)
if newg(m) < g(m) then
update g(m) =newg(m)
update (m,n,g(m)) to OPEN according to priority of g(m)
end if
case 3: if m  CLOSED
compute newg(m)=g(n)+cost(n,m)
if newg(m) < g(m) then
update g(m) = newg(m)
update (m,n,g(m)) to CLOSED according to priority of g(m)
propogateimprovement(m)
end if
end for
end if
end loop
UCS A L G O R I T H M C O N T D … .
propagateimprovement(m)
for each successor s of m
compute newg(s)=g(m) + cost(m,s)
if newg(s) < g(s) then
update g(s)=newg(s)
update (s,m,g(s)) in OPEN or
CLOSED
if s  CLOSED then
propogateimprovement(s)
end if
end if
end for
UCS EXAMPLE

 For the search space shown below, find the optimal path from S to D
using UCS algorithm

1
4

A 2 B
5 2
1
2
D C
3
UCS EXAMPLE

g(S)=0
Add (S,,0) to OPEN and CLOSED is empty
Iteration OPEN CLOSED
0 {(S,,0)} {}
Iteration I
Remove head node (S,,0) from OPEN and add to CLOSED.
Since S is not goal node, therefore successors of S i.e. A and B
are produced (case 1: both are new not in OPEN and CLOSED)
Successors of S:
A :g(A)=g(S)+cost(S,A) = 0+1 =1
B : g(B)=g(S)+cost(S,B) = 0+4 =4
Iteration OPEN CLOSED
0 {(S,,0)} {}
1 {(A,S,1) (B,S,4) {(S,,0)}
UCS EXAMPLE
Iteration I I
Remove head node (A,S,1) from OPEN and add to CLOSED.
Since A is not goal node, therefore successors of A i.e. S, B , C, and D are produced (for S it
is case 3 as it is already in CLOSED, for B it is case 2 as it is already in OPEN and for C
and D it is case 1 which is not in OPEN and CLOSED)
Successors of A:
S :newg(S)=g(A)+cost(A,S) = 1+1=2
since newg(S) is not less than g(S), so this successor is ignored
B : newg(B)=g(A)+cost(A,B) = 1+2=3
since newg(B) is less than g(B), so update (B,A,3) in OPEN
C: g(C)=g(A) +cost(A,C) = 1 + 5=6,
Add (C,A,6) to OPEN
D: g(D)= g(A) +cost(A,D)=1+12=13
Add (D,A,13) to OPEN
Iteration OPEN CLOSED
0 {(S,,0)} {}
1 { (A,S,1) (B,S,4)} {(S,,0)}
2 {(B,A,3) (C,A,6) (D,A,13)} {(S,,0) (A,S,1)}
UCS EXAMPLE
Iteration I I I
Remove head node (B,A,3) from OPEN and add to CLOSED.
Since B is not goal node, therefore successors of B i.e. S, A , C are produced (for S and A it is
case 3 as it is already in CLOSED, for C it is case 2 as it is already in OPEN)
Successors of B:
S :newg(S)=g(B)+cost(B,S) =3+4=7
since newg(S) is not less than g(S), so this successor is ignored
A : newg(A)=g(B)+cost(B,A) = 3+2=5
since newg(A) is not less than g(A) , so this successor is ignored.
C: newg(C)=g(B) +cost(B,C) = 3+ 2=5
since newg(C) is less than g(C) , so update (C,B,5) in OPEN

Iteration OPEN CLOSED


0 {(S,,0)} {}
1 { (A,S,1) (B,S,4)} {(S,,0)}
2 {(B,A,3) (C,A,6) (D,A,13)} {(S,,0) (A,S,1)}
3 {(C,B,5) (D,A,13)} {(S,,0) (A,S,1) (B,A,3)}
UCS EXAMPLE
Iteration I V
Remove head node (C,B,5) from OPEN and add to CLOSED.
Since C is not goal node, therefore successors of C i.e. B,A and D are produced (for B and A it
is case 3 as it is already in CLOSED, for D it is case 2 as it is already in OPEN)
Successors of C:
B :newg(B)=g(C)+cost(C,B) =5+2=7
since newg(B) is not less than g(B), so this successor is ignored
A : newg(A)=g(C)+cost(C,A) = 5+5=10
since newg(A) is not less than g(A) , so this successor is ignored.
D: newg(D)=g(C) +cost(C,D) = 5+ 3=8
since newg(D) is not less than g(D) , so update (D,C,8) in OPEN

Iteration OPEN CLOSED


0 {(S,,0)} {}
1 { (A,S,1) (B,S,4)} {(S,,0)}
2 {(B,A,3) (C,A,6) (D,A,13)} {(S,,0) (A,S,1)}
3 {(C,B,5) (D,A,13)} {(S,,0) (A,S,1) (B,A,3)}
4 {(D,C,8)} {(S,,0) (A,S,1) (B,A,3)(C,B,5)}
UCS EXAMPLE
Iteration V
Remove head node (D,C,8) from OPEN and add to CLOSED.
Since D is goal node, therefore algorithm will terminate

Path is SA  BC  D with path cost 8

Iteration OPEN CLOSED


0 {(S,,0)} {}
1 { (A,S,1) (B,S,4)} {(S,,0)}
2 {(B,A,3) (C,A,6) (D,A,13)} {(S,,0) (A,S,1)}
3 {(C,B,5) (D,A,13)} {(S,,0) (A,S,1) (B,A,3)}
4 {(D,C,8)} {(S,,0) (A,S,1) (B,A,3)(C,B,5)}
5 {} {(S,,0) (A,S,1) (B,A,3)(C,A,6)(D,C,8)}
BIDIRECTIONAL SEARCH
 bidirectional search simultaneously finds both forward from the
initial state and backward from the goal, and stop when the two
searches meet in the middle (as shown in figure below).
BIDIRECTIONAL SEARCH
 Bidirectional search replaces single search graph(which is
likely to grow exponentially) with two smaller sub graphs –
one starting from initial vertex and other starting from goal
vertex. The search terminates when two graphs intersect.
 Bidirectional search would be complete and optimal if BFS is
used during both forward and backward search.
 It dramatically reduce the amount of required exploration.

Suppose if branching factor of tree is b and distance of goal


vertex from source is d, then the normal BFS/DFS searching
complexity is O(bd) .
On the other hand, if we execute two search operation then
the complexity would be O(2bd/2) = O(bd/2)  which is far less
than O(bd) .
ISSUES IN BIDIRECTIONAL SEARCH
 Several issues need to be addressed before the algorithm can be
implemented.
 The main question is, what does it mean to search backwards from the
goal?
We need to define the predecessors of a node n to be all those nodes
that have n as a successor.
When all operators are reversible, the predecessor and successor sets are
identical; some problems, however, calculating predecessors can be very
difficult.
 What if there are many possible goal states?
 There must be an efficient way to check each new node to see if it
already appears in the search tree of the other half of the search.
 We need to decide what kind of search is going to take place in each
half.
GENERATE AND TEST
 In generate and test procedure, a solution is generated and then tested
whether it is a solution or not.
 It is exhaustive search through the solution space.

 If the generation of possible solutions is systematic then this


procedure will find the solution eventually if it exists.
 In case, the problem space is very large it may take a very long time.

 The algorithm for generate and test is:

1) Generate possible solution. For some problem this means


generating a particular point (state) in the problem space. For
others, it means generating a path from a start space.
2) Test to see if it is actually a solution by comparing the chosen state
or path with set of acceptable states.
3) If it is solution report it, else go to step 1.
PROBLEM 1
 Consider the following distance matrix between the cities
A,B,C, and D.
A B C D
A - 100 125 175
B 100 - 50 75
C 125 50 - 100
D 175 75 100 -

Using generate and test, solve the travelling salesman problem


with starting city A.
SOLUTION- PROBLEM 1
 Generate and test require generation of possible solution and
test whether it is required solution or not
 Here, minimum distance is the required solution. So, all the
paths need to be generated and the one with minimum distance
is the required solution.
 The various paths are shown in search tree:

B C D
SOLUTION- PROBLEM 1
 There are two paths with minimum distance 400
A→B →D →C →A
and A →C →D →B →A
LIMITATIONS OF UNINFORMED
SEARCH
 The uninformed search moves in the search tree, without
any guiding information.
 For a large search tree, it is very difficult to search the
solution without any guiding information.
 For instance, in a travelling salesman problem, for n cities
there are (N-1)! paths. So, it is easy to find solutions from
4 cities with 6 paths but for 11 cities it is difficult to check
10! i.e. 3,628,800 paths.
 This phenomenon is called combinatorial explosion.

 To combat it we use informed or heuristic search


algorithms.

You might also like