6433 AI Assignment R056
6433 AI Assignment R056
CLASS:TYIT R056
Overview:
Breadth-First Search (BFS) is an uninformed search algorithm
that explores all possible states level by level, starting from the
initial state. It explores all the nodes at the present depth level
before moving on to nodes at the next depth level. This means it
expands all the neighbors of the current node before moving
deeper into the tree.
Key Characteristics:
● Complete: BFS is guaranteed to find a solution if one exists,
provided that the search space is finite.
● Optimal: BFS is optimal when all actions have the same cost
because it finds the shallowest goal node.
● Time Complexity: O(b^d), where bbb is the branching factor
and ddd is the depth of the shallowest solution. This means
that BFS can be quite inefficient when the branching factor
is large or the solution is deep.
● Space Complexity: O(b^d), because all nodes at the current
depth level need to be stored in memory.
How it works:
Overview:
Depth-First Search (DFS) is another uninformed search algorithm
that explores a path as deeply as possible before backtracking.
Starting at the initial state, it explores each branch of the search
tree until it reaches a leaf node or a goal. If the algorithm reaches
a dead-end (a node with no further children), it backtracks and
explores the next path.
Key Characteristics:
How it works:
1. Initialize a stack and push the initial state onto the stack.
2. While the stack is not empty, pop a node and generate its
children.
3. If a child is the goal, stop the search. Otherwise, push the
child onto the stack and continue.
4. If all children are explored and no goal is found, backtrack
by popping the stack and exploring other paths.
Example: In a maze, DFS would start from the initial point and go
down one path as far as possible. If it hits a dead-end, it
backtracks and tries another path until it finds the goal.
Informed Search Strategies
3. A Search Algorithm*
Overview:
A* (A-star) search is a popular informed search algorithm that
combines the strengths of both BFS and DFS by using a heuristic
to guide the search. It uses the cost to reach the current node and
an estimate of the cost to reach the goal from the current node to
determine the next node to explore.
Key Characteristics:
Heuristic:
The A* algorithm uses a cost function f(n)f(n)f(n), which is the
sum of two parts:
● g(n): The cost to reach the current node nnn from the start
node.
● h(n): The heuristic estimate of the cost to reach the goal
from the current node.
How it works: