Download as pdf or txt
Download as pdf or txt
You are on page 1of 12

Entertainment Computing 43 (2022) 100509

Contents lists available at ScienceDirect

Entertainment Computing
journal homepage: www.elsevier.com/locate/entcom

A new approach to compute deficiency number of Mahjong configurations☆


Qichao Wang a, b, *, Yang Zhou a, Dongyi Zhu c, Yongming Li a
a
School of Computer Science, Shaanxi Normal University, Xi’an, China
b
Guangxi Key Laboratory of Trusted Software, Guilin University of Electronic Technology, Guilin, China
c
School of International Studies, Shaanxi Normal University, Xi’an, China

A R T I C L E I N F O A B S T R A C T

Keywords: Mahjong is a traditional Chinese tile-based game with long history, and now it is world-widely played in many
Mahjong different countries. An important issue on Mahjong topic is how many tiles the player needs to change minimally
Deficiency Number for the winning, i.e., the so-called deficiency number, which plays a significant role in AI development for Mahjong
Performance Analysis
game. However, deficiency number cannot be easily computed due to a large amount of possible combinations of
Python
tiles. In this work, we propose an efficient algorithmic approach to compute the deficiency number of the tiles in
players’ hands with the assistance of the programming language Python. In order to evaluate the performance of
the approach, we established more than 1.2 million test cases for various deficiency numbers. Finally, the
experimental results show the efficiency of our approach.

1. Introduction turns to pick up with one tile from the tile-wall and correspondingly
discard another one tile from hand. Each one of the players can hold 13
Mahjong is commonly known as a popular and traditional table game tiles, and they can get the winning by using the 13 already-drawn tiles
in Chinese entertainment culture, which is played by four people. This on his own hand, and also with the 14th tile that can be obtained by
game is considered as a wit-inspiring fun game all around China for either being newly drawn from the tile-wall or being discarded from
more than 2500 years [1,2]. Mahjong emphasizes skill and strategy by another player. This means that the players need to change the tiles in
the players so as to calculate an acceptable winning plan in the process order to win the game. How to get the winning depends on different
of playing, and sometimes a lucky chance is favored by the winning. combinations of the tiles. Combinations can be found in various ways, e.
The Mahjong tiles are designed according to Chinese characters and g., a chow is a sequence of three tiles with consecutive indices from the
symbols as shown in Fig. 1, and tile information forms the most common same type, a pong and a kong is a sequence of three and four same tiles,
and basic version of this game. There are 144 tiles involved in Mahjong, respectively, and an eye is a pair of same tiles. To get the winning, the
namely 36 tiles of bamboo type, 36 tiles of character type, 36 tiles of dot player needs four melds and one eye, where a meld refers to a chow and
type, and 36 specific symbols such as honors (e.g., winds and arrows) and pong, and a pair of tiles is called a pseudomeld, if it becomes a meld by
bonus (e.g., seasons and flowers). For each of the bamboo, character and adding an appropriate tile [4].
dot type, there are nine indices of tiles, that is, from 1 to 9, and each tile An essential point on Mahjong topic is to determine the minimal
has four copies. Due to some regional differences, variations of rules in number of tiles that the player needs to change for the winning, i.e., the
Mahjong have been put and used. But the very basic and common so-called deficiency number (or simply deficiency) [4], which plays an
Mahjong rule, which is called Mahjong-0, has paved way for all its var­ important role in the evaluation of the tiles in the players’ hands, so as to
iations. For the version of Mahjong-0, we only consider the tiles of the boost AI development for Mahjong game. However, deficiency cannot
types bamboo, character and dot. be easily computed due to a large amount of possible combinations of
Now we introduce the presentation mode of Mahjong-0. There are tiles, meanwhile, related works on this topic are still limited [4]. This
four players involved in the game, when the game starts, players take paper revolves around an efficient algorithmic approach to compute the


This work is supported by the National Natural Science Foundation of China under Grant (No. 62002211), the Chinese National Funding of Social Sciences under
Grant (No. 21FYYB012), the Fundamental Research Funds for the Central Universities under Grant (No. GK202103089), Guangxi Key Laboratory of Trusted Software
(No. kx202010), and Social Science Foundation of Shaanxi Province (No. 2019M017).
* Corresponding author at: School of Computer Science, Shaanxi Normal University, No. 620, Xichangan Street, Chang’an District, Xi’an, Shaanxi Province, China.
E-mail address: wangqc@snnu.edu.cn (Q. Wang).

https://doi.org/10.1016/j.entcom.2022.100509
Received 13 September 2021; Accepted 19 June 2022
Available online 28 June 2022
1875-9521/© 2022 Elsevier B.V. All rights reserved.
Q. Wang et al. Entertainment Computing 43 (2022) 100509

Fig. 1. Mahjong tiles [3].

deficiency of the tiles in players’ hands, which is based on the notion of [19,20] achieved significantly higher ratings than the average human
isolated tiles, i.e., the tiles that do not belong to any combination such as player.
meld and eye [5]. Our approach consists of two phases as follows. However, there are few works on the evaluation of the 14-tile in the
During the first phase, the tiles in player’s hand will be divided into players’ hands. To the best of our knowledge, only in [4] Li and Yan
some groups such as melds, pseudomelds and isolated tiles; during the raised the notion of deficiency, i.e., the minimal number of tile changes
second phase, the deficiency will be computed by considering the rela­ for making a 14-tile winning, and proposed two methods to compute the
tion between the numbers of pseudomelds and isolated tiles, which are deficiency. For the first method, we need to introduce the following
implemented by using the programming language Python. In order to notion. Two 14-tiles T1 = t1 t2 …t14 and T2 = r1 r2 …r14 are neighbours, if
evaluate the performance of the approach, we established more than 1.2 there exists exactly one index i such that ti ∕ = ri . In order to verify the
million test cases for various deficiencies in the experiments. Finally, the hypothesis that the deficiency of a 14-tile is k, the first method presented
experimental results have shown the efficiency of our approach. in [4] is to inductively check whether there exists a neighbour of T with
This paper is structured as follows. In Sections 2 and 3, we recall the deficiency k − 1. Obviously, this method is quite inefficient, since we
some related works and basic notions on Mahjong, respectively. Then, need to know all 14-tiles with deficiency k − 1. The second method from
we introduce the main approach for deficiency computing in Section 4, Li and Yan is to divide the 14-tile into five subsequences for four melds
and describe our algorithms in detail in Section 5. Further, we introduce and one eye, and to combine variously for these melds and eye by using
our experiments in Section 6, and analyze the performance through quadtree. It is easily seen that there may be too many branches for the
experimental results in Sections 7 and 8. Finally, this paper is closed possible combinations of melds and eyes. Note that the experimental
with a short summary in Section 9. data are not available in the paper [4].
Wang et al. [5] constructed a theoretical model of weighted restarting
2. Related Works automaton that computes the deficiency of 14-tile. Originally, restarting
automata [21–27] have been introduced for modeling the linguistic
Recent years have seen more and more researches on the applica­ technique analysis by reduction, which is used to check the correctness of
tions of artificial intelligence in various games (see, e.g., [6–9,5,10]). natural sentences by stepwise simplification [28]. In order to study
For the perfect information game such as Checker[11], Go[12] and quantitative aspects of computation of a restarting automaton, e.g., the
Chess[13], AI even can win the best human player. However, the works computational resource consumed during the computation, the concept
on the imperfect information games are still limited [14–16], especially of weighted restarting automata has been introduced [29–34]. In such
for the Mahjong game. an automaton each operation is assigned a weight, and the weight of a
k-gates problem is a combinatorial problem of Mahjong game. A pure computation can be obtained by summing all weights during this
13-tile T of the type X is called k-gates, where 1⩽k ≤ 9, if there are k computation. The weighted restarting automaton designed in [5] com­
many different indices of tiles in T, and if T becomes winning by adding bines the tiles into melds and eyes during the process of simplification,
each tile of these k indices, but any other tile cannot do this. In [17] and counts the number of tiles changed by using its weight function. In
Cheng et al. developed an algorithm to solve the k-gates problem, and particular, the notion of isolated tiles is raised in [5], i.e., the tiles that do
implemented it by the programming language Python. It is shown that not belong to any combination. In this work, we propose an efficient
there exists only one 13-tile of nine-gates, and the numbers of other algorithmic approach to compute the deficiency of 14-tile based on the
gates and the corresponding probabilities of drawing are also given in numbers of pseudomelds and isolated tiles, which can be applied to both
[17]. pure and hybrid 14-tiles.
Riichi Mahjong is a popular variant in Japan, which is originated
from China, but now it is quite different from Chinese Mahjong in rules 3. Preliminaries
[18]. In [19,20], the authors raised prediction strategies for tile dis­
carding, and implemented AI programs that can play Japanese Mahjong. The purpose of this section is to introduce the basic rules of Mahjong
On a popular online website ”Tenhou”, the AI players proposed in game, and for them we mainly refer to the works [4,5]. There are many

