Posts Tagged ‘Searching’

Breadth First Search Vs Depth First Search

September 4th, 2010 1 comment
Breadth First Search Depth First Search
Optimal solutions are always found

Multiple solutions found early

May arrive at solutions without examining much of search space
Will not go down blind alley for solution Needs little memory (only node in current path needs to be stored)
If solution path is long, the whole tree must be searched up to that depth May settle for non-optimal solution
All of the tree generated must be stored in memory May explore single unfruitful path for a long time (forever if loop exists!)