Skip to main content

Informed vs blind search; DFS vs BFS

Short answer

Informed search uses a heuristic h(n) to guide toward the goal; blind search uses only the problem definition. BFS expands level by level with a queue, is complete and optimal for equal costs, with time and space O(b^d). DFS uses a stack, goes deep first, needs O(b*m) space but may fail in infinite spaces.

Differentiate between informed and blind search. How is depth first search different from breadth first search? Compare with evaluation parameters.

Informed vs blind (uninformed) search

BasisBlind (uninformed) searchInformed (heuristic) search
Knowledge usedOnly the problem definitionProblem-specific knowledge as a heuristic h(n), the estimated cost to the goal
DirectionSystematic, no idea of goal directionGuided towards the goal
EfficiencyExplores many unnecessary nodes; slowExplores fewer nodes; faster
Time and spaceUsually very highMuch lower with a good heuristic
OptimalityOnly some (BFS with equal cost, UCS)A* with an admissible heuristic is optimal
ExamplesBFS, DFS, uniform-cost, depth-limited, iterative deepeningGreedy best-first, A*, hill climbing, beam search

DFS vs BFS

  • BFS expands nodes level by level using a FIFO queue; DFS goes as deep as possible along a branch before backtracking, using a LIFO stack (or recursion).
  • Example tree A → (B, C), B → (D, E), C → (F, G): BFS visits A B C D E F G; DFS visits A B D E C F G.

With b = branching factor, d = depth of shallowest goal, m = maximum depth:

Evaluation parameterBFSDFS
CompletenessCompleteNot complete in infinite or cyclic spaces
OptimalityOptimal when step costs are equalNot optimal
Time complexityO(b^d)O(b^m)
Space complexityO(b^d) (stores all nodes of a level)O(b·m) (stores one path)
Data structureQueueStack
BehaviourFinds the shallowest goalMay find a deep goal first or go into an infinite branch
Suitable whenSolution is shallow, shortest path neededMemory is limited, many solutions deep in the tree

✓ Answer checked by Claude Opus 5.5 (high effort)

All Artificial Intelligence chapter 3 questions →