2
Q. Wang et al. Entertainment Computing 43 (2022) 100509

different variants of Mahjong game, and here we only consider the basic
T2 = B1 B1 B2 B2 B2 B3 B3 B3 B4 B5 B6 B7 B8 B9
version Mahjong-0, where there are totally 108 tiles, consisting of 36
tiles of bamboo type, 36 tiles of character type, 36 tiles of dot type. is a pure winning configuration.
Therefore, the contents of the tiles in Mahjong-0 can be represented as
Definition 3.5. For a configuration T, the minimal number of neces­
follows:
sary tile changes for making T a winning is called the deficiency number
(or simply deficiency) of T, and it is denoted by dfncy(T). Obviously, for a
• Bamboos: B1 , B2 , …, B9 ,
winning configuration T, it holds that dfncy(T) = 0.
• Characters: C1 , C2 , …, C9 ,
• Dots: D1 , D2 , …, D9 . For example, the 14-tile
T3 = B1 B1 B2 B3 B5 C1 C1 C1 D5 D5 D5 D7 D8 D9
Note that there are four copies of each of the distinct tile. For a tile t
of the form Xi , where X ∈ {B, C, D} and 1⩽i ≤ 9, X is called the type of
is not a winning configuration and its deficiency is one, i.e., dfncy(T3 ) =
the tile t, and i is called the index of t. We continue with some basic
1. It is easily seen that a winning configuration can be obtained from T3
notions on Mahjong.
by replacing the tile B5 by a tile B4 . Similarly, the deficiency of the
Definition 3.1. An eye is a pair of identical tiles, that is, an eye is of the configuration
form Xi Xi for X ∈ {B, C, D} and 1⩽i⩽9; a pong is a sequence of three
T4 = B1 B1 B2 B3 B9 C1 C1 C3 D5 D5 D5 D6 D8 D9
identical tiles, that is, a pong is of the form Xi Xi Xi for X ∈ {B, C, D} and
1⩽i⩽9; a kong is a sequence of four identical tiles; a chow is a sequence of is three, i.e., dfncy(T4 ) = 3, where B9 is an isolated tile. In [4] it is shown
three tiles of the same type and consecutive indices, that is, a chow is of that the deficiency of a pure configuration is not larger than three, and
the form Xi Xi+1 Xi+2 for X ∈ {B, C, D} and 1⩽i⩽7; a meld is either a pong that a hybrid configuration has deficiency less than or equal to six.
or a chow. We continue with some mathematical results for isolated and related
Definition 3.2. For a type X ∈ {B, C, D}, a pair Xi Xj is called a pseu­ tiles in a configuration.
dochow if 1⩽|j − i| ≤ 2, that is, it becomes a chow if we add an appro­ Theorem 3.6. In a pure configuration, there are at most two isolated
priate tile Xk to Xi Xj ; a pseudomeld is either a pseudochow or an eye; a tile tiles.
is called isolated, if it does not belong to any meld and pseudomeld; a tile
Xi is related to a tile Xj , if they belong to the same meld or pseudomeld, Proof. Let T be a pure configuration that consists of 14 tiles of the
and is unrelated if otherwise. type X ∈ {B, C, D}. We assume that the configuration T contains three
isolated tiles. This means that in the configuration T, there are three tiles
For example, B1 B2 B3 is a chow, B4 B4 B4 is a pong, C2 C2 C2 C2 is a kong, Xi , Xj , and Xk that do not belong to any meld or pseudomeld. Further,
C5 C5 is an eye, and D7 D8 is a pseudochow, where B1 B2 B3 and B4 B4 B4 are these isolated tiles must be also unrelated to each other. It follows that
melds, C5 C5 and D7 D8 are pseudomelds. j − i ≥ 3 and k − j ≥ 3, which must hold at the same time. Therefore, we
Definition 3.3. A set of 14 tiles is called a configuration, if it is of the obtain that 1⩽i ≤ 3, 4⩽j ≤ 6, and 7⩽k ≤ 9. Recall that each configura­
form tion consists of 14 tiles, and thus in the configuration T there are 11 tiles
that are not isolated. Let Xr be a non-isolated tile in the configuration T.
Bi1 Bi2 …Bim Cj1 Cj2 …Cjn Dk1 Dk2 …Dkr , For the index r of the tile Xr , we have to distinguish between some cases.
If 1⩽r ≤ 3, then the tile Xr is related to Xi ; if 4⩽r ≤ 6, then it is related to
where 0⩽i1 ⩽i2 ⩽…⩽im ≤ 9, 0⩽j1 ⩽j2 ⩽…⩽jn ≤ 9, 0⩽k1 ⩽k2 ⩽…⩽kr ≤ 9,
Xj ; if 7⩽r ≤ 9, then it is related to Xk . We have seen that the tile Xr is
im + jn + kr = 14, and X0 = ∊ for X ∈ {B, C, D}; a configuration T is
always related to at least one of the isolated tiles, which contradicts our
called winning if it consists of an eye and four melds, and the eye and
assumption.
melds are called the components of the winning configuration T. For
Actually, it is rather clear that for each type X ∈ {B, C, D}, there are
example, the 14-tile
only three pure configurations that contain two isolated tiles:

