Depth First Search (DFS)
Uninformed Search in Artificial
Intelligence | Summary
Presented by:-
NAME:-MANJUNATH T KUMBAR
USN:-2VX22RA007
Working Principle
of DFS
• DFS is an uninformed search technique.
• Explores a path fully before
backtracking.
• Uses a stack (LIFO - Last In First Out).
• Goes deep into the tree/graph instead of
level-wise.
Structure
• DFS works with trees or
graphs.
• Starts from the root node
and explores as far as
possible.
• If goal is found, it returns
the path to it.
Traits and Limitations
• Incomplete: May not find the goal in infinite
search spaces.
• Can get stuck in cycles.
• Non-optimal: Might return a longer-cost path
even if shorter exists.
Time Complexity
• O(V + E):V = vertices, E = edges.
• AI context: O(b^d):
- b = branching factor
- d = depth of the tree
• Example: b = 2, d = 2 → 2^2 = 4 searches.
If each node gives birth to 2 children (b=2),
and the depth is 2, then 2^2 = 4 steps may be
needed.

DFS_Uninformed_Search_AI_.pptx in artificial intelligence

  • 1.
    Depth First Search(DFS) Uninformed Search in Artificial Intelligence | Summary Presented by:- NAME:-MANJUNATH T KUMBAR USN:-2VX22RA007
  • 2.
    Working Principle of DFS •DFS is an uninformed search technique. • Explores a path fully before backtracking. • Uses a stack (LIFO - Last In First Out). • Goes deep into the tree/graph instead of level-wise.
  • 3.
    Structure • DFS workswith trees or graphs. • Starts from the root node and explores as far as possible. • If goal is found, it returns the path to it.
  • 4.
    Traits and Limitations •Incomplete: May not find the goal in infinite search spaces. • Can get stuck in cycles. • Non-optimal: Might return a longer-cost path even if shorter exists.
  • 5.
    Time Complexity • O(V+ E):V = vertices, E = edges. • AI context: O(b^d): - b = branching factor - d = depth of the tree • Example: b = 2, d = 2 → 2^2 = 4 searches. If each node gives birth to 2 children (b=2), and the depth is 2, then 2^2 = 4 steps may be needed.