Unit1 Class3.2 Uninformed Search
Unit1 Class3.2 Uninformed Search
Unit1 Class3.2 Uninformed Search
Nishtha Varshney
Student,
VI Sem
Department of Computer Science & Engineering
SEARCH
STARTEGY
UNINFORMED INFORMED
SEARCH SEARCH
Uninformed search (blind search) Strategies that know whether one non-
strategies use only the information goal state is better than another are
available in the problem definition. All called informed search or heuristic
they can do is generate successors search.
and distinguish a goal state from a
non-goal state.
Machine Intelligence
Types of Search Strategies/Algorithms
Let's take a look at some of the real-life applications where a BFS implementation
can be highly effective.
• P2P Networks: BFS can be implemented to locate all the nearest or neighboring
nodes in a peer to peer network. This will find the required data faster.
• Web Crawlers: Search engines or web crawlers can easily build multiple levels
of indexes by employing BFS. BFS implementation starts from the source, which
is the web page, and then it visits all the links from that source.
• Navigation Systems: BFS can help find all the neighboring locations from the
main or source location.
• Network Broadcasting: A broadcasted packet is guided by the BFS algorithm to
find and reach all the nodes it has the address for.
Machine Intelligence
Depth-First Search
O(bm): terrible if m is
much larger than d
fails in infinite-depth but if solutions O(bm), i.e.,
spaces, linear space! Not optimal at all
or spaces with loops are dense, may be
much faster than
breadth-first
Machine Intelligence
Depth First Search
• space is restricted;
• many solutions exist, perhaps with long path lengths, particularly for
the case where nearly all paths lead to a solution; or
• the order of the neighbors of a node are added to the stack can be
tuned so that solutions are found on the first try.
• it is possible to get caught in infinite paths; this occurs when the graph
is infinite or when there are cycles in the graph; or
• solutions exist at shallow depth, because in this case the search may
look at many long paths before finding the short solutions.
Machine Intelligence
Applications of Depth First Search
• When all the step cost are equal bfs is optimal because it always
expands the shallowest unexploded node
• Uniform-cost search is an extension of BFS when the cost is not
uniform.
• Uniform-cost search expands the node n with the lowest path cost
g(n)
• This is done by storing the frontier as a priority queue ordered by the
path cost g(n).
• The primary goal of the uniform-cost search is to find a path to the
goal node which has the lowest cumulative cost
Machine Intelligence
Uniform Cost Search - Example
we
the
NEXT
For
now
G2
WE
NOW
AND
for
DOES
NOW
WE
now
but
we choose
calculate
istotal
now
the ONE
have cost
cheapest
both
BEGIN
CALULATE
CHOOSE
we
we
GOAL
WE
WE
WE
IT
given
we
haveD TO
total
comes
as
explore
have
bfour
END
CHOSE cVISIT
EXPLORE
GO
and the
choose
WITH
and
the
graph
would
6
paths
three
BACK
THE
OURpath
THEoptimal
up
active
we
D
THE
cost
are
START
for
B
withIS
nodes
now and
to
MINIMUM
be
stop E
SOLUTION
visited
THAT
TO
and
PATH
non
paths
B
NODE
sG1
C9Bget
AND
one
5+3=8
the
as 8don't
explore
STATE
visited
AT
we
with
COST
C
two
startwith
at
WE both
algorithm
TO
PATH
and
LEVEL
so
SO
14,G2
of cost
EXPLORE
states
EXPAND
go
E
them
WE 5ofAND
explore
all
OFback
2and
with 6Gcost
having
and
AND
with
return
THAT
13
to ITthe
EXPLORE
our
as
,F
path
CALACULATE
and
goal
of
second
IScost
9following
G3
Bstate,apply
and
IT
of
with
level
C15
path
PATH
,we
UCSchoose
TOTAL
to reach
the
ASone
minof
G2the goal from S
NODE
CHEAPEST
itagain
EXPLORE
13
nodes
8
again
S 1
5 6 5 S D
6
9 6 2 2
A 3 9
C 2
B D 1
A 9 2 B 7 E
3 9 2 2 5 F 7
8
G1
G G2 G3
B C E
1
7 5 7
1
G G
F 3
C 2
S A D B C G
Machine Intelligence
Uniform Cost Search - Psuedo Code
yes it finds
Yes its
O(b1+[C∗/Ɛ]), O(b1+[C∗/Ɛ]), an optimal
complete
solution
Machine Intelligence
Uniform Cost Search
• It helps to find the path with the lowest cumulative cost inside a
weighted graph having a different cost associated with each of its
edge from the root node to the destination node.
• It is considered to be an optimal solution since, at each state, the
least path is considered to be followed.
• The open list is required to be kept sorted as priorities in priority
queue needs to be maintained.
• The storage required is exponentially large.
• The algorithm may get stuck in an infinite loop as it considers
every possible path going from the root node to the destination
node.
Machine Intelligence
Uniform Cost Search
19 13
3 C D H
A 2 3
2 F
7
B E
6
1
G
THANK YOU
Nishtha Varshney
Department of Computer Science & Engineering
nishuvr13@gmail.com