T1 = B1 B1 B2 B3 B4 C1 C2 C3 D5 D5 D5 D7 D8 D9 (1) X1 X4 X7 X7 X7 X7 X8 X8 X8 X8 X9 X9 X9 X9 ;
(2) X1 X4 X4 X4 X4 X5 X5 X5 X5 X6 X6 X6 X6 X9 ;
is a winning configuration, where B1 B1 is the eye component of T1 , and (3) X1 X1 X1 X1 X2 X2 X2 X2 X3 X3 X3 X3 X6 X9 .
B2 B3 B4 , C1 C2 C3 , D5 D5 D5 , and D7 D8 D9 are the meld components of T1 .
Hence, there are in total nine pure configurations that contain two iso­
Definition 3.4. A configuration is called pure if all the tiles are of the lated tiles.
same type; otherwise, it is called hybrid. A configuration is called 2-
Theorem 3.7. In a 2-hybrid configuration, there are at most five iso­
hybrid, if there are exactly two different types of tiles in this configura­
lated tiles.
tion. Analogously, the notion of 3-hybrid can also be defined.
Proof. Let T be a 2-hybrid configuration. We assume that the
For example, the 14-tile T1 is a 3-hybrid winning configuration, and
configuration T contains six isolated tiles, and thus these tiles are un­
the 14-tile
related to each other. According to the arguments of Theorem 3.6, for

3
Q. Wang et al. Entertainment Computing 43 (2022) 100509

the same type, there are at most three tiles Xi , Xj and Xk that are unre­ A grouping (M, P, I) of a configuration T means that the tiles in T are
lated to each other, where 1⩽i ≤ 3, 4⩽i ≤ 6 and 7⩽k ≤ 9, and thus for divided into the sets M, P and I, and each tile of T can be put into exactly
two types at most six tiles. It follows that in the configuration T there are one set. It is easily seen that for a configuration there may be more than
at least eight non-isolated tiles. In analogy to the proof of Theorem 3.6, one grouping, and for a configuration T, we use G(T) to denote the set of
we can easily show that each non-isolated tile would be related to at all possible groupings for T. Further, for each grouping g = (M, P,
least one of the isolated tiles, which contradicts our assumption. I) ∈ G(T), we can construct the remaining components for the winning
It remains to find a 2-hybrid configuration that contains five isolated by using the pseudomelds in P and the relatively isolated tiles in I, and
tiles. For some types X, Y ∈ {B, C, D} and X ∕ = Y, in the configuration let MTC(g) be the minimal number of changed tiles in P and I. This
means that the minimal value among all MTC(g) for g ∈ G(T) is actually
X1 X4 X7 X8 X8 X8 X8 X9 X9 X9 X9 Y1 Y4 Y7 ,
the deficiency of the configuration T, i.e.,
there are five isolated tiles, which are X1 , X4 , Y1 , Y4 , and Y7 . In fact, by dfncy(T) = min{MTC(g)|g ∈ G(T)}.
simply brute-force searching it is easily obtained that there are 540
many 2-hybrid configurations that contain five isolated tiles. Since the computational cost is influenced by the number of groupings in
In an analogous way, the following result can be established. the set G(T), the unnecessary groupings such as duplication and simi­
larity will be avoided, and the grouping set that is obtained by such
Corollary 3.8. In a 3-hybrid configuration, there are at most eight
simplification is denoted by Gs (T). Therefore, given a Mahjong config­
isolated tiles.
uration T, our approach consists of two phases as follows.
It is rather clear that a winning configuration does not contain any
isolated tile. Therefore, in order to obtain a winning configuration, (1) Group the tiles of T, and obtain the grouping set Gs (T);
isolated tiles need to be replaced by some other tiles. Finally, we (2) Calculate the value of min{MTC(g)|g ∈ Gs (T)}.
establish the subsequent result for related tiles.
Obviously, each isolated tile in the original configuration must be in
Theorem 3.9. In Mahjong-0, a tile can be related to at most 19 many
the set I for any grouping. Further, a tile in the set I may be not isolated
tiles.
in the original configuration T, and it becomes isolated if all tiles related
Proof. The above statement can be proved by brute-force searching. to it are put into the sets M and P. For example, in the configuration
For X ∈ {B, C, D} and 1⩽i, j ≤ 9, it should be clear that a tile Xi is unre­
T5 = B1 B2 B3 B4 B9 C5 C5 C5 C5 D1 D1 D6 D6 D7 ,
lated to Xj if |j − i| > 2. Therefore, a tile Xi is related to the tiles Xi− 2 ,Xi− 1 ,
Xi+1 ,Xi+2 , and other copies of itself. Further, there are in total 16 copies there is only one isolated tile B9 , while in the grouping
for the tiles Xi− 2 ,Xi− 1 , Xi+1 , and Xi+2 , and still three copies for the tile Xi
itself, which completes our proof. ({B1 B2 B3 , C5 C5 C5 }, {D1 D1 , D6 D6 }, {B4 , B9 , C5 , D7 })
By the statement above, we obtain that in a configuration a tile can
be related to any other tile. For example, in the configuration of T5 , the tiles B4 , B9 , C5 and D7 are taken into the set I as relatively
isolated, and in another grouping
X3 X3 X3 X3 X4 X4 X4 X4 X5 X5 X5 X5 X6 X6 ,
({B2 B3 B4 }, {C5 C5 , C5 C5 , D1 D1 , D6 D7 }, {B1 , B9 , D6 }),
any copy of the tile X4 or X5 is related to all other tiles.
the set I contains the tiles B1 , B9 and D6 . We have seen that in both
4. Proposed Approach groupings the isolated tile B9 is always in set I.
For the maximal size of the sets M, P and I, we have the following
In order to transform a configuration T into a winning configuration result.
T ′ , we need to build the remaining components of T′ . It is easy to see that Theorem 4.2. For a grouping (M,P,I), it holds that |M| ≤ 4,|P| ≤ 7, and
a meld component can be constructed by a pseudomeld and an isolated |I| ≤ 9.
tile or three isolated tiles, and an eye component can be constructed by a
pseudomeld or two isolated tiles. Therefore, the deficiency can be Proof. Since there are 14 tiles in a configuration, it is easily seen that
calculated based on the numbers of pseudomelds and isolated tiles. For each configuration contains at most four melds and seven pseudomelds.
this purpose, we need the following notions. It remains to prove that |I| ≤ 9.
We assume that there exists a grouping (M, P, I) such that |I| = 10,
Definition 4.1. For a Mahjong configuration T, a (complete) grouping that is, there are ten relatively isolated tiles in the grouping (M, P, I). By
of T is defined by a triple (M,P,I), where M is a set of melds, P is a set of the definition of relatively isolated tiles, all tiles in the set I are unrelated
pseudomelds, I is a tile set such that all tiles in I are unrelated to each to each other. Further, according to the arguments in the proof of The­
other, and all tiles in the sets M, P and I can constitute the configuration orem 3.6, for each type X ∈ {B,C,D}, there are at most three tiles that are
T; the tiles in the set I are called relatively isolated. unrelated to each other. Therefore, the set I contains all three types of

4
Q. Wang et al. Entertainment Computing 43 (2022) 100509

