0% found this document useful (0 votes)
15 views

Uninformed Search Recording

The document provides an overview of uninformed search algorithms in artificial intelligence, detailing their properties, types, and specific algorithms such as Breadth-First Search, Uniform Cost Search, and Depth First Search. It explains the mechanics of these algorithms, their advantages and disadvantages, as well as their time and space complexities. Additionally, it discusses bidirectional search as a more efficient method by simultaneously searching from both the source and goal nodes.
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)
15 views

Uninformed Search Recording

The document provides an overview of uninformed search algorithms in artificial intelligence, detailing their properties, types, and specific algorithms such as Breadth-First Search, Uniform Cost Search, and Depth First Search. It explains the mechanics of these algorithms, their advantages and disadvantages, as well as their time and space complexities. Additionally, it discusses bidirectional search as a more efficient method by simultaneously searching from both the source and goal nodes.
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/ 37

AJAY KUMAR GARG ENGINEERING COLLEGE

Branch - CSE
ARTIFICIAL INTELLIGENCE

UNINFORMED SEARCH ALGORITHMS

By

Dr. Anuradha Taluja


Associate Professor
Department of Computer Science & Engineering
Introduction to Search Algorithms in
AI
Introduction to Search Algorithms in AI
• Artificial Intelligence is basically the
replication of human intelligence through
computer systems or machines.
• It is done through the process of acquisition of
knowledge or information and the addition of
rules that are used by information, i.e.
learning, and then using these rules to derive
conclusions (i.e. reasoning) and then self-
correction.
Properties of Search Algorithms

• Completeness: A search algorithm is complete


when it returns a solution for any input if at
least one solution exists for that particular
input.
• Optimality: If the solution deduced by the
algorithm is the best solution, i.e. it has the
lowest path cost, then that solution is
considered as the optimal solution.
• Time and Space Complexity: Time complexity
is the time taken by an algorithm to complete
its task, and space complexity is the maximum
storage space needed during the search
operation.
Uninformed/Blind Search:
• The uninformed search does not contain any domain
knowledge such as closeness, the location of the
goal.
• It operates in a brute-force way as it only includes
information about how to traverse the tree and how
to identify leaf and goal nodes.
 Uninformed search applies a way in which search tree is
searched without any information about the search space like
initial state operators and test for the goal, so it is also called
blind search.
 It examines each node of the tree until it achieves the goal
node.
Informed Search

 Informed search algorithms use domain knowledge.


 In an informed search, problem information is available which
can guide the search.
 Informed search strategies can find a solution more
efficiently than an uninformed search strategy.
 Informed search is also called a Heuristic search.
 A heuristic is a way which might not always be guaranteed for
best solutions but guaranteed to find a good solution in
reasonable time.
 Informed search can solve much complex problem which
could not be solved in another way.
Types of search algorithms
Breadth-first Search:

• Breadth-first search is the most common search


strategy for traversing a tree or graph.
• This algorithm searches breadth wise in a tree or
graph, so it is called breadth-first search.
• BFS algorithm starts searching from the root node of the tree
and expands all successor node at the current level before
moving to nodes of next level.
• The breadth-first search algorithm is an example of a general-
graph search algorithm.
• Breadth-first search implemented using FIFO queue data
structure.
• Advantages:
• BFS will provide a solution if any solution exists.
• If there are more than one solutions for a given
problem, then BFS will provide the minimal solution
which requires the least number of steps.
• Disadvantages:
• It requires lots of memory since each level of the tree must be
saved into memory to expand the next level.
• BFS needs lots of time if the solution is far away from the root
node.
BFS algorithm
• A standard BFS implementation puts each vertex of the graph
into one of two categories:
• Visited
• Not Visited
• The purpose of the algorithm is to mark each vertex as visited
while avoiding cycles.

BFS algorithm
1) Start by putting any one of the graph's vertices at the back of
a queue.
2) Take the front item of the queue and add it to the visited list.
3) Create a list of that vertex's adjacent nodes. Add the ones
which aren't in the visited list to the back of the queue.
4) Keep repeating steps 2 and 3 until the queue is empty.
5) The graph might have two different disconnected parts so to
make sure that we cover every vertex, we can also run the
BFS algorithm on every node
EXAMPLE
Example:

• In the tree structure, shown the


