Informed search algorithms like A* and greedy best-first search, integral to AI, leverage heuristic information for efficient problem-solving. These algorithms, exemplified by their prioritization of promising paths, significantly enhance search efficiency in large spaces.
Despite their advantages, challenges exist, such as A*'s potential memory consumption and the need for well-designed heuristics. Greedy best-first search, while efficient, may face issues like getting stuck in local optima. Understanding the strengths and limitations of these algorithms is crucial for effective problem-solving in diverse scenarios.
An informed search algorithm is a type of search algorithm used in artificial intelligence and computer science to find a solution to a problem more efficiently by utilizing heuristic information or domain-specific knowledge. Unlike uninformed search algorithms, which explore the search space without considering the characteristics of the problem, informed search algorithms make use of additional information to guide the search towards more promising paths. The goal is to improve the efficiency of the search process by making informed decisions about which nodes to explore next.
Common examples of informed search algorithms include A* (A-star) and greedy best-first search, where a heuristic function is employed to estimate the cost or distance to the goal from a given state. Informed search algorithms are particularly useful in situations where the search space is large, and a systematic exploration would be computationally expensive. By incorporating domain-specific knowledge, these algorithms can significantly reduce the time and resources required to find a solution to complex problems.
The informed search algorithm is especially advantageous when dealing with a large search space. Leveraging the concept of heuristic, it is often referred to as Heuristic search. Unlike uninformed search algorithms that explore the search space blindly, informed search algorithms employ heuristic information or domain-specific knowledge to make more informed decisions about which nodes to explore. This approach enhances the efficiency of the search process, guiding it towards more promising paths and reducing the computational burden associated with exhaustive exploration.
Heuristic function: In the context of Informed Search, a heuristic function plays a crucial role in identifying the most promising path towards a goal. This function takes the current state of the agent as its input and provides an estimation of the proximity of the agent to the goal. While the heuristic method may not always yield the optimal solution, it is designed to guarantee finding a good solution within a reasonable time frame. Represented by h(n), the heuristic function calculates the cost of an optimal path between a pair of states, offering a valuable metric for guiding the search algorithm. Importantly, the value of the heuristic function is always positive, reflecting its role in estimating how close a given state is to reaching the ultimate goal.
Admissibility of the heuristic function is given as below:
h(n) <= h*(n)
In the context of Informed Search, where h(n) represents the heuristic cost and h*(n) denotes the estimated cost, it is a requirement that the heuristic cost (h(n)) must be less than or equal to the estimated cost (h*(n)). This condition ensures that the heuristic function provides a valid and reliable estimation for guiding the search algorithm effectively.
Pure heuristic search represents the simplest form of heuristic search algorithms. It expands nodes based on their heuristic value h(n), utilizing two lists: OPEN and CLOSED. Nodes that have already been expanded are placed in the CLOSED list, while nodes yet to be expanded are stored in the OPEN list.
During each iteration, the algorithm expands the node n with the lowest heuristic value, generating all its successors. Subsequently, n is placed in the CLOSED list. This process continues until a goal state is found.
In the realm of informed search, two primary algorithms are noteworthy:
The greedy best-first search algorithm always prioritizes the path that seems most promising at the current moment. Combining elements of both depth-first and breadth-first search algorithms, it relies on the heuristic function to guide its exploration. This algorithm enables the advantages of both strategies, allowing for the selection of the most promising node at each step. In best-first search, node expansion is based on proximity to the goal, with the closest cost estimated by the heuristic function, i.e., (f(n) = g(n)), where (h(n)) represents the estimated cost from node (n) to the goal.
The greedy best-first algorithm is implemented using a priority queue. The steps for this algorithm are as follows:
Consider the following search problem, and let's traverse it using the Greedy Best-First Search algorithm. At each iteration, nodes are expanded using the evaluation function (f(n) = h(n)).
In this search example, we are using two lists which are OPEN and CLOSED Lists. Following are the iterations for traversing the above example.
Expand the nodes of S and put in the CLOSED list:
Hence the final solution path will be: S ----> B -----> F ----> G
Time Complexity: The worst-case time complexity of Greedy Best-First Search is (O(bm)).
Space Complexity: The worst-case space complexity of Greedy Best-First Search is (O(bm)), where m is the maximum depth of the search space.
Completeness: Greedy Best-First Search is also incomplete, even if the given state space is finite.
Optimal: Greedy Best-First Search algorithm is not optimal.
A* search is a widely recognized form of best-first search that incorporates the use of a heuristic function h(n) and the cost to reach the node n from the start state g(n). Combining features of both Uniform Cost Search (UCS) and greedy best-first search, A* efficiently addresses problems by finding the shortest path through the search space. This algorithm, characterized by the sum g(n) + h(n), provides an optimal solution faster by expanding a reduced search tree.
The A* search algorithm utilizes both the heuristic function and the cost to reach a node, allowing the combination of these costs into a fitness number. This fitness number serves as a key factor in guiding the algorithm towards the most promising paths. Similar to UCS, A* uses \(g(n) + h(n)\) as its evaluation function, emphasizing a balanced consideration of both the actual cost and the heuristic estimate.
This approach results in the A* algorithm efficiently exploring the search space, expanding fewer nodes in the process, and ultimately providing an optimal result in a shorter timeframe. The use of heuristic information ensures a more informed search, making A* a powerful and widely applied algorithm in various problem-solving scenarios.
Note: At each point in the search space, only nodes with the lowest value of f(n) are expanded in the A* search algorithm. This strategy ensures that the algorithm consistently prioritizes the most promising paths, facilitating an efficient exploration of the search space. The termination condition for the algorithm is met when the goal node is found.
In this illustrative example, we embark on traversing a given graph employing the A* algorithm. The heuristic values for all states are presented in the table below. To determine the suitability of each state, we calculate the f(n) using the formula f(n) = g(n) + h(n), where g(n) represents the cost to reach any node from the start state.
Throughout this traversal, we make use of OPEN and CLOSEDlists:
We'll use the OPEN and CLOSED lists here.