tiles, and for each type at least three tiles, i.e., Bi1 ,Bi2 ,Bi3 ,Cj1 ,Cj2 ,Cj3 , Dk1 , (2) Since |P| > |I|, we need to use the rest of pairs in the set P for
Dk2 and Dk3 , where 1⩽i1 ,j1 ,k1 ≤ 3,4⩽i2 ,j2 ,k2 ≤ 6, and 7⩽i3 ,j3 ,k3 ≤ 9. It building the remaining components for the winning configura­
follows that the tenth tile t in the set I is related to at least one of the tion. First, it is required to take a pair from P as the eye compo­
above relatively isolated tiles, and let x ∈ I be a tile related to t. By the nent. At this point, there are still |P| − 1 − |I| many pseudomelds in
Definition 4.1, the tile t becomes relatively isolated after taking all tiles the set P, and by using them we construct the remaining meld
related to t into the sets M and P including the tile x, which contradicts components. It is easily seen that from |P| − 1 − |I| many pairs, we
our assumption. can build (|P| − 1 − |I|) × 23 many melds, and during this process at
It is easily seen that |I| = 9 can only happen in the case that |M| = 1 least (|P| − 1 − |I|) × 23 many tiles need to be changed.
and |P| = 1, e.g., the grouping
({B6 B6 B6 }, {B5 B5 }, {B1 , B5 , B9 , C1 , C4 , C7 , D2 , D5 , D8 }) Hence, by summing the above two parts, we can obtain the total
number |I| + (|P| − 1 − |I|) × 23. In addition, according to Lemma 4.3,
of the configuration |P| − 1 − |I| is always divisible by 3 in the case of |P| > |I|, which com­
pletes our proof.
B1 B5 B5 B5 B6 B6 B6 C1 C4 C7 D2 D5 D8 ,
In an analogous way, the following result can also be established.
where the tile B5 is not isolated in the original configuration, and be­ Theorem 4.5. Let g = (M, P, I) be a grouping of a configuration T. If
comes relatively isolated after taking the pseudomeld B5 B5 and the meld |I|⩾|P|, and if the set P contains an eye, then MTC(g) = |P| − 1 +
B6 B6 B6 into the set P and M, respectively. (|I| − (|P| − 1)) × 23.
For constructing a winning configuration, the remaining components
can be built by consuming one pair in P and one tile in I. Considering the Finally, the deficiency of a configuration T can be obtained by
numbers of pseudomelds and relatively isolated tiles, we need to determining the value of min{MTC(g)|g ∈ Gs (g)}.
distinguish between two cases. For a grouping g = (M, P, I), if |P| > |I|,
meaning that there are more pseudomelds than relatively isolated tiles, 5. Algorithms
then we have to transform the rest of the pseudomelds into the
remaining components for the winning configuration; otherwise, we The goal of this section is to present our algorithm for computing the
have to use the rest of the tiles in the set I to build the remaining deficiency of Mahjong configurations through pseudocode. This algo­
necessary components. Now we introduce our approach to compute the rithm consists of two subalgorithms. The first one is used to obtain the
value MTC(g) for a grouping g = (M, P, I) by using the values |P| and |I|. set Gs (T) for a given configuration T, and the second one is used to
To do this, we need the following lemma. For a set of S, let |S| denote the calculate the value MTC(g) for all g ∈ Gs (T), and then choose the min­
number of elements in S. imum as the deficiency of T, which will be introduced in the following
two subsections.
Lemma 4.3. Let g = (M, P, I) be a grouping of a configuration T. If
|P| > |I|, then |P| − |I| − 1 is divisible by 3.
Proof. Since a configuration contains at most four melds, we 5.1. Tile Grouping
consider the cases for the numbers of melds from 0 to 4. If |M| = 0,
meaning that there is no meld in the configuration T, then all 14 tiles will In order to describe the process of transforming a Mahjong config­
be grouped into the sets P and I. Again we have to distinguish between uration into a complete grouping, we introduce the following notion.
some cases. If |P| = 7 and |I| = 0, then |P| − |I| − 1 = 6, which is divisible
by 3. Now we consider the case that |P| = 6 and |I| = 2, meaning that a Definition 5.1. An incomplete grouping of a configuration T is defined
pair is taken from the set P into I, which leads to reduce |P| by 1 and by a quadruple (T′ ,M,P,I), where T′ is a substring of T that indicates the
increase I by 2, and thus the value of |P| − |I| − 1 is reduced by 3. In the remaining part of T to be grouped, M is a set of melds, P is a set of
analogous way, all other cases can be also dealt with. pseudomelds, I is a set of relatively isolated tiles as described in Defi­
nition 4.1, and the string T′ together with all tiles of M, P and I can
Theorem 4.4. Let g = (M, P, I) be a grouping of a configuration T. If constitute the configuration T.
|P| > |I|, and if the set P contains an eye, then MTC(g) = |I| +
Given an incomplete grouping (T′ ,M,P,I), if T ′ is empty, i.e., (∊,M,P,
(|P| − 1 − |I|) × 23.
I), then the grouping is actually complete, that is, all tiles in the
Proof. The number of tiles that we need to change consists of the configuration T are moved in the sets M, P and I, and thus it can also be
following two parts. written as (M, P, I) as shown in Definition 4.1. Obviously, the initial
incomplete grouping of a Mahjong configuration T is (T, ∅, ∅, ∅).
(1) It is rather clear that we need to change at least one tile for The pseudocode listed in Algorithm 1 is used to obtain the possible
constructing a meld by using a pseudomeld from the set P and a (complete) groupings from the given incomplete grouping. For a tile t,
relatively isolated tile from the set I. Therefore, during the pro­ let Φ(t) denote the index of t. Further, for a tile string T, |T| denotes the
cess of consuming all the tiles in the set I, at least |I| many tiles number of tiles in T. Finally, for a substring T ′ of T, we use T ⊖ T ′ to
have to be changed. denote the remaining part of T that is obtained by removing T ′ from T.

5
Q. Wang et al. Entertainment Computing 43 (2022) 100509

Algorithm 1. Grouping the tiles of Mahjong configuration

6
Q. Wang et al. Entertainment Computing 43 (2022) 100509

