Design and improvement of the pruning algorithm of the Chinese chess in the computer games

The Journal of EngineeringVolume 2020, Issue 13 p. 426-428 The 3rd Asian Conference on Artificial Intelligence Technology (ACAIT 2019)Open Access Design and improvement of the pruning algorithm of the Chinese chess in the computer games Jun Tao, Corresponding Author Jun Tao martintao2006@163.com School of Mathematics and Computer Science, Jianghan University, Wuhan, 430056 People's Republic of China Department of Electrical & Computer Engineering, Rowan University, Glassboro, New Jersey, 08028 USASearch for more papers by this authorGui Wu, Gui Wu Educational Administration Office, Jianghan University, Wuhan, 430056 People's Republic of ChinaSearch for more papers by this authorXueliang Pan, Xueliang Pan Graduate School, Jianghan University, Wuhan, 430056 People's Republic of ChinaSearch for more papers by this author Jun Tao, Corresponding Author Jun Tao martintao2006@163.com School of Mathematics and Computer Science, Jianghan University, Wuhan, 430056 People's Republic of China Department of Electrical & Computer Engineering, Rowan University, Glassboro, New Jersey, 08028 USASearch for more papers by this authorGui Wu, Gui Wu Educational Administration Office, Jianghan University, Wuhan, 430056 People's Republic of ChinaSearch for more papers by this authorXueliang Pan, Xueliang Pan Graduate School, Jianghan University, Wuhan, 430056 People's Republic of ChinaSearch for more papers by this author First published: 12 May 2020 https://doi.org/10.1049/joe.2019.1169AboutSectionsPDF ToolsRequest permissionExport citationAdd to favoritesTrack citation ShareShare Give accessShare full text accessShare full-text accessPlease review our Terms and Conditions of Use and check box below to share full-text version of article.I have read and accept the Wiley Online Library Terms and Conditions of UseShareable LinkUse the link below to share a full-text version of this article with your friends and colleagues. Learn more.Copy URL Share a linkShare onFacebookTwitterLinkedInRedditWechat Abstract Computer games have always been considered to be the most challenging task in the field of artificial intelligence specially the Chinese chess as an example. The core technology of the computer games is the search. This work is studied to research an improved pruning strategy in order to achieve a deeper level search of the game tree in a limited time. On the basis of the traditional alpha–beta search algorithm, the worthless nodes are discarded to be never searched by introducing the deep iterative, history table and other auxiliary methods of pruning. The number of nodes searched is effectively reduced to make the pruning earlier to shorten the search time. At the same time, its search depth is higher than the original search algorithm. The advanced and modified algorithm is proved to be practical and applicative by experimentations and tests of computer games system provided in this study. 1 Introduction The computer game is considered as the most challenging work in the field of artificial intelligence. The computer game problems exist in many research fields in the reality world. As long as there is the existence of a conflict of interest of both parties in the board, the game has become a way of solving conflicts and performance. Chinese chess is a game full of knowledge, which means both participants are fully aware at any time if there is one piece and where it is located [1-16]. As thousands of years of history of chess game, the Chinese chess is difference from the chess in the rules on large and it is into a single one. Its complexity is much higher than chess. At present, the Chinese chess game algorithm is less researched in the field of computer games. In this paper, through summarising research results of computer games based on the domestic and international reference about China chess, and studying on the chess game algorithm of chess experience, Chinese traditional alpha–beta search algorithm is used to analyse and investigate whether game-pruning strategy to improve efficiency in the search depth and node selection. A complete software implementation theory of Chinese chess game is designed through deduction and design. The software has a certain independent ability, and can be deployed on the PC machine, and through the procedures against experiment, verify the pruning strategy can effectively improve the efficiency of the algorithm of game. The paper first introduces the basic theory of alpha–beta search algorithm and its common functions in the field of chess games. Then, the paper proposes a kind of improved method for solving the current questions of the traditional alpha–beta search algorithm in the Chinese chess games. Third, a lot of experiments are achieved to analyse and compare from the different algorithms and to prove the improved algorithms effectively and application. Finally, the paper makes an active conclusion for the pruning algorithms of the Chinese chess in the computer games. 2 Alpha–beta search algorithm In the researching field of computer games, the alpha- and beta-pruning algorithms are the most famous optimisation methods and improvement measures. It is very common situation that is often encountered when the search engine is searching in the all kinds of computer games. The alpha-pruning algorithm and beta-pruning algorithm are clearly shown in Figs. 1 and 2, respectively.. Fig. 1Open in figure viewerPowerPoint Alpha pruning Fig. 2Open in figure viewerPowerPoint Beta pruning The alpha–beta pruning searching algorithm is based on joining the pruning strategy together in the searching field of algorithm. It can reduce quickly the number of the games searching tree nodes and greatly improve the efficiency of searching. Therefore the alpha–beta algorithm can match greatly the valuation functions to look for the maximum static valuation in the complete information conditions. After the experiments are applied in the search engine, the optimisation and improvement of the alpha–beta pruning searching algorithm is very obvious clearly and exactly. 3 Improved strategy The alpha–beta pruning algorithm is the basic technology of game tree search, so it has been widely used currently. However, the limitations of the alpha–beta pruning have its inherent, which is searching all nodes and then obtains the best insurance game tree node path. At the same time, the span unchanged is positively related to the search depth and path optimisation. Thus, the higher is the algorithms optimise in the level, the higher is the cost of time inevitably. In any usual chess case, there are ∼40 kinds of Chinese chess moves. If both sides of players deduce the following moves at this point, the number of generated nodes is based on 40. 3.1 Deep iterative The iterative deepening is a process of continuous refinement, every step of the search time is specified, in a fixed period of time, to search a layer of the same layer, traversing all nodes, after entering the next layer is to search as much as possible to increase the search depth within a fixed period of time. In the chess game, the different stages of the situation, the possibility of the corresponding law numbers vary greatly, the time difference corresponding to different stages of the same depth search cost is also great. A chess game in the same time, the situation later can search eight to nine layers of game tree branches, if fewer pieces can even search to dozens of layers, and the middle game can only search to 5– 6. If we consider from the angle of time, human beings have the same deal with the same situation in the previous step takes longer, shorter time of late. To sum up, the key to the realisation of the iterative deepening is the preservation of useful information in the time control and iterative process. Program implementation, the need to establish the timing function in the start, set the time of the each iteration, before the start of the iteration of the original information in the history table. The iteration began after the timer function as the timer start time. If the timer does not arrive at the time of iteration, then the next iteration will continue. If the timer has exceeded the set time, then stop the iteration and return the result. 3.2 History table For alpha–beta pruning algorithm, the efficiency of it entirely depends on the order of the node. Therefore, adjusting to a way to arrange order is the key to improve the efficiency of pruning. An excellent way needs to satisfy two conditions: one is to produce by its node caused a pruning; another one is not to trigger a pruning but his brother games of superlatives. In the process of the search, it will add on a score of the history of the situation for the every time to find a good way. The moves that are searched several times and identified as an outstanding historical record will be better and higher. When the system is searching the intermediate nodes, the pieces will move according to the history score sequence to obtain the better order (Fig. 3). Fig. 3Open in figure viewerPowerPoint Game search tree 3.3 Replacement table When the search depth is higher, there will be a different branch node completely the same, namely although move later order, but in the end, the situation is exactly the same. At the same time, the valuation of these situations will eventually consistent. The repeat of the search for these same situations wastes a large part of the time, so a maintenance table is considered. The valuations have been searched before all are recorded into the table in advance. Whenever a new node is searched up, the first step is to look up the table to find if there are the records about this situation. If yes, the situation in the table can be used directly. The method is called the replacement table, which can improve efficiency greatly. For the data structure of the replacement table, it is generally used the Hash table in the programming. Define an array, each is corresponding to a situation in which the only position. In this way, the situations will be recorded in and out of speed to the random read and write speed. 4 Experimental data and results With the increase of search depth, the improved algorithm has some comprehensive advantages over other algorithms, and its pruning effect is very prominent from the digital point of view. The experiments as following are shown the relationship between the depth of the search and the search time to prove the effect and application of the improved algorithms in the Chinese chess game of the computer games (Table 1). Table 1. Search algorithm Level no. Nodes no. Time, s 1 45 <1 2 201 <1 3 2339 <1 4 6154 <1 5 200,169 <1 6 809,954 =3 7 10,269,290 =34 8 249,823,553 >300 The search algorithm in the game, the number of nodes in the fifth layer is 21,298 and the time is 123 s. The advanced search algorithm in the game, the searching number of nodes in the fifth layer is 1019 and the time is <1 s. After the optimisation, the efficiency of the system is significantly higher than the efficiency of the old search algorithm. At the same situation, the advanced search algorithm is more effective and faster as shown in Table 2. Table 2. Advanced search algorithm Level no. Nodes no. Time, second 1 45 <1 2 201 <1 3 744 <1 4 4260 <1 5 14,298 <1 6 51,119 =2 7 268,775 =4 8 555,078 =9 After >30 games of chess testing the advanced against the normal, it is found that the advanced algorithm of chess game was significantly higher than that of the normal system regardless of which side of the first hand in the computer games. 5 Conclusion The current study about the pruning strategy in the computer games is mainly referred to the decomposition of the game search tree. This approach does have a big problem. The big bottleneck makes a bit of improvement difficult and the practical effect insignificant in the systems. In order to achieve a deeper level of game tree search in finite time, pruning algorithm abandon a lot of non-value node search, at the same time for the alpha–beta algorithm, using the auxiliary means of pruning method and iterative deepening introduced the history table pruning earlier occurrence, reduces the response time of the procedure. Experimental results show that this improved algorithm search strategy pruning efficiency has been significantly improved. In the paper, the improved search depth is higher than the original search algorithm. The advanced and modified algorithm is proved to be practical and applicative by experimentations and tests of computer games system provided in this paper. In the future, the improved method proposed in the paper will be calculated by the parallel computing. The current study about the parallel computing in the computer games is mainly referred to the parallel decomposition of the game search tree. The parallel computing in the computer games puts focus on the parallel complex computing function, which could be able to obtain the good and obvious practical effect. 6 References 1Shi-Jim Y., Jung-Kuei Y., Kuo-Yuan K. et al.: ‘Bitboard knowledge base system and elegant search architectures of connect6’, Knowl.-Based Syst., 2012, 34, (special issue), pp. 43 – 54 2Tao J., Wu G.: ‘Design and application of computer games online system in Connect5’. The Proc. of the 28th Chinese Control and Decision Conf., Yinchuan, China, 2016, pp. 4018 – 4022 3I-Chen W., Hung-Hsuan L., Ping-Hung L. et al.: ‘Job-level proof-number search for Connect6’, Comput. Games, 2011, 6515, pp. 11 – 22 4Tao J.: ‘3D modeling of small object based on the projector-camera system’, Kybernetes, 2012, 41, (9), pp. 1269 – 1276 5Shi-Jim Y., Jung-Kuei Y.: ‘Two-stage Monte Carlo tree search for Connect6’, IEEE Trans. Comput. Intell. Ai In Games, 2011, 3, (2), pp. 100 – 118 6I-Chen W., Ping-Hung L.: ‘Relevance-zone-oriented proof search for Connect6’, IEEE Trans. Comput. Intell. AI Games, 2010, 2, (3), pp. 191 – 207 7Tao J.: ‘Development and application of functionally gradient materials’. Int. Conf. on Industrial Control and Electronics Engineering, Xi'an, China, 2012, pp. 1022 – 1025 8Zhihua Q., Ming Y., Zijuan W.: ‘Technologies analysis of Connect6 computer game’. Achievements in Engineering Materials, Energy, Management and Control Based on Information Technology, Beijing, China, 2011, pp. 679 – 682 9Chang-Ming X., Ma Z.M., Jun-Jie T. et al.: ‘Enhancements of proof number search in Connect6’. Proc. 21st Chinese Control and Decision Conf., Guilin, China, 2009, vol. 1–6, pp. 4525 – 4529 10Tao J.: ‘Design and visualization of optical feedback laser based on computer vision’. Int. Conf. on Industrial Control and Electronics Engineering, Xi'an, China, 2012, pp. 1030 – 1032 11Yi-Shan L., I-Chen W., Shi-Jim Y.: ‘TAAI 2011 computer-game tournaments’, ICGA J., 2011, 34, (4), pp. 248 – 250 12Kazuki Y., Akihiro K., Martin M.: ‘Lambda depth-first proof number search and its application to go’. 20th Int. Joint Conf. on Artificial Intelligence, Hyderabad, India, 2007, pp. 2404 – 2409 13Tao J.: ‘Face reconstruction based on camera-projector system’. Int. Conf. on Industrial Control and Electronics Engineering, Xi'an, China, 2012, pp. 1026 – 1029 14Jun-Jie T., Chang-Ming X., Han K.: ‘Construction of opening book in Connect6 with its application’. Proc. 21st Chinese Control and Decision Conf., 2009, vols 1–6, pp. 4530 – 4534 15Wu I.C., Hung-Hsuan L., Der-Johng S.: ‘Job-level proof number search’, IEEE Trans. Comput. Intell. AI in Games, 2013, 5, (1), pp. 44 – 56 16Jahn-Takeshi S., Winands Mark H.M., van den Herik H.J.: ‘Randomized parallel proof-number search’, Adv. Comput. Games, 2010, 6048, pp. 75 – 87 Volume2020, Issue13July 2020Pages 426-428 FiguresReferencesRelatedInformation