Depth-First search
The Depth-First search explores each possible path to find the path’s conclusion or the goal. If the path does not contain the goal the search tries another path by backtracking. The following image shows the path the search takes when trying to find the goal ‘f’:
As you can see, the search almost had to check every node in order to find the answer, but it did find the right answer. This search is very reliable but sometimes can take a long time or even turn into an exhaustive search (a search that looks a every point until it reaches the goal). The Depth-First search can also be modified to go from the right to the left.
Advantages:
• Always finds the goal
Disadvantages:
• Often can be slow
• Can result in an exhaustive search
• Can get stuck in long paths that don’t the goal
Posted in Computer Science, Information Technology, Artificial Intelligence, Artificial Intelligence |
