In the game of Mahjong, the deficiency number is an important metric to judge the quality of a given hand. Calculating this number on-the-fly using traditional methods, such as depth-first search, is time consuming. In this paper, we propose a formula for the deficiency number and design a greedy method to build a lookup table in advance, allowing for more efficient calculations. While using these tables, we introduce two methods to handle some special cases, named hidden tiles and pseudo-meld prioritization. By applying these methods, we ensure the correctness when using these tables. The experimental results show a speedup of 121.2 times compared to VeryLongCat and 6868.9 times compared to Botzone.

错误:搜索内容不能为空,请输入英文关键词
错误:关键词超出字数限制,请精简
高级检索

A Lookup Table for Deficiency Number Calculation in Mahjong

  • Shih-Chieh Tang,
  • Jr-Chang Chen,
  • I-Chen Wu

摘要

In the game of Mahjong, the deficiency number is an important metric to judge the quality of a given hand. Calculating this number on-the-fly using traditional methods, such as depth-first search, is time consuming. In this paper, we propose a formula for the deficiency number and design a greedy method to build a lookup table in advance, allowing for more efficient calculations. While using these tables, we introduce two methods to handle some special cases, named hidden tiles and pseudo-meld prioritization. By applying these methods, we ensure the correctness when using these tables. The experimental results show a speedup of 121.2 times compared to VeryLongCat and 6868.9 times compared to Botzone.