You are on page 1of 10

Evaluating Search Strategies

Bisheshwor Neupane
Roll Number -35
Types of Search Algorithms
Breadth First Search
1. BFS is useful for analyzing the nodes in a graph and constructing the shortest path of traversing
through these.
2. BFS can traverse through a graph in the smallest number of iterations.
3. The architecture of the BFS algorithm is simple and robust.
4. The result of the BFS algorithm holds a high level of accuracy in comparison to other algorithms.
5. BFS iterations are seamless, and there is no possibility of this algorithm getting caught up in an
infinite loop problem.
6. Breadth-First Search (BFS) starts by examining the first node and expands one layer at a time.
7. It is Uninformed Search Technique.
8. It is also called blind search.
9. Implements FIFO (Queue)
10. for example, all nodes “one hop” from the first node; once those are exhausted it proceeds to all nodes
“two hops” from the first node and so forth.
Breadth First Search
Important Parameters to be Considered Before Evolving
Search Technique

1. Maximum number of successors of any state of the search tree.i.e., the branch factor b of the
search tree.
2. Minimal length of the path in the state space between the initial and a goal state.
3. Depth d of the shallowest goal node in the search tree.
4. Maximum depth m of the state space.
Evaluating Search Strategies

Completeness:
● It is a guarantee of finding a solution whenever one exists.
● if a solution exists and if you are searching technique can find that solution and the technique is
said to be complete.
In BFS,
● Traverses level by level and doesn’t miss any nodes.
● It reaches the goal if the breadth is finite
Evaluating Search Strategies
Time Complexity
1. Time complexity is how long does it take to find a solution and this is usually measured in terms
of the number of nodes that the searching technique expands.

In BFS, it is the number of nodes we generate

2. O(E+V) ; E = Edges, V = Vertices


3. 1+b+b2+b3+... +bd + (bd+1-b)) = O(bd+1); d = depth
Evaluating Search Strategies
Space Complexity
● Space complexity is the measurement of the maximum size of the nodes list during the search
● The amount of memory the algorithm needs to run to completion.
● S(p) = c + Sp(I)

where, c is a constant representing the fixed space requirements.

Sp(I) is the variable space requirement of the program working on an instance I.

In BFS, it keeps every node in memory either in fringe or on a path to fringe

● O(V)
● O(Bd+1)
Evaluating Search Strategies
Optimality/Admissibility
● Optimality states, If a solution is found, is it guaranteed to be an optimal one?
● Is it the one with minimum cost?

In BFS,

● Yes (if we guarantee that deeper solutions are less optimal, e.g. step-cost=1)
● Gives the shortest path even if the cost to visit every node is different
Time and Memory Analysis of BFS

● b = 10,
● 10,000 nodes are
processed in 1 s,
● 1000 bytes per
node

You might also like