Abstract
As a testbed for the development of artificial intelligence (AI) techniques, Mahjong has become a hot spot in computer game research due its characteristics of imperfect information. An important aspect of the game is the evaluation of the quality of a hand, which significantly influences the decision-making process for players, including discarding tiles, pong, kong, and so on. In this paper, an effective and efficient algorithm is proposed to measure the quality (i.e., deficiency) of a Mahjong hand by introducing a hierarchical branch and bound method. In the proposed approach, an updating knowledge-based octree search method is first developed to explore all possible quasi-decompositions for one hand to ensure the correctness of the result. Meanwhile, an updated knowledge-based evaluation method is designed to calculate the cost of each quasi-decomposition, and a hierarchical branch and bound method is presented to accelerate the efficiency of getting its deficiency by layering the quasi-decompositions according to the number of their tiles. Moreover, the block decomposition is further adopted in the process of finding all quasi-decompositions to enhance its efficiency. Compared to existing methods, the proposed algorithm not only demonstrates computational efficiency but also provides the exact deficiency in all cases. Experimental results on different types of hands show its effectiveness and efficiency.
Similar content being viewed by others
Data availability
The datasets generated during and/or analyzed during the current study are available from the corresponding author on reasonable request.
Notes
In this paper, any sequence of tiles is regarded as a multiset, which allows multiple instances for each of its elements. The usual set operations \(\cup ,\cap ,\setminus \) are also defined for multisets. Here, a multiset, e.g., \(\{B3,B4,B9,D7,D9\}\) is also written as ordered tuples like (B3B4B9)(D7D9).
Suppose S is a sequence which includes k elements. We write S[i] for the \((i+1)\)-th value of S for \(0 \le i \le k-1\), and S[0] is the first element of S, as represented in some programming languages.
Given a tile t, let \(t^+\) and \(t^{++}\) denote the tiles which the number of t increasing one and two respectively, \(t^-\) and \(t^{--}\) denote the tiles which the number of t decreasing one and two respectively.
References
Berliner HJ (1977) Experiences in evaluation with BKG: a program that plays backgammon. Proceedings of the 5th international joint conference on Artificial intelligence - Volume 1
Schaeffer J, Burch N, Bjoernsson Y, Kishimoto A, Mueller M, Lake R, Lu P, Sutphen S (2007) Checkers is solved. Science 317(5844):1518–1522
Wiering MA (2010) Self-play and using an expert to learn to play backgammon with temporal difference learning. J Intell Learn Syst Appl 2(2):57–68
Shannon Claude E (1950) Programming a computer for playing chess. Philosophical Mag 41(314):256–275
Silver David, Schrittwieser Julian, Simonyan Karen, Antonoglou Ioannis, Huang Guez (2017) Mastering the game of go without human knowledge. Nature 550(7676), 354–359
Samuel AL (1959) Some studies in machine learning using the game of checkers. IBM J Res Dev 3(3):211–229
Bowling M, Burch N, Johanson M, Tammelin O (2015) Heads-up limit hold’em poker is solved. Science 347(6218):145–149
Schmid Martin, Lisy Viliam, Burch Neil, Bowling Michael, Moravcik Matej (2017) Deepstack: expert-level artificial intelligence in heads-up no-limit poker. Science 356(6337), 508–513
Brown N, Sandholm T (2018) Superhuman ai for heads-up no-limit poker: Libratus beats top professionals. Science 359(6374):418–424
Mizukami N, Tsuruoka Y (2015) Building a computer Mahjong player based on monte carlo simulation and opponent models. IEEE Conference on Computational Intelligence & Games
Brown N, Sandholm T (2019) Solving imperfect-information games via discounted regret minimization. National Conference on Artificial Intelligence
Holcomb SD, Porter WK, Ault SV, Mao G, Wang J (2018) Overview on deepmind and its AlphaGo zero AI. Proceedings of the 2018 International Conference on Big Data and Education
Heinrich J, Silver D (2016) Deep reinforcement learning from self-play in imperfect-information games. Preprint at https://doi.org/10.48550/arXiv.1603.01121
Yoshimura K, Hochin T, Nomiya H (2016) Searching optimal movements in multi-player games with imperfect information. 2016 IEEE/ACIS 15th international conference on computer and information science (ICIS)
Brown N, Sandholm T (2017) Safe and nested subgame solving for imperfect-information games. Preprint at https://doi.org/10.48550/arXiv.1705.02955
Sandholm T (2018) Depth-limited solving for imperfect-information games. Science 347(6218):122–3
Brown N, Sandholm T (2019) Superhuman ai for multiplayer poker. Science 365(6456):885–890
Zhao E, Yan R, Li J, Li K, Xing J (2022) Alphaholdem: high-performance artificial intelligence for heads-up no-limit texas hold’em from end-to-end reinforcement learning. Proceedings of the AAAI Conference on Artificial Intelligence
Rong J, Qin T, An B (2019) Competitive bridge bidding with deep neural networks. Proceedings of the 18th International Conference on Autonomous Agents and MultiAgent Systems
Jiang Q, Li K, Du B, Chen H, Fang H (2019) Deltadou: expert-level doudizhu AI through self-play. Proceedings of the 28th International Joint Conference on Artificial Intelligence
Li J, Koyamada S, Ye Q, Liu G, Hon HW (2020) Suphx: Mastering Mahjong with deep reinforcement learning. Preprint at https://doi.org/10.48550/arXiv.2003.13590
Kurita M, Hoki K (2021) Method for constructing artificial intelligence player with abstractions to markov decision processes in multiplayer game of mahjong. IEEE Trans Games 13(1):99–110
Sato H, Shirakawa T, Hagihara A, Maeda K (2017) An analysis of play style of advanced mahjong players toward the implementation of strong ai player. Int J Parallel Emergent Distributed Syst 32(2):195–205
Li S, Yan X (2019) Let’s Play Mahjong. Preprint at https://doi.org/10.48550/arXiv.1903.03294
Wang Q, Li Y, Chen X (2020) A Mahjong-strategy based on weighted restarting automata. MLMI: 2020 the 3rd international conference on machine learning and machine intelligence
Yan X, Li Y, Li S (2021) A fast algorithm for computing the deficiency number of a Mahjong hand. Preprint at https://doi.org/10.48550/arXiv.2108.06832
Atsushi W, Masaki H, Hajime M, Kanako K, Yoshiyuki K (2014) Estimating risk of discarded tiles in mahjong using svr. The Special Interest Group Technical Reports of IPSJ, 1–3
Tang Jenn (2014) Designing an anti-swindle mahjong leisure prototype system using rfid and ontology theory. J Netw Comput Appl 39:292–301
Silver D (2017) Technical perspective solving imperfect information games. Commun ACM 60(11):80
Gao S, Okuya F, Kawahara Y, Tsuruoka Y (2019) Building a computer Mahjong player via deep convolutional neural networks. Preprint at https://doi.org/10.48550/arXiv.1906.02146
Wang M, Yan T, Luo M, Huang W (2019) A novel deep residual network-based incomplete information competition strategy for four-players mahjong games. Multimedia Tools Appl 78(16):23443–23467
Ueno M, Hayakawa D, Isahara H (2019) Estimating the purpose of discard in Mahjong to support learning for beginners. Distributed Computing and Artificial Intelligence, 15th International Conference
Cheng Y, Li CK, Li SH (2020) Mathematical aspect of the combinatorial game “Mahjong”. Preprint at https://doi.org/10.48550/arXiv.1707.07345
Zheng Y, Li S (2020) A review of Mahjong AI research. RICAI: 2020 2nd International Conference on Robotics, Intelligent Control and Artificial Intelligence
Wang Q, Zhou Y, Zhu D, Li Y (2022) A new approach to compute deficiency number of mahjong configurations. Entertainment Comput 43:100509
Zhang X, Liu L, Gan C, Yang X (2022) Research on Mahjong game strategy combining hand tiles optimization and situation search. 2022 34th Chinese control and decision conference (CCDC)
Gao S, Li S (2022) Bloody mahjong playing strategy based on the integration of deep learning and xgboost. CAAI Trans Intell Technol 7(1):95–106
Acknowledgements
This work is supported by the National Natural Science Foundation of China No. 11671244 and 12071271. The authors thank Professor Sanjiang Li for numerous discussions on the notions and results presented in the current paper.
Funding
This article was funded by National Natural Science Foundation of China (12071271, 11671244)
Author information
Authors and Affiliations
Corresponding author
Ethics declarations
Conflict of interest
The authors declare that they have no conflict of interest.
Additional information
Publisher's Note
Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.
Rights and permissions
Springer Nature or its licensor (e.g. a society or other partner) holds exclusive rights to this article under a publishing agreement with the author(s) or other rightsholder(s); author self-archiving of the accepted manuscript version of this article is solely governed by the terms of such publishing agreement and applicable law.
About this article
Cite this article
Yan, X., Li, Y. A hierarchical branch and bound algorithm for Mahjong deficiency. Soft Comput 28, 3321–3340 (2024). https://doi.org/10.1007/s00500-023-09437-6
Accepted:
Published:
Issue Date:
DOI: https://doi.org/10.1007/s00500-023-09437-6