Professional Documents
Culture Documents
AWA - A Window Constrained Anytime Heuristic Search Algorithm
AWA - A Window Constrained Anytime Heuristic Search Algorithm
IJCAI-07
2250
acteristics of the presented algorithm using a uniform search Algorithm 1 Procedure Window A*
tree model. This reveals some very interesting properties of 1: CurLevel ← −1;
the algorithm in terms of heuristic accuracy versus solution 2: if OpenList is empty then
3: Return BestSol;
quality and related search complexity. 4: end if
We also present a bounded optimal version of the AWA* 5: Select node n which has the least f (n)-value node from OpenList;
algorithm, called Bounded Quality Anytime Window A* 6: Insert n into ClosedList;
7: if f (n) ≥ BestSol then
(BQAWA*), which is guaranteed to produce solutions within 8: Return BestSol;
a pre-specified sub-optimality bound, at each iteration. In 9: else if Level(n) ≤ CurLevel − W indowSize then
BQAWA*, the search backtracks and dynamically adjusts the 10: Remove n from ClosedList; Insert n into SuspendList;
11: goto line 2
window size within an iteration, such that the bound restric- 12: else if Level(n) > CurLevel then
tion is adhered to. 13: CurLevel ← Level(n)
14: end if
We demonstrate the efficacy of the presented strategies on 15: if IsGoal(n) then
two optimization problems, namely, the traveling salesman 16: BestSol ← f (n); Goal ← n;
problem (TSP) and the 0/1 knapsack problem. Compara- 17: Return BestSol;
18: end if
tive results with the existing anytime techniques (like DFBB, 19: for Each successor node n of n do
ARA*, Beam-stack search) show considerable improvement 20: Calculate f (n );
21: if n is not in OpenList or ClosedList or SuspendList then
in performance. 22: P arent(n ) ← n; Level(n ) ← Level(n) + 1;
23: Insert n to OpenList;
24: else if n is in OpenList or SuspendList then
2 Anytime Window A* Algorithm 25: if f (n ) < previously calculated path estimation then
26: P arent(n ) ← n; Update f (n ), Level(n );
The algorithm A* considers each node to be equivalent in 27: end if
terms of information content and performs a global compe- 28: else if n is in ClosedList then
29: if f (n ) < previously calculated path estimation then
tition among all the partially explored paths to select a new 30: P arent(n ) ← n; Update f (n ), Level(n );
node. In practice, the heuristic errors are usually distance de- 31: Insert n to OpenList;
32: end if
pendent [Pearl, 1984]. Therefore, the nodes lying in the same 33: end if
locality are expected to have comparable errors, where as the 34: end for
error may vary substantially for nodes which are distant to 35: goto line 2
each other. Thus, if the global competition performed by A*
is localized within some boundaries, tighter pruning can be size is increased in a pre-decided manner (we have used grad-
obtained. Also, as better nodes at a level are generally very ual increment by 1), and Window A* is called again. If the
competitive even within small localities, we can expect good algorithm is terminated through external interrupts, the best
quality solutions with localized expansions. This observation solution obtained thus far is returned.
forms the basis of AWA*, where we localize the node expan-
sions using a sliding window. The AWA* algorithm works in Algorithm 2 Anytime Window A* (AWA*)
two phases, in the inner loop it uses the Window A* (Algo. 1)
1: INPUT :: A search tree/graph and a start node s.
routine with a fixed window size and computes the solution 2: ClosedList ← φ; SuspendList ← φ; W indowSize ← 0; Calculate
under the current restriction. In the outer loop (Algo. 2) the f (s); Level(s) ← 0; Insert s to OpenList; BestSol ← ∞;
3: BestSol ← Window A*(); {Call Window A*}
window restrictions are gradually relaxed to obtain iteratively 4: if SuspendList is empty then
improving solutions. 5: Terminate with BestSol as the Optimal Solution;
The Window A* routine works with a pre-specified win- 6: else
7: Add OpenList to ClosedList; Move SuspendList to OpenList;
dow size. This window size is used to restrict the active queue W indowSize ← W indowSize + 1;
of the A* algorithm. For a given window size ω, the ex- 8: goto line 3
pansions are localized in the following way. When the first 9: end if
IJCAI-07
2251
different trade-offs through anytime terminations, the search the window size is ω,
efforts can increase substantially if re-expansions are not con-
trolled. For AWA* with a consistent heuristic, a node is ex- rg,j,ω = P (f (ng,j ) ≤ M in(Γ)), Γ = min(l + ω, N )
panded at most once within the Window A* routine, and it (2)
can only be re-expanded in a later iteration if its g-value is Next, we use the search tree model to obtain the ex-
lowered. Thus AWA* requires minimal re-expansion. pressions for the expected node expansions and convergence
It may be noted, that in the generalized case AWA* does probability for a given ω. The expected node expansions and
not guarantee a solution at each iteration (Window A* loop). convergence probabilities (for a given window size) are pre-
If this property is a requirement; an easy way to attain this sented in the following lemmas,
is through back-tracking (i.e., by moving the suspended list Lemma 1. Expected number of node expansions EN (ω)
to open list at line 2 of Algo. 1), when no solution is found. (window size = ω) for a m-ary uniform cost search tree T
However, we propose a better method for this in BQAWA* (with depth N ) is given as,
(Sec. 4), which not only provides a solution but guarantees a l=N
bounded quality solution, at each iteration. EN (ω) = l=0 Pg (g, l, ω) + (m − 1)Σi=l i=1 m
l−i
∗ Pn (i, l, ω)
j=l
Where, Pg (g, l, ω) = Πj=0 rg,j,ω , and,
3 Analyzing AWA* using a Search Tree Model Pn (i, l, ω) = Πj=l
j=i qi,j,ω ∗ Πk=0 rg,k,ω
k=i−1
i
g(ng,j ) = j,
i
T1
(7)
N1 h∗ (ng,j ) = N − j
Ti
G
TN Thus, with the chosen error model (Eqn. 5),
f (ni,j ) = N + 2(j − i + 1) − Y (n)(N + j + 2(1 − i))
f (ng,j ) = N − Y (g)(N − j)
Figure 1: Uniform binary tree (model)
(8)
Where Y (n), Y (g) are identically distributed random vari-
model (Fig. 1), we try to quantify the expected node expan-
ables within (0, e) bounds. Combining Eqn. 8 with the earlier
sions and the probability of reaching the optimal goal node,
definitions, we obtain
for a specific window restriction. First we present few termi-
nologies, qi,j,ω = 1 − P (Y (n) ≤ (j + α − M in(Γ))/α)
Definition 1. qi,j,ω : qi,j,ω denotes the expansion probability where, α = N + j + 2(1 − i) and, Γ = min(l + ω, N )
of an ’off-course’ node ni,j when it is in the open list and the (9)
window size is ω, and,
IJCAI-07
2252
function should be non-decreasing with l. Thus, we obtain
(3)
follows, 0
0 2 4 6 8 10
Window Size
M in(l) = max(M in(l − 1),
N (1 − e(1 − s(l)) + l(e + (2 − e)s(l)))) (12) Figure 3: Convergence probability versus window size, for a
where, s(l) is a function of l, 0 ≤ s(l) ≤ 1. uniform binary tree of height 10 for AWA*
The M in(l) function denotes the minimum value of a set of
numbers. From statistics, we know that with the increase of 300
1. Max density heuristic
and 3, we present the curves for expected node expansions 1 1. Max density heuristic
2. Fitting heuristic
and convergence probabilities with different window size, for 0.8
a uniform binary tree of height 10. The expected values are 0.6
computed using two error boundaries (e = 0.5 and e = 1.0), 0.4 (2)
(1)
IJCAI-07
2253
The figures depict that the average node expansions and the (Algo. 4) works with the same principle of ARA* technique,
convergence probabilities with different heuristics show iden- i.e., the algorithm starts with a high initial bound () and iter-
tical trends to that obtained from the analytical model. atively reduces the bound to get improved solutions. It uses
the BQWA* routine (Algo. 3) to obtain intermediate solutions
4 BQAWA* - Anytime Window A* with within the chosen sub-optimality bound. After each iteration,
the suspended list is moved to the open list, weight bound
Provable Quality Bounds is reduced and BQWA* is re-run to get improved solutions.
In AWA*, we have an anytime algorithm which attempts to The algorithm terminates if the suspended list is empty after
produce a stream of gradually improving solutions. However, an iteration.
no bound on the obtained solution is established. In this sec-
tion, we present a modified version of the AWA*, termed as 5 Experimental Results
Bounded Quality Anytime Window A* (BQAWA*), where In this section, we present empirical results comparing the
each solution produced will be bounded within a pre- performance of AWA* with some existing anytime tech-
specified factor () of the optimal solution, the bound is itera- niques (DFBB, ARA* and Beam-stack search). We per-
tively tightened to produce an iteratively improving stream of formed experiments with two optimization problems, namely
solutions. 0/1 Knapsack and Euclidean Traveling Salesman (TSP) prob-
lem. Since time spent is usually proportional with the number
Algorithm 3 Procedure Bounded Quality Window A* of nodes expanded, we present the results in terms of node ex-
1: CurLevel ← −1; MinSus ← ∞; pansions.
2: if OpenList is empty then
3: goto line21
4: end if 226
5: Select node n which has the least f (n)-value node from OpenList; (4)
(3)
6: Insert n into ClosedList; 224 (2)
Average Cost
8: goto line 18 {Update window size and back-track} 222
IJCAI-07
2254
100
Table 1: Average number of node expansions with different
(4)
% Optimal convergence
80 (3)
sub-optimality bounds
(2)
Bounds Knapsack TSP
60 (1)
ARA* BQAWA* ARA* BQAWA*
40 2.0 62 60 61 25
1. DFBB 1.9 73 65 65 37
2. ARA* 1.8 85 68 74 52
20 3. Beam-stack Search
3. AWA* 1.7 98 72 80 67
0 1.6 110 77 92 81
0 500 1000 1500 2000 2500 3000 3500 4000
n (n = nodes expanded x 50)
1.5 127 87 106 91
1.4 152 99 141 111
1.3 178 104 211 135
1.2 222 133. 587 579
Figure 7: Percentage optimal convergence versus node ex- 1.1 332 158 3650 3585
pansions - 0/1 Knapsack problem 1.0 59717 58581 27952 27905
40
1. DFBB
2. ARA*
memory bounded techniques can be adopted in AWA*.
3. Beam-stack Search
39.5
Average tour length
4. AWA*
References
39
[Dean and Boddy, 1988] T. Dean and M. Boddy. An analysis of
38.5
(2) (1) time-dependent planning. In Proceedings of 6th National Confer-
(3) ence on Artificial Intelligence (AAAI 88), pages 49–54, St. Paul,
38
(4) MN, 1988. AAAI Press.
50 100 150 200 250 300 350 400 450 500
n (n = nodes expanded x 100)
[Furcy, 2006] D. Furcy. Itsa*: Iterative tunneling search with a*.
In Proceedings of AAAI Workshop on Heuristic Search, Memory-
Based Heuristics and Their Applications, pages 21–26, 2006.
Figure 8: Average tour length versus node expansions - Eu- [Hansen et al., 1997] E. A. Hansen, S. Zilberstein, and V. A.
clidean TSP Danilchenko. Anytime heuristic search: First results. Techni-
cal Report 50, Univ. of Massachusetts, 1997.
100 (4) (3) [Kitamura et al., 1998] Y. Kitamura, M. Yokoo, T. Miyaji, and
(2) S. Tatsumi. Multi-state commitment search. In Proceedings of
% Optimal convergence
80
(1) 10th IEEE International Conference on Tools with Artificial In-
60 telligence, pages 431–439, 1998.
40 [Kumar et al., 1995] A. Kumar, A. Kumar, and M. Balakrishnan.
1. DFBB
2. ARA*
3. Beam-stack Search
Heuristic search based approach to scheduling, allocation and
20
4. AWA* binding in data path synthesis. In Proceedings of 8th Interna-
0 tional Conference on VLSI Design, pages 75–80, 1995.
0 50 100 150 200 250 300 350 400 450 500
n (n = nodes expanded x 100) [Likhachev et al., 2004] M. Likhachev, G. J. Gordon, and S. Thrun.
Ara*: Anytime A* with provable bounds on sub-optimality. In
Advances in Neural Information Processing Systems 16. MIT
Figure 9: Percentage optimal convergence versus node ex- Press, Cambridge, MA, 2004.
pansions - Euclidean TSP [Pearl, 1984] J. Pearl. Heuristics: intelligent search strategies for
computer problem solving. Addison-Wesley Longman Publish-
bounds, average node expansions required by BQAWA* is ing Co., Inc., Boston, MA, USA, 1984.
less than that required by ARA*, reiterating the superiority [Pohl, 1970] I. Pohl. Heuristic search viewed as path finding in a
of the window based restrictions. graph. Artif. Intell., 1(3):193–204, 1970.
From the results presented, we can conclude that the AWA* [Sarkar et al., 1991] U. K. Sarkar, P. P. Chakrabarti, S. Ghose, and
algorithm provides considerably better quality-time trade-off S. C. De Sarkar. Multiple stack branch and bound. Inf. Process.
than DFBB, ARA* or Beam-stack search. Intermediate so- Lett., 37(1):43–48, 1991.
lution qualities are better and faster optimal convergence is [Zhang, 1998] W. Zhang. Complete anytime beam search. In Pro-
achieved. ceedings of 14th National Conference of Artificial Intelligence
AAAI’98, pages 425–430. AAAI Press, 1998.
6 Conclusions [Zhou and Hansen, 2002] R. Zhou and E. A. Hansen. Multiple se-
quence alignment using anytime a*. In Proceedings of 18th Na-
In this paper, we proposed an anytime algorithm AWA*, tional Conference on Artificial Intelligence AAAI’2002, pages
which localizes the global competition performed by A* us- 975–976, 2002.
ing a sliding window. Experiments performed with 0/1 Knap- [Zhou and Hansen, 2005] R. Zhou and E. A. Hansen. Beam-stack
sack and TSP demonstrate the efficacy of AWA* over some search: Integrating backtracking with beam search. In Proceed-
existing anytime techniques. It may be noted, that AWA*, in ings of the 15th International Conference on Automated Planning
its current form, is not designed to work under memory re- and Scheduling (ICAPS-05), pages 90–98, Monterey, CA, 2005.
strictions. It would be interesting to explore how the standard
IJCAI-07
2255