Book Image

Hands-On Artificial Intelligence for Search

By : Devangini Patel
Book Image

Hands-On Artificial Intelligence for Search

By: Devangini Patel

Overview of this book

With the emergence of big data and modern technologies, AI has acquired a lot of relevance in many domains. The increase in demand for automation has generated many applications for AI in fields such as robotics, predictive analytics, finance, and more. In this book, you will understand what artificial intelligence is. It explains in detail basic search methods: Depth-First Search (DFS), Breadth-First Search (BFS), and A* Search, which can be used to make intelligent decisions when the initial state, end state, and possible actions are known. Random solutions or greedy solutions can be found for such problems. But these are not optimal in either space or time and efficient approaches in time and space will be explored. We will also understand how to formulate a problem, which involves looking at it and identifying its initial state, goal state, and the actions that are possible in each state. We also need to understand the data structures involved while implementing these search algorithms as they form the basis of search exploration. Finally, we will look into what a heuristic is as this decides the quality of one sub-solution over another and helps you decide which step to take.
Table of Contents (5 chapters)

What is a good heuristic function?

To answer the question, why is a good heuristic function required? We will compare the DFS and BFS methods to the heuristic search approach. In DFS and BFS, the costs of all of the edges are equal to 1, and DFS explores all of the child nodes, whereas BFS explores all of the sibling nodes. In a heuristic search, the costs of the edges are different, and the heuristic search selects the nodes to explore based on heuristic functions.

By using a heuristic function, we can reduce the memory that is used, and we can reach the solution in less time. The next question to be answered is, why is a good heuristic function required? The answer is in order to find the optimal solution. In our A* Search example, we illustrated that by using a better heuristic function, we can find the optimal solution; it is clear that A* explores the least number of nodes...