For a meld t1 t2 t3 , it holds that Φ(t3 ) − Φ(t1 ) ≤ 2. Therefore, in the The deficiency of the above configurations is 1, and the optimal
GROUP() function we first consider the leftmost substring s = s1 s2 …sn routine for them is replacing a copy of the tile X1 and X2 by X4 ,
containing all tiles si satisfying that Φ(si ) − Φ(s1 ) ≤ 2 for 1⩽i⩽n. For the respectively. Both configurations have a common substring
length of s, we distinguish between the following cases. X5 X6 X6 X7 X7 X7 X7 , and the tiles X5 and X6 must be combined into
a pseudomeld in order to obtain the optimal routine. Accordingly,
(1) If |s| = 0, then it follows that T is an empty string, that is, the we invoke the GROUP() function with the argument (T ⊖ s1 s2 , M,
grouping is already finished, and thus the algorithm returns the P ∪ {s1 s2 }, I).
set of the triple (M, P, I), which is a complete grouping.
(2) If |s| = 1, meaning that s is an isolated tile, then we remove s from Now we show the procedure of the algorithm by using a test case in
the tile string T and add s into the set I. Further, we continue our experiments.
grouping the remaining part of T by recursively calling the
GROUP() function with the argument (T ⊖ s, M, P, I ∪ {s}). Example 5.2. Let the configuration
(3) If |s| = 2, i.e., s = s1 s2 , meaning that s is a pseudomeld, then we T = B2 B3 B4 B5 B5 B6 B7 B7 C8 D1 D2 D3 D9 D9 .
invoke the GROUP() function with the argument (T ⊖ s,M,P ∪ {s},
I), removing s from the tile string T and adding s into the set of The algorithm begins with the argument (T,M,P,I), where M = P = I =
pseudomelds. Further, if Φ(s2 ) − Φ(s1 ) = 2, and if the tile s2 can ∅. First, we observe the leftmost substring B2 B3 B4 , which is a meld, and
be involved in the construction of a meld with the following tiles, thus we remove it from T and take it into the set M. Then, we consider
then we break the pseudomeld s1 s2 up and take the tile s1 into the the leftmost substring B5 B5 B6 B7 B7 of the remaining part of T. As
set I. Note that the tile s2 is still in the remaining part of T. Then, |B5 B5 B6 B7 B7 | ≥ 4, we need to distinguish between two cases:
by using the GROUP() function with the argument (T ⊖ s1 , M, P,
I ∪ {s1 }), the algorithm tries combining the tile s2 with the (1) As the substring B5 B5 B6 B7 B7 contains a meld B5 B6 B7 , we put it
following tiles into a meld. into the set M. Then, the remaining part B5 B7 is a pseudomeld,
(4) If |s| = 3, i.e., s = s1 s2 s3 , then we have to distinguish between the and thus we take it into the set P.
following two cases. (2) There are two eyes in the substring B5 B5 B6 B7 B7 , and we first take
(4.1) If s is a meld, then we remove s from the string T, and put it the eye B5 B5 into the set P. For the remaining part B6 B7 B7 , again
into the set M. Further, we continue grouping the remain­ we distinguish between two cases.
ing part of T by calling the GROUP() function with the (2.1) B7 B7 is an eye, and thus we put it into the set P. Obviously,
argument (T ⊖ s, M ∪ {s}, P, I). Further, if s is a pong, then in this case the tile B6 becomes relatively isolated, and thus
we need to break it up into an eye s1 s2 and a single tile s3 , we put it into the set I.
adding s1 s2 into the set P. (2.2) B6 B7 is a pseudomeld, and thus we can also take it into the
(4.2) If |s| = 3, and if s is not a meld, meaning that s contains an set P. In analogy to the case (2.1), as the tile B7 becomes
eye s′ , then we add the eye s′ into the set P and continue relatively isolated, we take it into the set I.
grouping the remaining part of T by invoking the GROUP()
function with the argument (T ⊖ s′ ,M,P ∪ {s′ },I). Further, if The remaining part C8 D1 D2 D3 D9 D9 can be dealt with analogously,
Φ(s2 ) > Φ(s1 ), meaning that s2 s3 is an eye, and s1 s2 (and and we put the substrings C8 ,D1 D2 D3 , and D9 D9 into the sets I,M, and P
s1 s3 ) is a pseudomeld, then we combine s1 and s2 into a respectively. Hence, the algorithm produces three groupings for the
pseudomeld and keep the tile s3 in the remaining part of T, given configuration T, and returns the set
since the tile s2 (and s3 ) together with the following tiles
may constitute a meld or a pseudomeld. In addition, we G= {({B2 B3 B4 , B5 B6 B7 , D1 D2 D3 }, {B5 B7 , D9 D9 }, {C8 }),
have to consider the case that Φ(s2 ) − Φ(s1 ) = 2, that is, s is ({B2 B3 B4 , D1 D2 D3 }, {B5 B5 , B7 B7 , D9 D9 }, {B6 , C8 }),
({B2 B3 B4 , D1 D2 D3 }, {B5 B5 , B6 B7 , D9 D9 }, {B7 , C8 })}.
of the form Xi Xi+2 Xi+2 . In this case we need to try
combining the pair Xi+2 Xi+2 with the following tiles and
putting the tile s1 into the set I. It is important to notice that
if s1 s2 is an eye, then we do not break s1 s2 up in order to
avoid unnecessary groupings, since the tile t1 (and t2 ) be­ 5.2. Calculating Deficiency
comes relatively isolated.
(5) If |s| ≥ 4, then the algorithm needs to recursively reduce the For a Mahjong configuration T, we can obtain a set G of groupings of
length of s by removing the melds and eyes in s, which is executed T by executing the GROUP() function given in the previous subsection.
in analogy to the above cases. If |s| = 4, i.e., s = s1 s2 s3 s4 , if s2 s3 s4 Then, we can compute the deficiency of T by using the CALCU­
is a pong, and if Φ(s2 ) − Φ(s1 ) = 2, then we take the pseudomeld LATE_DEFICIENCY() function which is presented in Algorithm 2. Now
s1 s2 into the set P, and keep the eye s3 s4 in the remaining part of T. we introduce some notions for the following algorithm.
However, we have to consider a special case that |s| = 7 (s =
Definition 5.3. Let the complete grouping (M, P, I), and let a pseudo­
s1 s2 …s7 ), Φ(s1 ) ∕= Φ(s2 ) and s4 s5 s6 s7 is a kong, mainly for the
meld t1 t2 ∈ P. If all the tiles that can be used to construct a meld with t1 t2
following pure configurations:
are contained in the set M and P, then t1 t2 is called incompletable, that is,
(a) X1 X1 X1 X1 X5 X6 X6 X7 X7 X7 X7 X8 X8 X9 , the pseudomeld cannot be completed with a meld by adding another one
(b) X2 X2 X2 X2 X5 X6 X6 X7 X7 X7 X7 X8 X8 X9 . tile.

7
Q. Wang et al. Entertainment Computing 43 (2022) 100509

Algorithm 2. Calculating the deficiency of Mahjong configuration

The CALCULATE DEFICIENCY(G) function is designed based on constructing a meld by using an incompletable eye, both tiles
Theorems 4.4 and 4.5, and calculates the deficiency of Mahjong need to be changed. Therefore, if there exists an incompletable
configuration by considering the relations between the numbers of eye in the set P, i.e., exist_incompletable_eye = true, then the
pseudomelds and relatively isolated tiles. Therefore, given a complete optimal choice of the eye component is one of the incompletable
grouping (M,P,I), the algorithm first determines the values of |P| and |I|. eyes. Note that both tiles in an incompletable eye will be put into
If a pseudomeld in the set P is incompletable, then it will be transferred the set I as two relatively isolated tiles.
into the set I, which leads to the corresponding changes of the values of (2) The value of the variable exist_eye implies whether there exists an
|P| and |I|. In addition, it is also required to make an eye component for a eye in the set P. If exist_incompletable_eye = false, and if exist_eye =
winning configuration. In the CALCULATE DEFICIENCY() function true, then we can choose an existing eye without changing any
there are four Boolean variables to determine the choice of the eye tile. If exist_eye = false, then we consider the following two cases.
component for the winning configuration. (2.1) If |P| > |I|, then the algorithm tries transforming a pseu­
dochow into an eye by changing a tile of it. Therefore, we
(1) The variable exist_incompletable_eye is used to indicate whether establish the variable pchow_to_eye in order to indicate
there exists an incompletable eye. It is rather clear that for whether there exists a pseudochow that can be transformed

