Unit-2 - Updated
Unit-2 - Updated
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.
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.
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 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.
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.
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,
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.
Hill climbing algorithm is a local search
algorithm which continuously moves in the
direction of increasing elevation/value to find
the peak of the mountain or best solution to
the problem.
It terminates when it reaches a peak value
where no neighbor has a higher value.
Hill climbing algorithm is a technique which
is used for optimizing the mathematical
problems. One of the widely discussed
examples of Hill climbing algorithm is
Traveling-salesman Problem in which we
need to minimize the distance traveled by the
salesman.
It is also called greedy local search as it only
looks to its good immediate neighbor state
and not beyond that
A node of hill climbing algorithm has two
components which are state and value.
Hill Climbing is mostly used when a good
heuristic is available.
In this algorithm, we don't need to maintain
and handle the search tree or graph as it only
keeps a single current state.
Generate and Test variant: Hill Climbing is the
variant of Generate and Test method. The
Generate and Test method produce feedback
which helps to decide which direction to
move in the search space.
Greedy approach: Hill-climbing algorithm
search moves in the direction which
optimizes the cost.
No backtracking: It does not backtrack the
search space, as it does not remember the
previous states.