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.

[1]  Malte Helmert,et al.  A Skat Player Based on Monte-Carlo Simulation , 2006, Computers and Games.

[2]  Johan Wästlund Two-Person Symmetric Whist , 2005, Electron. J. Comb..

[3]  Wei-Yin Loh,et al.  Classification and regression trees , 2011, WIREs Data Mining Knowl. Discov..

[4]  Donald E. Knuth,et al.  The Solution for the Branching Factor of the Alpha-Beta Pruning Algorithm , 1981, ICALP.

[5]  Erik D. Demaine,et al.  Games, puzzles and computation , 2009 .

[6]  Nathan R. Sturtevant,et al.  Understanding the Success of Perfect Information Monte Carlo Sampling in Game Tree Search , 2010, AAAI.

[7]  Michael Buro,et al.  Real-Time Opponent Modeling in Trick-Taking Card Games , 2011, IJCAI.

[8]  Gaël Varoquaux,et al.  Scikit-learn: Machine Learning in Python , 2011, J. Mach. Learn. Res..

[9]  Jan N. van Rijn,et al.  Endgame Analysis of DOU SHOU QI , 2016, J. Int. Comput. Games Assoc..

[10]  Johan Wästlund,et al.  A Solution of Two-Person Single-Suit Whist , 2005, Electron. J. Comb..

[11]  Demis Hassabis,et al.  Mastering the game of Go with deep neural networks and tree search , 2016, Nature.

[12]  Ian Frank,et al.  Search in Games with Incomplete Information: A Case Study Using Bridge Card Play , 1998, Artif. Intell..

[13]  George Pâolya,et al.  Applied Combinatorial Mathematics , 1964 .

[14]  Édouard Bonnet,et al.  On the Complexity of Trick-Taking Card Games , 2013, IJCAI.

[15]  Judea Pearl,et al.  The solution for the branching factor of the alpha-beta pruning algorithm and its optimality , 1982, CACM.

[16]  E. Beckenbach,et al.  Applied Combinatorial Mathematics , 1965 .

[17]  Jan N. van Rijn,et al.  The Complexity of Rummikub Problems , 2016, ArXiv.

[18]  David Parlett,et al.  The Penguin Book of Card Games , 1979 .

[19]  Leo Breiman,et al.  Random Forests , 2001, Machine Learning.

[20]  H. Jaap van den Herik,et al.  Games solved: Now and in the future , 2002, Artif. Intell..

[21]  Demis Hassabis,et al.  Mastering the game of Go without human knowledge , 2017, Nature.

[22]  Walter A. Kosters,et al.  Acyclic Constraint Logic and Games , 2014, J. Int. Comput. Games Assoc..

[23]  Matthew L. Ginsberg,et al.  GIB: Imperfect Information in a Computationally Challenging Game , 2011, J. Artif. Intell. Res..