8
Q. Wang et al. Entertainment Computing 43 (2022) 100509

Table 1
The numbers of test cases for various deficiencies in experiments.
Deficiency 0 1 2 3 4 5 6 Total

Pure 13259 91065 14386 90 0 0 0 118800


Hybrid 20842 214044 265990 323209 225974 49596 5004 1104659
Total 34101 305109 280376 323299 225974 49596 5004 1223459

into an eye within one tile change. If pchow_to_eye = true,


Table 2
then the number of tile changes increases by 1; otherwise,
Run-time results of the algorithm (millisecond).
by 2.
(2.2) If |P|⩽|I|, then we use the variable iso_to_eye to indicate Run-time results for pure configurations

whether there exists two relatively isolated tiles that can be Deficiency Average Min Max Median St. Dev.
used to construct an eye by changing one of them. If iso_­ 0 1.494 0.127 11.394 1.172 1.128
1 1.165 0.115 8.93 0.973 0.736
to_eye = true, then the number of tile changes increases by
2 0.765 0.157 4.042 0.659 0.423
1; otherwise, by 2. 3 0.474 0.262 0.846 0.453 0.122
Total 1.153 0.115 11.394 0.943 0.781
Now we give an example based on the configuration T that is pre­ Run-time results for hybrid configurations
sented from Example 5.2.
Deficiency Average Min Max Median St. Dev.
Example 5.4. For a complete grouping (M, P, I) of the configuration 0 0.216 0.025 3.007 0.157 0.196
1 0.409 0.026 5.841 0.295 0.381
T = B2 B3 B4 B5 B5 B6 B7 B7 C8 D1 D2 D3 D9 D9 2 0.256 0.025 3.221 0.182 0.228
3 0.138 0.024 1.497 0.107 0.098
that is given in Example 5.2, the value of dfncy(T) can be calculated as 4 0.092 0.026 0.78 0.081 0.051
5 0.077 0.027 0.354 0.069 0.035
follows.
6 0.068 0.03 0.169 0.056 0.028
Total 0.208 0.024 5.841 0.123 0.241
(1) For the grouping g1 = (M, P, I), where M = {B2 B3 B4 , B5 B6 B7 ,
Summarized run-time results for all test cases in experiments
D1 D2 D3 }, P = {B5 B7 , D9 D9 } and I = {C8 }, it follows that |M| = 3,
|P| = 2, and |I| = 1. According to the above algorithm, there is at Deficiency Average Min Max Median St. Dev.
0 0.713 0.025 11.394 0.316 0.952
least one eye in the set P, and thus exist_eye = true. Further, as
1 0.634 0.026 8.93 0.458 0.619
|I|⩽|P| − 1, it can be obtained that 2 0.282 0.025 4.042 0.193 0.266
3 0.138 0.024 1.497 0.107 0.098
2 2
MTC(g1 ) = |I| + (|P| − 1 − |I|) × = 1 + (2 − 1 − 1) × = 1. 4 0.092 0.026 0.78 0.081 0.051
3 3 5 0.077 0.027 0.354 0.069 0.035
6 0.068 0.03 0.169 0.056 0.028
Total 0.299 0.024 11.394 0.138 0.436
(2) For the grouping g2 = (M, P, I), where M = {B2 B3 B4 , D1 D2 D3 },
P = {B5 B5 , B7 B7 , D9 D9 } and I = {B6 ,C8 }, it follows that |M| = 2,
|P| = 3, and |I| = 2. According to the above algorithm, it can be 6. Experiments Design
obtained that
In order to evaluate the performance of our algorithm, we estab­
2 2
MTC(g2 ) = |I| + (|P| − 1 − |I|) × = 2 + (3 − 1 − 2) × = 2. lished more than 1.2 million test cases with various deficiencies
3 3 including both pure and hybrid configurations. The numbers of test
cases for various deficiencies in experiments are given in Table 1. The
performance was evaluated on Apple MacBook Pro running an eight-
(3) For the grouping g3 = (M, P, I), where M = {B2 B3 B4 , D1 D2 D3 },
core Apple M1 processor with 8 GB of RAM. The algorithm was imple­
P = {B5 B5 , B6 B7 , D9 D9 } and I = {B7 ,C8 }, it follows that |M| = 2,
mented by the programming language Python of the version 3.8, and
|P| = 3, and |I| = 2, and thus we can immediately obtain that
compiled with Python3. In the following two subsections, we introduce
MTC(g3 ) = 2 in analogy to Case (2).
experiments design for pure and hybrid configurations, respectively.
Finally, we can determine the deficiency
6.1. Experiments for Pure Configurations
dfncy(T) = min{MTC(g)|g ∈ Gs } = min{1, 2, 2} = 1.
There are in total 118800 many pure configurations of each type,
Hence, the grouping
which can be easily obtained by brute-force searching. As mentioned
({B2 B3 B4 , B5 B6 B7 , D1 D2 D3 }, {B5 B7 , D9 D9 }, {C8 }) above, the deficiency of a pure configuration is at most 3. In fact, the
numbers of pure configurations with the deficiencies from 0 to 3 are
is optimal, and we just need to replace the isolated tile C8 by the tile B6 given in [4]. Therefore, in our experiments, we established all pure
to obtain a winning configuration. configurations of bamboo type by brute-force searching. The pseudo­
code listed in Algorithm 3 is commonly used to generate all pure con­
figurations (see, e.g., [17]).

9
Q. Wang et al. Entertainment Computing 43 (2022) 100509

Algorithm 3. Generating all pure configurations

6.2. Experiments for Hybrid Configurations 8. Performance Analysis

The test cases for hybrid configurations are generated with the ran­ In the experiments, our implementation of the algorithm can calcu­
dint() function from the Random library. We established more than 1.1 late the deficiencies of all pure configurations with the accuracy of
million test cases for hybrid configurations without duplication, and the 100%. Since a hybrid configuration is the combination of two or three
numbers of test cases for various deficiencies are given in Table 1. In pure configurations, the deficiencies of hybrid configurations can also be
these test cases, each configuration contains at least two types of tiles. correctly computed by our algorithm. It is rather clear that the run-time
is essentially influenced by the number of groupings of Mahjong
7. Experimental Results configuration, which are produced by the GROUP() function shown in
Algorithm 1. Therefore, we counted the numbers of groupings of all test
In our experiments, the run-time was measured by using the timeit() cases as listed in Table 3. We can see that the value of deficiency is
function from the timeit library. In order to reduce random errors, the basically in inverse proportion to the run-time and grouping numbers,
algorithm is repeatedly executed 10 times on each test case, and we excepting the test cases for the hybrid configurations of deficiency 1.
choose the average value as the run-time (millisecond). We study many Comparatively speaking, computing the deficiency of pure configura­
aspects of performance metrics such as average, minimum, maximum, tions leads to higher computational cost than hybrid configurations,
median and standard deviation. The run-time results for pure and hybrid since there are generally fewer isolated tiles and more tiles related to
configurations are given in Table 2, thus summarizes the run-time re­ each other in pure configurations.
sults for all test cases including pure and hybrid configurations. We can Obviously, the algorithm for tile grouping proceeds over tree struc­
see that each test case can be solved less in under one fiftieth of a second, ture, and each leaf node corresponds to a complete grouping. Note that
and the average run-time is only 0.299 millisecond. the expansion of unnecessary branches have been avoided in the process
of grouping. Thus, the average of branches for all test cases, i.e., the
grouping numbers, is only 7.784. Although the average of grouping

