Informed Search
Informed Search
Informed search strategy is one that uses problem-specific knowledge beyond the
definition of the problem itself.
It can find solutions more efficiently than uninformed strategy.
The hints come in the form of a heuristic function, denoted h(n).
Where, h(n) = estimated cost of the cheapest path from the state at node n to a goal state.
For example, in route-finding problems, we can estimate the distance from the current
state to a goal by computing the straight-line distance on the map between the two
points
2.1 Best-first search
Best-first search is an instance of general TREE-SEARCH or GRAPH-SEARCH
algorithm in which a node is selected for expansion based on an evaluation function
f(n).
The node with lowest evaluation is selected for expansion,because the evaluation
measures the distance to the goal.
This can be implemented using a priority-queue,a data structure that will maintain the
fringe in ascending order of f-values.
Heuristic functions
A heuristic function or simply a heuristic is a function that ranks alternatives in
various search algorithms at each branching step basing on an available information in
order to make a decision which branch is to be followed during a search.
The key component of Best-first search algorithm is a heuristic function,denoted by
h(n):
h(n) = extimated cost of the cheapest path from node n to a goal node.
For example,in Romania,one might estimate the cost of the cheapest path from Arad
to Bucharest via a straight-line distance from Arad to Bucharest(Figure 2.1).
Heuristic function are the most common form in which additional knowledge is
imparted to the search algorithm.
2.1.2 Greedy Best-first search
Greedy best-first search tries to expand the node that is closest to the goal,on the
grounds that this is likely to a solution quickly.
It evaluates the nodes by using the heuristic function f(n) = h(n).
Taking the example of Route-finding problems in Romania , the goal is to reach
Bucharest starting from the city Arad.
We need to know the straight-line distances to Bucharest from various cities as shown
in Figure 2.1. For example, the initial state is In(Arad) ,and the straight line distance
heuristic 𝒉𝑺𝑳𝑫 (In(Arad)) is found to be 366.
Using the straight-line distance heuristic 𝒉𝑺𝑳𝑫 ,the goal state can be reached
faster.
Figure 2.2 shows the progress of greedy best-first search using ℎ𝑆𝐿𝐷 to find a path from Arad
to Bucharest. The first node to be expanded from Arad will be Sibiu,because it is closer to
Bucharest than either Zerind or Timisoara. The next node to be expanded will be
Fagaras,because it is closest. Fagaras in turn generates Bucharest,which is the goal.
Properties of greedy search
Complete?? No–can get stuck in loops, e.g.,
Complete in finite space with repeated-state checking
Time?? O(bm), but a good heuristic can give dramatic improvement
Space?? O(bm)—keeps all nodes in memory
Optimal?? No
Greedy best-first search is not optimal,and it is incomplete.
The worst-case time and space complexity is 𝑂(𝑏𝑚 ),where m is the maximum depth
of the search space.
2.1.3 A* Search
A* Search is the most widely used form of best-first search. The evaluation function
f(n) is
obtained by combining
i. g(n) = the cost to reach the node,and
ii. h(n) = the cost to get from the node to the goal :
f(n) = g(n) + h(n).