Paghahanap na lalim-muna

Ang Paghahanap na lalim-muna (Ingles: Depth-first search o DFS) ay isang algoritmo ng paglalakbay o paghahanap ng isang puno(tree), istrakturang puno o grapo. Ito ay nagsisimula sa ugat(na pumipili ng isang nodo bilang ugat sa grapo) at ginagalugad ng kasing layo sa kahabaan ng bawat isang sanga bago ang pag-urong. Ang bersiyon ng paghahanap na lalim muna ay inimbestigahan noong ika-19 na siglo ng Pranses na matematikong si Charles Pierre Tremaux bilang stratehiya ng paglutas ng mga maze.

Paghahanap na lalim-muna
Order in which the nodes get expanded
Order in which the nodes get expanded
Order in which the nodes are visited
ClassSearch algorithm
Data structureGraph
Worst case performance for explicit graphs traversed without repetition, for implicit graphs with branching factor b searched to depth d
Worst case space complexity if entire graph is traversed without repetition, O(longest path length searched) for implicit graphs without elimination of duplicate nodes