Depth First Search
This is a very simple type of brute-force technique. The search begins by expanding the initial node, i.e., by using an operator, generate all successors of the initial node and test them. This search procedure works the by diving down the tree and one of the children’s children are considered first before considering all the children.
In DFS, instead of generating all the states below the current level, only the first state below the current level is generated and evaluated recursively. The search continues till a further successor cannot be generated or some cut of point is reached (if any). Then it goes back to the parent and explores the next successor (called Backtracking). The algorithm is given below.
Figure shows the tree generated by the DFS for the alphabet arrangement problem. The search reached the goal state after evaluating 11 states. Since DFS stores only the states in the current path, it uses much less memory during the search compared to BFS. The probability of arriving at goal state with a fewer number of estimates is higher with DFS compared to BFS. This is because, in BFS, all the states in a level have to be evaluated before states in the lower level are considered. DFS is very efficient when more acceptable solutions exist, so that the search can be terminated once the first acceptable solution is obtained. BFS is advantageous in cases where the tree is very deep. An ideal search mechanism is to combine the advantages of BFS and DFS.
NOTES UNIT-2 ENTREPRENEURIAL PLANNING CLASS-XII SUBJECT- ENTREPRENEURSHIP
There are two ways by which you can see some objects colorful, let's say RED…
What is the formula of Lorentz force q = charge B = Magnetic Fields E…
MCQs on Electrostatic Potential & Capacitance - Chapter 2 - Class 12 CBSELove to Learn…
A. Which out of the following are conductors Metal Human Body Animal Bodies Earth All…
MCQs with answer explanation on - Solutions Chapter -2 Class 12 Prepared by Experts MCQ…