In this section we would examine four common search techniques in AI and their algorithms. We would consider the efficiency of each search technique in terms of how fast it arrives at a solution as well as how optimal the solution it. Then we would write a program to implement the algorithms in Java.The four of them are:
1. Depth-First Search
2.. Breadth-First Search
3. Hill-Climbing
4. Least-Cost
Let's begin with the first one.
Depth-First Search: This search algorithm explores all possible path all the way to its conclusion before it takes another path.
Breadth-First Search: This can be considered the opposite of the depth-first technique. Here, the algorithm traverses all nodes on the same level before moving to another level.
Hill-Climbing: This can be considered an improvement over the depth-first search. After a particular level, it chooses as the next step, the node that tends to place it in the closer to the key or goal node.
Least-Cost Search Technique: This technique takes the part of the minimum effort and can be considered the opposite of the Hill-Climbing algorithm |