Computing and Predicting Winning Hands in the Trick-Taking Game of Klaverjas
This paper deals with the trick-taking game of Klaverjas, in which two teams of two players aim to gather as many high valued cards for their team as possible. We propose an efficient encoding to enumerate possible configurations of the game, such that subsequently \(\alpha \beta \)-search can be employed to effectively determine whether a given hand of cards is winning. To avoid having to apply the exact approach to all possible game configurations, we introduce a partitioning of hands into \(981,\!541\) equivalence classes. In addition, we devise a machine learning approach that, based on a combination of simple features is able to predict with high accuracy whether a hand is winning. This approach essentially mimics humans, who typically decide whether or not to play a dealt hand based on various simple counts of high ranking cards in their hand. By comparing the results of the exact algorithm and the machine learning approach we are able to characterize precisely which instances are difficult to solve for an algorithm, but easy to decide for a human. Results on almost one million game instances show that the exact approach typically solves a game within minutes, whereas a relatively small number of instances require up to several days, traversing a space of several billion game states. Interestingly, it is precisely those instances that are always correctly classified by the machine learning approach. This suggests that a hybrid approach combining both machine learning and exact search may be the solution to a perfect real-time artificial Klaverjas agent.
KeywordsTrick-taking card games Alpha-beta search Computational complexity Machine learning AI
The second author was supported by funding from the European Research Council (ERC) under the EU Horizon 2020 research and innovation programme (grant agreement 638946). We thank F.F. Bodrij and A.M. Stawska for assistance with qualitative real-world validation of a relevant feature subset.
- 2.Bonnet, É., Jamain, F., Saffidine, A.: On the complexity of trick-taking card games. In: IJCAI, pp. 482–488 (2013)Google Scholar
- 5.Buro, M., Long, J.R., Furtak, T., Sturtevant, N.R.: Improving state evaluation, inference, and search in trick-based card games. In: IJCAI, pp. 1407–1413 (2009)Google Scholar
- 8.Hearn, R.A.: Games, puzzles, and computation. Ph.D. thesis, Massachusetts Institute of Technology (2006)Google Scholar
- 14.Long, J.R., Buro, M.: Real-Time opponent modeling in trick-taking card games. In: IJCAI, vol. 22, pp. 617–622 (2011)Google Scholar
- 15.Long, J.R., Sturtevant, N.R., Buro, M., Furtak, T.: Understanding the success of perfect information Monte Carlo sampling in game tree search. In: AAAI (2010)Google Scholar
- 16.Parlett, D.: The Penguin Book of Card Games. Penguin, London (2008)Google Scholar
- 19.van Rijn, J.N., Takes, F.W., Vis, J.K.: The complexity of Rummikub problems. In: Proceedings of the 27th Benelux Conference on Artificial Intelligence (2015)Google Scholar
- 23.Wästlund, J.: A solution of two-person single-suit whist. Electron. J. Comb. 12(1) (2005). Paper #R43Google Scholar
- 24.Wästlund, J.: Two-person symmetric whist. Electron. J. Comb. 12(1) (2005). Paper #R44Google Scholar