traversing of the tree using BFS
algorithm from the root node S to
goal node K.
• BFS search algorithm traverse in
layers, so it will follow the path
which is shown by the dotted
arrow, and the traversed path will
be:
• S---> A--->B---->C--->D---->G--->H-
-->E---->F---->I---->K
• Time Complexity: Time Complexity of BFS algorithm can be
obtained by the number of nodes traversed in BFS until the
shallowest Node. Where the d= depth of shallowest solution
and b is a node at every state (BRANCH FACTOR).
• T (b) = 1+b2+b3+.......+ bd= O (bd)
• Space Complexity: Space complexity of BFS algorithm is given
by the Memory size.
• Completeness: BFS is complete, which means if the
shallowest goal node is at some finite depth, then
BFS will find a solution.
• Optimality: BFS is optimal if path cost is a non-
decreasing function of the depth of the node.
Uniform cost Search
• Uniform-cost search is an uninformed search
algorithm that uses the lowest cumulative cost to
find a path from the source to the destination.
• Nodes are expanded, starting from the root,
according to the minimum cumulative cost.
• The uniform-cost search is then implemented using
a Priority Queue.
• Used for weighted tree/Graph traversal.
• Advan: Optimal Solution
• Disadv: Infinite Loop
Algorithm

• Insert the root node into the priority queue


• Repeat while the queue is not empty:
Remove the element with the highest priority
If the removed node is the destination, print
total cost and stop the algorithm
Else, enqueue all the children of the current
node to the priority queue, with their
cumulative cost from the root as priority
Depth First Search (DFS)
• Depth first Search or Depth first traversal is a recursive algorithm
for searching all the vertices of a graph or tree data structure.
• Traversal means visiting all the nodes of a graph.
• It uses STACK(LIFO)
Algorithm
• Start by putting any one of the graph's vertices on top of a stack.
• Take the top item of the stack and add it to the visited list.
• Create a list of that vertex's adjacent nodes. Add the ones which
aren't in the visited list to the top of the stack.
• Keep repeating steps 2 and 3 until the stack is empty.
Depth-limited search
• A depth-limited search algorithm is similar to depth-first
search with a predetermined limit. Depth-limited search can
solve the drawback of the infinite path in the Depth-first
search. In this algorithm, the node at the depth limit will treat
as it has no successor nodes further.
• Depth-limited search can be terminated with two Conditions
of failure:
• Standard failure value: It indicates that problem does not have
any solution.
• Cutoff failure value: It defines no solution for the problem
within a given depth limit.
• Advantages:
• Depth-limited search is Memory efficient.
• Disadvantages:
• Depth-limited search also has a disadvantage
of incompleteness (can be terminated without
solution).
• It may not be optimal if the problem has more
than one solution.
Iterative deepening depth-first Search

• The iterative deepening algorithm is a combination of DFS and


BFS algorithms. This search algorithm finds out the best depth
limit and does it by gradually increasing the limit until a goal is
found.
• This algorithm performs depth-first search up to a certain
"depth limit", and it keeps increasing the depth limit after
each iteration until the goal node is found.
• This Search algorithm combines the benefits of Breadth-first
search's fast search and depth-first search's memory
efficiency.
• The iterative search algorithm is useful uninformed search
when search space is large, and depth of goal node is
unknown.
• Advantages:
• It combines the benefits of DFS and DLS
search algorithm in terms of fast search and
memory efficiency.
• Disadvantages:
• The main drawback of IDDFS is that it repeats
all the work of the previous phase.
Bidirectional Search
• Bidirectional search is a graph search where unlike
Breadth First search and Depth First Search, the
search begins simultaneously from Source vertex and
Goal vertex and ends when the two searches meet
somewhere in between in the graph.
• This is thus especially used for getting results in a
fraction of the time taken by both DFS and FS
searches.
• The search from the initial node is forward search while that
from the goal node is backwards.
• It is also based on heuristic search meaning finding the
shortest path to goal optimally.
Bidirectional Search Algorithm

• Heuristic refers to the concept of finding the


shortest path from the current node in the graph
to the goal node.
• The search always takes the shortest path to the
goal node. This principle is used in a bidirectional
heuristic search.
• The only difference being the two simultaneous
searches from the initial point and from goal
vertex. The main idea behind bidirectional
searches is to reduce the time taken for search
drastically.
Bidirectional Search Algorithm
• This happens when both searches happen
simultaneously from the initial node depth or
breadth-first and backwards from goal nodes
intersecting somewhere in between of the graph.
• Now the path traverses through the initial node
through the intersecting point to goal vertex is the
shortest path found because of this search.
• This is the shortest path and found in a fraction of
time taken by other search algorithms.
• Step 1: Say, A is the initial node
and O is the goal node, and H
is the intersection node.
• Step 2: We will start searching
simultaneously from start to
goal node and backward from
goal to start node.
• Step 3: Whenever the forward
search and backward search
intersect at one node, then the
searching stops.
• Thus, it is possible when both the Start node
and goal node are known and unique,
separate from each other.
• Also, other points to be noted are that
bidirectional searches are complete if a
breadth-first search is used for both traversals,
i.e. for both paths from start node till
intersection and from goal node till
intersection.
References

• R1. E Charniak and D McDermott,


“Introduction to Artificial Intelligence”,
Pearson Education

• R2. Dan W. Patterson, “Artificial Intelligence


and Expert Systems”, Prentice Hall of India

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