Table 3
The numbers of groupings of Mahjong configurations in the experiments.
Grouping numbers for pure configurations

Deficiency Average Min Max Median St. Dev.


0 22.721 4 66 21 9.999
1 21.128 4 72 20 9.084
2 15.68 2 68 14 7.782
3 5.689 2 16 5 3.349
Total 20.635 2 72 19 9.251
Grouping numbers for hybrid configurations
Deficiency Average Min Max Median St. Dev.
0 7.208 1 46 6 4.938
1 10.491 1 56 9 7.031
2 7.949 1 53 6 5.613
3 5.013 1 36 4 3.393
4 3.429 1 24 3 2.327
5 3.069 1 16 2 1.906
6 2.863 1 8 2 1.69
Total 6.402 1 56 4 5.388
Grouping numbers for all test cases
Deficiency Average Min Max Median St. Dev.
0 13.24 1 66 10 10.534
1 13.666 1 72 12 9.111
2 8.345 1 68 7 5.992
3 5.013 1 36 4 3.393
4 3.429 1 24 3 2.327
5 3.069 1 16 2 1.906
6 2.863 1 8 2 1.69
Total 7.784 1 72 5 7.231

10
Q. Wang et al. Entertainment Computing 43 (2022) 100509

Table 4
Distribution of grouping numbers in the experiments
Distribution of grouping numbers for pure configurations

Deficiency Grouping numbers


1–10 11–20 21–30 31–40 41–50 51–60 >60
0 919 5648 3983 1927 600 165 17
1 7780 43276 27406 9090 2750 661 102
2 4006 7319 2314 602 113 28 4
3 82 8 0 0 0 0 0
Total 12787 56251 33703 11619 3463 854 123
Percentage 10.763% 47.349% 28.37% 9.78% 2.915% 0.719% 0.104%
Distribution of grouping numbers for hybrid configurations
Deficiency Grouping numbers
1–10 11–20 21–30 31–40 41–50 51–60 >60
0 16846 3561 386 44 5 0 0
1 127110 67840 15649 3093 348 4 0
2 201646 54786 8301 1142 113 2 0
3 301790 20416 984 19 0 0 0
4 222697 3269 8 0 0 0 0
5 49348 248 0 0 0 0 0
6 5004 0 0 0 0 0 0
Total 924441 150120 25328 4298 466 6 0
Percentage 83.686% 13.59% 2.293% 0.389% 0.042% 0% 0%
Distribution of grouping numbers for all test cases
Deficiency Grouping numbers
1–10 11–20 21–30 31–40 41–50 51–60 >60
0 17765 9209 4369 1971 605 165 17
1 134890 111116 43055 12183 3098 665 102
2 205652 62105 10615 1744 226 30 4
3 301872 20424 984 19 0 0 0
4 222697 3269 8 0 0 0 0
5 49348 248 0 0 0 0 0
6 5004 0 0 0 0 0 0
Total 937228 206371 59031 15917 3929 860 123
Percentage 76.605% 16.868% 4.825% 1.301% 0.321% 0.07% 0.01%

numbers for pure configurations reaches 20.635, they only account for a figurations. Through experimental results, we can see that the value of
small proportion in all test cases. The distribution of grouping numbers deficiency is basically in inverse proportion to run-time and grouping
are presented in Table 4. We see that there are 58.112% of pure con­ numbers, and solving pure configurations takes higher computational
figurations with grouping numbers from 1 to 20, and up to 83.686% of cost than hybrid configurations. In our experiments, the deficiency of
hybrid configurations with grouping numbers from 1 to 10. On the each Mahjong configuration can be computed less in under one fiftieth
whole, 76.605% of test cases can be solved within the grouping number of a second, and the average run-time is only 0.299 millisecond, which
10. proves the very efficiency of our approach. However, there is still a long
Considering pure configurations in our experiments, there are only way to go for the research on Mahjong topic. On the one hand, the works
123 test cases with more than 60 groupings, which accounts for only on the developments of AI players for Chinese Mahjong are still limited;
0.104%, while for the hybrid configurations, all test cases can be solved on the other hand, more intelligent and interesting games on Mahjong
within 60 groupings. In particular, the grouping numbers of the including PC and online games are expected.
following three pure configurations are more than 70:
(1) B1 B3 B4 B4 B5 B5 B5 B6 B6 B6 B7 B7 B8 B8 , Declaration of Competing Interest
(2) B1 B3 B4 B4 B5 B6 B6 B7 B7 B7 B8 B8 B9 B9 ,
(3) B2 B4 B5 B5 B6 B6 B6 B7 B7 B7 B8 B8 B9 B9 . The authors declare that they have no known competing financial
interests or personal relationships that could have appeared to influence
The deficiencies of all above configurations are 1, and they are dealt the work reported in this paper.
with 72 groupings. We see that there is no isolated tile in these config­
urations, and all tiles are directly or indirectly related to each other, Acknowledgements
which leads to the increment of grouping numbers. Nevertheless, the
algorithm is able to solve each test case less in under one fiftieth of a The authors thank Professor Sanjiang Li and Xueqing Yan for
second. Hence, this approach is a low-cost and efficient method to numerous discussions on the notions and results presented in the current
compute the deficiency of Mahjong configurations. paper.

9. Conclusions References

In this paper, we presented an efficient algorithmic approach for [1] The origins of mahjong, http://www.mahjongsets.co.uk/origins-mahjong.html.
[2] Wikipedia, Mahjong, https://en.wikipedia.org/wiki/Mahjong.
calculating the deficiency of Mahjong configurations. The algorithm first [3] BaiduBaike, Mahjong, https://baike.baidu.com/item/%E9%BA%BB%E5%B0%86/
divides the tiles of the given Mahjong configuration into some groups 215?fr=aladdin.
such as pseudomelds and relatively isolated tiles, and then determines [4] S. Li, X. Yan, Let’s play mahjong, arXiv: 1903.03294v1 (2019).
[5] Q. Wang, Y. Li, X. Chen, A mahjong-strategy based on weighted restarting
the deficiency based on the numbers of pseudomelds and relatively
automata, in: 2020 The 3rd International Conference on Machine Learning and
isolated tiles. In order to evaluate the performance of our approach, we Machine Intelligence, MLMI ’20, Association for Computing Machinery, New York,
established more than 1.2 million test cases for various deficiencies, NY, USA, 2020, p. 117–121.
[6] M. Bowling, N. Burch, M. Johanson, O. Tammelin, Heads-up limit hold’em poker is
including all the pure configurations and c.a. 1.1 million hybrid con­
solved, Commun. ACM 60 (11) (2017) 81–88.

11
Q. Wang et al. Entertainment Computing 43 (2022) 100509

[7] O. Calin, Optimal training for adversarial games, Ann. Math. Artif. Intell. 89 (5–6) [22] F. Mráz, F. Otto, On shrinking restarting automata of window size one and two, in:
(2021) 575–594. P. Hofman, M. Skrzypczak (Eds.), Developments in Language Theory - 23rd
[8] T. Engesser, R. Mattmüller, B. Nebel, M. Thielscher, Game description language International Conference, DLT 2019, Warsaw, Poland, August 5–9, 2019,
and dynamic epistemic logic compared, Artif. Intell. 292 (2021) 103433. Proceedings, Vol. 11647 of Lecture Notes in Computer Science, Springer, 2019, pp.
[9] S. Talatahari, M. Azizi, Chaos game optimization: a novel metaheuristic algorithm, 140–153.
Artif. Intell. Rev. 54 (2) (2021) 917–1004. [23] F. Mráz, F. Otto, D. Pardubská, M. Plátek, Lexicalized syntactic analysis by two-
[10] S. Zhang, M. Liu, X. Lei, P. Yang, Y. Huang, R.A. Clark, Synchronous intercept way restarting automata, J. Autom. Lang. Comb. 26 (1–2) (2021) 145–171.
strategies for a robotic defense-intrusion game with two defenders, Auton. Robots [24] F. Mráz, D. Pardubská, M. Plátek, J. Síma, Pumping deterministic monotone
45 (1) (2021) 15–30. restarting automata and DCFL, in: M. Holena, T. Horváth, A. Kelemenová, F. Mráz,
[11] L. Chen, S. Lin, C. Chen, Jump wins chinese checkers tournament, J. Int. Comput. D. Pardubská, M. Plátek, P. Sosík (Eds.), Proceedings of the 20th Conference
Games Assoc. 42 (1) (2020) 46–48. Information Technologies - Applications and Theory (ITAT 2020), Hotel Tyrapol,
[12] D. Silver, A. Huang, C.J. Maddison, A. Guez, L. Sifre, G. van den Driessche, Oravská Lesná, Slovakia, September 18–22, 2020, Vol. 2718 of CEUR Workshop
J. Schrittwieser, I. Antonoglou, V. Panneershelvam, M. Lanctot, S. Dieleman, Proceedings, CEUR-WS.org, 2020, pp. 51–58.
D. Grewe, J. Nham, N. Kalchbrenner, I. Sutskever, T.P. Lillicrap, M. Leach, [25] A. Midya, F.W. Vaandrager, D.G. Thomas, C. Ghosh, Simulating parallel internal
K. Kavukcuoglu, T. Graepel, D. Hassabis, Mastering the game of go with deep column contextual array grammars using two-dimensional parallel restarting
neural networks and tree search, Nat. 529 (7587) (2016) 484–489. automata with multiple windows, in: T. Lukic, R.P. Barneva, V.E. Brimkov, L.
[13] G. Wölflein, O. Arandjelovic, Determining chess game state from an image, Comic, N. Sladoje (Eds.), Combinatorial Image Analysis - 20th International
J. Imaging 7 (6) (2021) 94. Workshop, IWCIA 2020, Novi Sad, Serbia, July 16–18, 2020, Proceedings, Vol.
[14] N. Brown, T. Sandholm, Safe and nested subgame solving for imperfect- 12148 of Lecture Notes in Computer Science, Springer, 2020, pp. 106–122.
information games, in: I. Guyon, U. von Luxburg, S. Bengio, H.M. Wallach, R. [26] F. Otto, K. Kwee, On the descriptional complexity of stateless deterministic ordered
Fergus, S.V.N. Vishwanathan, R. Garnett (Eds.), Advances in Neural Information restarting automata, Inf. Comput. 259 (2) (2018) 277–302.
Processing Systems 30: Annual Conference on Neural Information Processing [27] F. Otto, A complete taxonomy of restarting automata without auxiliary symbols,
Systems 2017, December 4–9, 2017, Long Beach, CA, USA, 2017, pp. 689–699. Fundam. Informaticae 180 (1–2) (2021) 77–101.
[15] J. Jian, B. Zeng, Z. Mao, Multi-objective optimization approach to pure strategy [28] M. Straňáková, Selected types of pg-ambiguity: Processing based on analysis by
equilibria in games with imperfect information, IEEE Control. Syst. Lett. 5 (6) reduction, in: P. Sojka, I. Kopeček, K. Pala (Eds.), Text, Speech and Dialogue, Lect.
(2021) 2162–2167. Notes Comput. Sci., Vol. 1902, Springer, Heidelberg, 2000, pp. 139–144.
[16] G. Jiang, D. Zhang, L. Perrussel, H. Zhang, Epistemic GDL: A logic for representing [29] F. Otto, Q. Wang, Weighted restarting automata, Soft Comput. 22 (4) (2018)
and reasoning about imperfect information games, Artif. Intell. 294 (2021) 1067–1083.
103453. [30] Q. Wang, On the expressive power of weighted restarting automata, in: R. Freund,
[17] Y. Cheng, C.-K. Li, S.H. Li, Mathematical aspect of the combinatorial game F. Mráz, D. Prusa (Eds.), Ninth Workshop on Non-Classical Models of Automata
mahjong, Southeast Asian Bulletin of Mathematics 43 (2019) 815–826. and Applications, NCMA 2017, Prague, Czech Republic, August 17-18, 2017,
[18] The mahjong guide, https://mahjong.guide/a-beginners-guide-to-riichi-mahjong/. Österreichische Computer Gesellschaft, 2017, pp. 227–241.
[19] S. Gao, F. Okuya, Y. Kawahara, Y. Tsuruoka, Building a computer mahjong player [31] Q. Wang, Weighted restarting automata, Ph.D. thesis, University of Kassel,
via deep convolutional neural networks, CoRR abs/1906.02146. Germany, 2018.
[20] N. Mizukami, Y. Tsuruoka, Building a computer mahjong player based on monte [32] Q. Wang, Languages accepted by weighted restarting automata, Fundam.
carlo simulation and opponent models, in: 2015 IEEE Conference on Informaticae 180 (1–2) (2021) 151–177.
Computational Intelligence and Games, CIG 2015, Tainan, Taiwan, August 31 - [33] Q. Wang, F. Otto, Weighted restarting automata and pushdown relations, Theor.
September 2, 2015, IEEE, 2015, pp. 275–283. Comput. Sci. 635 (2016) 1–15.
[21] P. Jancar, F. Mráz, M. Plátek, J. Vogel, Restarting Automata, in: H. Reichel (Ed.), [34] Q. Wang, F. Otto, Weighted restarting automata as language acceptors, in: Y. Han,
Proceedings of the 11th International Symposium on Fundamentals of K. Salomaa (Eds.), Proceedings of the 21st International Conference on
Computation Theory, Vol. 965 of Lecture Notes in Computer Science, Springer, Implementation and Application of Automata, Vol. 9705 of Lecture Notes in
Heidelberg, 1995, pp. 283–292. Computer Science, Springer, Switzerland, 2016, pp. 298–309.

12

You might also like