0% found this document useful (0 votes)
15 views7 pages

Informed Search

Uploaded by

Akshana Arash
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
15 views7 pages

Informed Search

Uploaded by

Akshana Arash
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 7

Informed (Heuristic) Search Strategies

 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).

 A* Search is both optimal and complete. A* is optimal if h(n) is an admissible


heuristic. The obvious example of admissible heuristic is the straight-line distance
ℎ𝑆𝐿𝐷 . It cannot be an overestimate.
 A* Search is optimal if h(n) is an admissible heuristic – that is,provided that h(n)
never overestimates the cost to reach the goal.
 An obvious example of an admissible heuristic is the straight-line distance ℎ𝑆𝐿𝐷 that
we used in getting to Bucharest. The progress of an A* tree search for Bucharest is
shown in Figure 2.2.
 The values of ‘g ‘ are computed from the step costs shown in the Romania map
( figure 2.1). Also the values of ℎ𝑆𝐿𝐷 are given in Figure 2.1.
 A* search is complete.
 Whether A* is cost-optimal depends on certain properties of the heuristic.
 A key property is admissibility: an admissible heuristic is one that never
overestimates the cost to reach a goal.
 A slightly stronger property is called consistency. A heuristic is consistent if, for
every node and every successor of generated by an action we have:
𝒉(𝒏) ≤ 𝒄(𝒏, 𝒂, 𝒏 ′ ) + 𝒉(𝒏 ′ ).
 This is a form of the triangle inequality, which stipulates that a side of a triangle
cannot be longer than the sum of the other two sides (see Figure 3.19 ). An example
of a consistent heuristic is the straight-line distance that we used in getting to
Bucharest.
2.1.4 Memory-bounded search
 The main issue with A* is its use of memory.
 Memory is split between the frontier and the reached states.
 In our implementation of best-first search, a state that is on the frontier is stored in
two places: as a node in the frontier (so we can decide what to expand next) and as an
entry in the table of reached states (so we know if we have visited the state before).
 We can keep reference counts of the number of times a state has been reached, and
remove it from the reached table when there are no more ways to reach the state.
 Beam search limits the size of the frontier. The easiest approach is to keep only the
nodes with the best -scores, discarding any other expanded nodes.
 This makes the search incomplete and suboptimal, but we can choose to make good
use of available memory, and the algorithm executes fast because it expands fewer
nodes.
2.1.4.1 Iterative-deepening A* search
 (IDA*) is to A* what iterative-deepening search is to depth first: IDA* gives us the
benefits of A* without the requirement to keep all reached states in memory, at a cost
of visiting some states multiple times.
 It is a very important and commonly used algorithm for problems that do not fit in
memory.
 In standard iterative deepening the cutoff is the depth, which is increased by one each
iteration. In IDA* the cutoff is the 𝒇-cost (𝒈 + 𝒉 ); at each iteration, the cutoff
value is the smallest 𝒇-cost of any node that exceeded the cutoff on the previous
iteration
2.1.4.2 Recursive Best-first Search(RBFS)
 Recursive best-first search is a simple recursive algorithm that attempts to mimic the
operation of standard best-first search,but using only linear space. The algorithm is
shown in figure 2.4.
 Its structure is similar to that of recursive depth-first search,but rather than continuing
indefinitely down the current path,it keeps track of the f-value of the best
alternative path available from any ancestor of the current node.
 If the current node exceeds this limit,the recursion unwinds back to the
alternative path. As the recursion unwinds,RBFS replaces the f-value of each
node along the pathwith the best f-value of its children.
Figure 2.5 shows how RBFS reaches Bucharest.
 RBFS is optimal if the heuristic function is admissible. Its space complexity is
linear in the depth of the deepest optimal solution, but its time complexity is rather
difficult to characterize: it depends both on the accuracy of the heuristic function and
on how often the best path changes as nodes are expanded. It expands nodes in order
of increasing -score, even if is nonmonotonic.
 IDA* and RBFS suffer from using too little memory. Between iterations, IDA*
retains only a single number: the current -cost limit.
 RBFS retains more information in memory, but it uses only linear space: even if
more memory were available, RBFS has no way to make use of it.
 Because they forget most of what they have done, both algorithms may end up
reexploring the same states many times over
 To determine how much memory we have available, and allow an algorithm to use all
of it. Two algorithms that do this are MA* (memory-bounded A*) and SMA*
(simplified MA*).
2.1.4.3 SMA*
 SMA* proceeds just like A*, expanding the best leaf until memory is full.
 At this point, it cannot add a new node to the search tree without dropping an old one.
 SMA* always drops the worst leaf node—the one with the highest -value.
 Like RBFS, SMA* then backs up the value of the forgotten node to its parent.
 In this way, the ancestor of a forgotten subtree knows the quality of the best path in
that subtree.
 With this information, SMA* regenerates the subtree only when all other paths have
been shown to look worse than the path it has forgotten.
 Another way of saying this is that if all the descendants of a node are forgotten, then
we will not know which way to go from n but we will still have an idea of how
worthwhile it is to go anywhere from n.

You might also like