除了基于Alpha-Beta算法的博弈树并行搜索算法外,还有其他的博弈树搜索算法.现简要介绍如下.
Alpha-Beta算法是一种基于Min-Max方法的固定深度(fixed-depth)搜索算法.说它是固定深度的搜索算法,是因为对每个结点,它依序从左到右搜索其所有子结点.与Alpha-Beta算法相同的是,SSS*算法[19](或者其对称算法DUAL*)也基于Min-Max方法,但与前者不同的是,它使用最佳优先(best-first)策略.即,SSS*算法不以结点在博弈树中所处的位置为标准,而按照它们前途有望的(promising)程度,由高至低搜素结点.
为了实现最佳优先策略,算法维护一个OPEN队列(OPEN list).OPEN队列的每项对应着一个结点,用
1. 将
2. 将OPEN队列中h最大的p =
3. 如果n = root且s = SOLVED 那么p就是目标状态,此时h就是博弈树的最大最小值,否则继续.
4. 通过执行状态空间操作Г,扩充p状态,将所有的输出状态Г(p)按序插入OPEN队列中.如果可能,清除OPEN队列中的多于状态.
5. 跳转到2.
操作Г的情况 |
输入状态 |
操作Г产生的新的状态 |
不操作 |
s = SOLVED n = ROOT |
达到最终状态,算法退出,博弈值为h |
1 |
s = SOLVED n ≠ ROOT type(n) = MIN |
将 |
2 |
s = SOLVED n ≠ ROOT type(n) = MAX next(n) = NIL |
将 |
3 |
s = SOLVED n ≠ ROOT type(n) = MAX next(n) = NIL |
将 |
4 |
s = LIVE first(n) = NIL |
将 |
5 |
s = LIVE first(n) ≠ NIL type(first(n)) = MAX |
将 |
6 |
s = LIVE first(n) ≠ NIL type(first(n)) = MIN |
将n修改为first(n) 执行下列操作,直到n = NIL 1. 将 2. 将n修改为next(n) |
Stockman证明了SSS*算法在某种意义上比Alpha-Beta算法好:它绝不会比Alpha-Beta搜索更多的叶结点.当两个算法搜索同一个良序的博弈树时,它们搜索的叶结点相同,但是平均来看,SSS*算法搜搜的叶结点数比Alpha-Beta算法少.虽然如此,SSS*算法存在着一些问题阻碍了它的实用性:
1. 算法太过复杂,使人难以理解.
2. OPEN队列占用的空间太大,其大小随着博弈树深度的增加而指数增长.
3. 为了维护OPEN队列的有序性,其插入和删除操作花费的时间开销很大.
在基本SSS*算法的基础上,许多改进算法也提出来,例如MT-SSS*算法[10].并行的SSS*算法也被提出来,例如HYBRID算法[21],PARSSS*算法[22]等.这里不做介绍.
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.