並行博弈樹搜索算法-第7篇 另闢蹊徑:其他的博弈樹並行搜索算法

除了基於Alpha-Beta算法的博弈樹並行搜索算法外,還有其他的博弈樹搜索算法.現簡要介紹如下.

7.1    SSS*算法及其並行化

Alpha-Beta算法是一種基於Min-Max方法的固定深度(fixed-depth)搜索算法.說它是固定深度的搜索算法,是因爲對每個結點,它依序從左到右搜索其所有子結點.與Alpha-Beta算法相同的是,SSS*算法[19](或者其對稱算法DUAL*)也基於Min-Max方法,但與前者不同的是,它使用最佳優先(best-first)策略.即,SSS*算法不以結點在博弈樹中所處的位置爲標準,而按照它們前途有望的(promising)程度,由高至低搜素結點.

爲了實現最佳優先策略,算法維護一個OPEN隊列(OPEN list).OPEN隊列的每項對應着一個結點,用<n, s,h>的形式組織.其中n代表博弈樹中的一個結點,s是一個狀態標識,可能的取值是LIVE或SOLVED,h被稱爲merit,是一個實數值.一個使用狀態空間搜索(State Space Search)概念描述的SSS*算法如下[20]:

1. 將<n = root, s = LIVE, h = +∞>插入OPEN隊列中.

2. 將OPEN隊列中h最大的p = <n,s, h>取出.由於OPEN隊列是h的非降序列,所以p爲隊列的第一項.

3. 如果n = root且s = SOLVED 那麼p就是目標狀態,此時h就是博弈樹的最大最小值,否則繼續.

4. 通過執行狀態空間操作Г,擴充p狀態,將所有的輸出狀態Г(p)按序插入OPEN隊列中.如果可能,清除OPEN隊列中的多於狀態.

5. 跳轉到2.

操作Г的情況

輸入狀態<n, s, h>滿足條件

操作Г產生的新的狀態

不操作

s = SOLVED

n = ROOT

達到最終狀態,算法退出,博弈值爲h

1

s = SOLVED

n ≠ ROOT

type(n) = MIN

將<m = parent(n), s, h>插入OPEN隊列中,清除OPEN隊列中滿足m是k的祖先的<k, s, h>

2

s = SOLVED

n ≠ ROOT

type(n) = MAX

next(n) = NIL

將<next(n), LIVE, h>插入OPEN隊列中

3

s = SOLVED

n ≠ ROOT

type(n) = MAX

next(n) = NIL

將<parent(n), LIVE, h>插入OPEN隊列中

4

s = LIVE

first(n) = NIL

將<n, SOLVED, min(h, f(n))>插在所有merit值次小的項的前面.其中f(n)是結點n的最大最小值.

5

s = LIVE

first(n) ≠ NIL

type(first(n)) = MAX

將<first(n), s, h)>插在OPEN隊列最前面

6

s = LIVE

first(n) ≠ NIL

type(first(n)) = MIN

將n修改爲first(n)

執行下列操作,直到n = NIL

1. 將<n, s, h>插在OPEN隊列最前面

2. 將n修改爲next(n)

<n,s, h>的狀態空間操作Г

Stockman證明了SSS*算法在某種意義上比Alpha-Beta算法好:它絕不會比Alpha-Beta搜索更多的葉結點.當兩個算法搜索同一個良序的博弈樹時,它們搜索的葉結點相同,但是平均來看,SSS*算法搜搜的葉結點數比Alpha-Beta算法少.雖然如此,SSS*算法存在着一些問題阻礙了它的實用性:

1. 算法太過複雜,使人難以理解.

2. OPEN隊列佔用的空間太大,其大小隨着博弈樹深度的增加而指數增長.

3. 爲了維護OPEN隊列的有序性,其插入和刪除操作花費的時間開銷很大.

在基本SSS*算法的基礎上,許多改進算法也提出來,例如MT-SSS*算法[10].並行的SSS*算法也被提出來,例如HYBRID算法[21],PARSSS*算法[22]等.這裏不做介紹.

7.2   ER算法及其並行化

ER(Evaluate-Refute)算法[23]的基本思想是:在評估完一些強制性的工作(mandatorywork)之後,嘗試駁斥博弈樹中的其他結點.在這一點上它與MWF算法的基本思想有點類似,但是兩者又有本質的不同.

ER算法[24]將結點分爲E結點(e-node)和R結點(r-node).E結點將會被完全地搜索,而R結點將會進行部分搜索,得到估值後嘗試剪除,這個嘗試剪枝的過程稱爲駁斥(refutation).E結點的所有子結點將會被搜索,而R結點只會進行較少的子結點的搜索,少到只有一個子結點被搜索.因此,E結點比R結點開銷大(morecostly).

博弈樹的每個內部結點只有一個子結點是E結點,稱這個結點爲該父結點的E子結點.選擇任意一個子結點作爲E子結點都是允許的,但是爲了性能的優化,選擇結點n的E子結點的方法如下: ER算法搜索結點的長孫結點們(elder grandchildren),將博弈值最大的長孫結點n''的父結點n'作爲n的E子結點.其中,長孫結點即爲n的子結點們各自的第一個子結點(eldest child).當得到了結點n的E結點n'之後,算法首先搜索n'的所有子結點(n''除外,因爲它的博弈值已經得到了).n剩下的子結點則會按序進行駁斥(refute).

在ER算法的並行實現時,長孫結點可以被同時搜索,因爲這些是強制性的工作.又由於這些長孫結點本身又是E結點,所以他們的長孫結點們又也可以遞歸地並行搜索.如果ER算法只在進行強制性的工作時並行完成,那麼E結點的兄弟結點就需要串行地進行駁斥了.但是爲了防止處理器的空閒,ER算法還引入了下面兩個方法提高並行度:

1. 並行駁斥.當E子結點n的E子結點n'已經搜索完成時,那麼n''的兄弟結點可以並行地進行駁斥.

2. 多個E子結點.當E子結點n的E子結點n'已經搜索完成時,在n的子結點中選擇次佳的子結點作爲n的第二個E子結點.如果n'被證明不是n的最佳子結點(即n的其他結點不能被立即駁斥),那麼就用第二個E子結點對其他子結點進行剪枝.

從某種意義上說,ER算法比Alpha-Beta算法的搜索效率低,因爲它可能會錯過一些深的剪枝(deep cutoff).另一方面,在ER算法上使用迭代深入和最小窗口的方法的效果如何,還需要進一步的實驗測試[12].

本文章歡迎轉載,請保留原始博客鏈接http://blog.csdn.net/fsdev/article


--------------------

 [1]    Valavan Manohararajah(2001). Parallel Alpha-Beta Search on SharedMemory Multiprocessors. Master’s thesis, Graduate Department of Electrical andComputer Engineering, University of Toronto, Canada.

 [2]    A. Newell and H.A. Simon (1972). Human Problem Solving.Prentice-Hall, 1972.

 [3]    Stuart Russell and Prter Norvig (1995). Artificial Intelligence, AModern Approach. Prentice-Hall, Egnlewood Cliffs, 1995.

 [4]    Knuth, D.E. and Moore, R.W. (1975). An Analysis of Alpha-Beta Pruning.Artificial Intelligence, 6:293–326.

 [5]    Hopp, Holger and Sanders, Peter (1995). Parallel Game Tree Search onSIMD Machines. IRREGULAR '95: Proceedings of the Second International Workshopon Parallel Algorithms for Irregularly Structured Problems. 349-361.

 [6]    Marsland, T.A. and Campbell, M.S. (1982). Parallel Search ofStrongly Ordered Game Trees. ACM Computing Surveys, Vol. 14, No. 4, pp.533-551. ISSN 0360-0300.

 [7]    Schaeffer J.(1989). The History Heuristic and Alpha-Beta SearchEnhancements in Practice. IEEE Transactions on Pattern Analysis and MachineIntelligence. Vol. PAMI-11, No.11, pp. 1203-1212.

 [8]    Marsland, T.A. (1986). A Review of Game-Tree Pruning. ICCA Journal,Vol. 9, No. 1, pp. 3-19. ISSN 0920-234X.

 [9]    Korf , R.E. (1985). Depth-first Iterative-deepening Search: AnOptimal Admissible Tree Search. Artificial Intelligence, 27(1), 97-109.

[10]    Aske Plaat, Jonathan Schaeffer,Wim Pijls, and Arie de Bruin(1995). Best-First and Depth-First Minimax Searchin Practice. In Proceedings of Computing Science in the Netherlands 1995,Utrecht, the Netherlands, November 27-28, 1995, pages 182-193.

[11]    Brockington, M. G. andSchaeffer, J. (1996). APHID Game-Tree Search. Presented at Advances in ComputerChess 8, Maastricht.

[12]    Brockington, M.G. (1996). ATaxonomy of Parallel Game-Tree Searching Algorithms. ICCA Journal, Vol. 19, No.3, pp. 162-174.

[13]    Baudet G. M.(1978). The Designand Analysis of Algorithms for Asynchronous Multiprocessors. Carnegie MellonUniversity, Pittsburgh, PA, Available as Tech. Rep. CMU-CS-78-116.

[14]    Akl, S.G., Barnard, D.T. andDoran, R.J.(1982). Design Analysis and Implementation of a Parallel Tree SearchAlgorithm. IEEE Transactions on Pattern Analysis and Machine Intelligence, Vol.PAMI-4, No.2, pp. 192-203.

[15]    Feldmann, R., Mysliwietz, P.and Monien. B (1993). Game Tree Search on a Massively Parallel System. InAdvances in Computer Chess 7, 1993. (The conference was held in June1993, butthe proceedings have not published as of August 1993.)

[16]    Kuszmaul, B.C. (1994).Synchronized MIMD Computing. Ph.D thesis, Massachusetts Institute ofTechnology, Cambridge MA.

[17]    NewBorn M.(1988). UnsynchronizedIteratively Deepening Parallel Alpha-Beta Search. IEEE Transactions on PatternAnalysis and Machine Intelligence, Vol. PAMI-10, No.5, pp. 687-694.

[18]    Weill, J-C. (1996). The ABDADADistributed Minimax-Search Algorithm. ICCA Journal, Vol.19, No.1, pp. 3-16.

[19]    Mark Brockington and JonathanSchaeffer(1996). The APHID Parallel Alpha-Beta Search Algorithm , Eighth IEEESymposium on Parallel and Distributed Processing, pp. 432-436.

[20]    Stockman, G. C. (1979). AMinimax Algorithm Better than Alpha-Beta? Artifcial Intelligence, Vol. 12, pp.179-196.

[21]    Aske Plaat, Jonathan Schaeffer,Wim Pijls, and Arie de Bruin (1994). SSS* = Alpha-Beta + TT. Technical Report94-17, Department of Computing Science, University of Alberta, December 1994.

[22]    Leifker, D. B. and Kanal, L.N.(1985). A Hybrid SSS*/Alpha-Beta Algorithm for Parallel Search of Game Trees.In Proceedings of IJCAI-85, pp. 1044-1046.

[23]    Subir Bhattacharya and A.Bagchi (1989).Searching game trees in parallel using SSS*. Proc IJCAI-89,International Joint Conf on Artificial Intelligence, Detroit, USA, Aug 1989, pp42-47.

[24]    Steinberg, I. R. and Solomon,M. (1990). Searching Game Trees in Parallel. In Proccedings of the 1990International Conference on Parallel Processing (vol.3), pp. 9-17, UniversityPark, PA. Penn. State University Press.

[25]    Jaleh Rezaie and RaphaelFinkel(1992). A comparison of some parallel game-tree search algorithms.Technical report, University of Kentucky, Department of Computer Science,Lexington, USA.

[26]    Karp, R. M. and Zhang, Yanjun.(1989). On Parallel Evaluation of Game Trees. In Proceedings of SPAA '89, pp.409-420, New York, NY. ACM Press.

[27]    Richard M. Karp , Yangun Zhang(1998). On parallel evaluation of game trees, Journal of the ACM (JACM), v.45n.6, p.1050-1075, Nov.

[28]    PKU JudgeOnline, Problem 1085,Triangle War. http://acm.pku.edu.cn/JudgeOnline/problem?id=1085.


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章