• 沒有找到結果。

On the fairness and complexity of generalized k-in-a-row games

N/A
N/A
Protected

Academic year: 2021

Share "On the fairness and complexity of generalized k-in-a-row games"

Copied!
13
0
0

加載中.... (立即查看全文)

全文

(1)

www.elsevier.com/locate/tcs

On the fairness and complexity of generalized k-in-a-row games

Ming Yu Hsieh, Shi-Chun Tsai

1001 University Road, Department of Computer Science, National Chiao Tung University, Hsinchu, Taiwan Received 10 June 2006; received in revised form 27 February 2007; accepted 23 May 2007

Communicated by A. Fraenkel

Abstract

Recently, Wu and Huang [I.-C. Wu, D.-Y. Huang, A new family of k-in-a-row games, in: The 11th Advances in Computer Games Conference, ACG’11, Taipei, Taiwan, September 2005] introduced a new game called Connect6, where two players, Black and White, alternately place two stones of their own color, black and white respectively, on an empty Go-like board, except for that Black (the first player) places one stone only for the first move. The one who gets six consecutive (horizontally, vertically or diagonally) stones of his color first wins the game. Unlike Go-Moku, Connect6 appears to be fairer and has been adopted as an official competition event in Computer Olympiad 2006.

Connect(m, n, k, p, q) is a generalized family of k-in-a-row games, where two players place p stones on an m × n board

alternatively, except Black places q stones in the first move. The one who first gets his stones k-consecutive in a line (horizontally, vertically or diagonally) wins. Connect6 is simply the game of Connect(m, n, 6, 2, 1). In this paper, we study two interesting issues of Connect(m, n, k, p, q): fairness and complexity. First, we prove that no one has a winning strategy in Connect(m, n, k, p, q) starting from an empty board when k ≥ 4p + 7 and p ≥ q. Second, we prove that, for any fixed constants k, p such that

k− p ≥ max{3, p} and a given Connect(m, n, k, p, q) position, it is PSPACE-complete to determine whether the first player has

a winning strategy. Consequently, this implies that Connect6 played on an m× n board (i.e., Connect(m, n, 6, 2, 1)) is PSPACE-complete.

c

 2007 Elsevier B.V. All rights reserved.

Keywords: k-in-a-row games; Computational complexity; Mathematical games

1. Introduction and preliminaries

The game family k-in-a-row, or (m, n, k)-Games, is well-known and has been studied for a while. It is a two-player game played on an m× n board. Two players P1 and P2 alternatively place one black and one white stone,

respectively, on an unoccupied square on the board and the one who first gets his stones k-consecutive in a line (horizontally, vertically or diagonally) wins. Some of the special(m, n, k)-games, such as TicTacToe ((3, 3, 3)-game) and Go-Moku ((19, 19, 5)-game), are very popular worldwide. Moreover, there are many other modified versions, such as Maker–Breaker version, Inverse version, Periodic version, Higher dimensions version, Multi-Player version

Corresponding author. Tel.: +886 3 5131551.

E-mail addresses:myuhsieh@csie.nctu.edu.tw(M.Y. Hsieh),sctsai@csie.nctu.edu.tw(S.-C. Tsai). 0304-3975/$ - see front matter c 2007 Elsevier B.V. All rights reserved.

(2)

it is hard to force opponent’s stones to be k-in-a-row. The board of Periodic k-in-a-row game has some modifications: the left connects with the right, and the top connects with the bottom. As for the Higher dimensions version and the Multi-Player version, it just extends the board into three or more dimensions and extends two players to three or more players, respectively. Such modified versions are interesting and generally studied in theoretical computer science and combinatorial game theory.

In this paper, we study a new family of generalized k-in-a-row games: Connect(m, n, k, p, q), which was introduced by Wu and Huang [14]. In Connect(m, n, k, p, q), two players place p stones on an m × n board alternatively, except Black places q stones in the first step. The one who first gets his stones k-consecutive in a line (horizontally, vertically or diagonally) wins. For example, TicTacToe is a Connect(3, 3, 3, 1, 1) game, Go-Moku is a Connect(19, 19, 5, 1, 1) game and Connect6 is simply a Connect(m, n, 6, 2, 1) game. For convenience,

Connect(∞, ∞, k, p, q) is denoted as Connect(k, p, q) [14]. W.L.O.G., we can assume that max{m, n} ≥ k > p ≥

q> 0. Recently, Connect6 has become an official competition event in the 11th Computer Olympiad in 2006 because

of its fairness and state-space complexity. For further fairness and state-space complexity discussion of Connect6, we refer to Wu and Huang’s paper [14].

Talking about (generalized) k-in-a-row games, fairness is considered to be the most interesting issue. Herik et al. [13] gave a definition of fairness as follows.

Definition 1 ([13]). A game is fair if (1) this game has a draw for two perfect players and (2) both players have a

roughly equal probability of making a mistake.

However, it is hard to prove that whether both players have a roughly equal probability on making a mistake in general. Wu and Huang [14] gave some empirical results for small cases with k ≤ 9 and k − p ≤ 3. For convenience, this paper focuses on the first part of fairness defined above, i.e., for two perfect players, whether

Connect(m, n, k, p, q) has a draw or who can win? There are some partial results for this question. For example,

the strategy-stealing argument shows that P2 has no winning strategy when q ≥ p : Suppose P2 has a winning

strategy, then P1can make the first move randomly, act as the second player and win by stealing P2’s strategy, which

leads to a contradiction. Moreover, for p = q = 1, Herik et al. [13] listed resolved cases for k ≤ 5, while Zetters [16] proved that P2can tie the infinite game when k ≥ 8 and as a consequence on any finite board. The cases when k= 6, 7 are still unknown. As for the results of the generalized k-in-a-row games, Wu and Huang [14] showed that

P1can win Connect(k, p, q) when p < δq2(4δ + 4) + min(q mod δ

2, 8q

δ2), where δ = k − p. Pluh´ar [9] showed

that P2can tie Connect(k, p, q) when k ≥ p + 80 log2p+ 160 and q = p ≥ 1000, and as a consequence that no one

has a winning strategy in Connect(m, n, k, p, q) for any m, n when k ≥ p + 80 log2p+ 160 and p ≥ q. However,

this bound can be large even for small p. In Section2, we give a better result for small p. Indeed, we prove that no one has a winning strategy in Connect(m, n, k, p, q) for any m, n when k ≥ 4p + 7 and p ≥ q. As a result, our bound is better than Pluh´ar’s bound for smaller p(≤ 265), although their result is asymptotically better.

Another important issue, for mathematical games, is complexity. The hardness of many popular “small” games is not as easy as we think. Furthermore, two-player games are often more complicated than one-player games. For example, it is shown to be PSPACE-complete for Go-moku [10] and Othello [1], EXPTIME-complete for Checkers [11], while NP-complete for Minesweeper [3]. For further readings, we refer to Nowakowski’s books [6,7]. In Section3, we study the complexity of Connect(m, n, k, p, q).

Definition 2 ([4,8,12]). A problem is said to be PSPACE-complete if it can be solved within polynomial space and

every problem solvable in polynomial space can be reduced to it in polynomial time. (Note that polynomial space/time mentioned here is with respect to the input size.)

Definition 3. For any fixed constants k, p and given an arbitrary Connect(m, n, k, p, q) game position, the decision

(3)

We will prove that the decision Connect(m, n, k, p, q) problem is PSPACE-complete for k − p ≥ max{3, p} by reducing the generalized geography game played on a planar bipartite graph of maximum degree 3 to it. The generalized geography game is a two-player game (∃-player and ∀-player) on a directed graph. The ∃-player starts from a specific marked starting vertex, and both players alternatively mark any unmarked vertex to which there is an arc from the last marked vertex. The one who cannot mark a vertex anymore loses the game. Sipser [12] showed that the generalized geography game is PSPACE-complete.

Theorem 1 ([4,8,12]). Generalized geography played on a planar bipartite graph of maximum degree 3 is PSPACE-complete.

A key idea of the reduction is to “embed” a graph into the connect game board, and thus two players will be forced to play the geography game in effect. To ensure the embedding can be done in polynomial time, the following theorem is useful.

Theorem 2 ([2]). There is a linear time algorithm to draw any planar graph of maximum degree 3 on aV2 × V2 grid orthogonally, where V is the number of vertices. Moreover, each edge has at most 1 bend.

Once the instance of the geography game is drawn orthogonally on a grid, we can transform it into a connect game board efficiently. We will show the details of the reduction in Section3. We also need the following definition of threat in a game.

Definition 4 ([14]). In a Connect(m, n, k, p, q) game, a player is said to have t threats, if and only if his opponent

needs to place t stones to prevent him from winning on his next move.

There are other interesting implementation issues, such as game strategy, search technique and so on, which are typically addressed in artificial intelligence. Wu and Huang’s paper [14] shows some related results and useful references. In this paper, we focus on the theoretical foundation of the games.

2. Fairness

Since we have shown that P2has no winning strategy when q≥ p, by the strategy-stealing argument, we focus on

the cases when q≤ p in this section. The following is our first result.

Theorem 3. No one has a winning strategy in Connect(m, n, k, p, q) for any m, n with max{m, n} ≥ k when q ≤ p

and k≥ 4p + 7.

To proveTheorem 3, we define a new game modified from the Maker–Breaker game, denoted as m M B(n, p) for short, which is a two-player game played on an n× n board. In move 2i − 1, i ∈ N, P1can choose an integer t,

1≤ t ≤ p, and then P1and P2are required to place exactly t black stones and t white stones in move 2i−1 and move

2i , respectively, until there is a winner or no more empty squares. If there exist n black stones in a line (horizontally or vertically, but not diagonally), then P1wins, else P2wins. Since it can be easily verified that P1wins when p≥ n − 1

(i.e., P1can pick t= 1 on his first move and then pick t = n − 1 and place n − 1 black stone to have n black stones

in a line on his second move), we can assume p ≤ n − 2. In the following, we will focus on the mM B(n, p) game, and our goal is to prove that P2has a winning strategy, i.e., preventing P1from winning. For convenience, we define

environment variables ri for the i -th row, 1≤ i ≤ n. The value of ri is equal to−1 if there exists a white stone in the i -th row; otherwise, ri indicates the number of black stones in the i -th row. The environment variables cj for the j -th

column, 1≤ j ≤ n, are defined similarly, and we let R = {ri|1 ≤ i ≤ n} and C = {ci|1 ≤ i ≤ n}. Moreover, we use (x, y) = B and W to denote that square (x, y) has a black stone and a white stone respectively, and E for empty. We

will use a “loop invariant” as shown inLemma 1to prove that P1cannot win, where a “loop” consists of one move of P1and the countermove of P2. We call C∪ R safe if (1) P1cannot win, and (2) there is at most one variable in C∪ R

that is positive and no variable is greater than 1.

Lemma 1. In an m M B(p + 2, p) game position, assume C ∪ R is safe. Then for each move by P1, there is a move

(4)

Fig. 1. Three types of tiles of size(p + 2) × (p + 2), for p = 2.

Proof. Since at most one variable is positive, say ci = 1, there are at most p + 1 black stones in a line after P1’s

move. Note that P1wins if and only if there are p+ 2 black stones in a column or row. We prove the rest by induction

on the integer t that P1chooses. P2’s response is given in the induction step below.

Basis: (t = 1) By assumption, there is at most one variable ci with value 1. Assume P1places one black stone at (a, b). First, we consider the case when b = i and thus ra ≤ 1, cb ≤ 1, ci ≤ 1, since there may be white stone(s)

in row a or column b. If(a, i) = W or (a, i) = E in which case P2can place a white stone at(a, i), then we have

ra = −1, cb≤ 1, ci = −1 and the lemma holds. Suppose (a, i) = B, then ra = −1 by the assumption that there is

only one variable ci = 1. Hence if there is already one white stone in the i-th column or P2places a white stone at

any empty square in the i -th column, then we are done with at most one variable cb = 1. Next, we consider the case

when b= i and then we have ra ≤ 1 and ci ≤ 2. Since there must be an empty square in column i, P2can place a

white stone in the i -th column, and then this lemma holds with at most one variable ra = 1.

Induction: Assume it is true for all t up tow < p. Consider the case t = w + 1. By the hypothesis, P2has a response Swusingw white stones against the first w black stones P1placed by ignoring the existence of the(w + 1)-st black stone. Assume P1placed the (w+1)-st black stone at (a, b). If Swdoesn’t place a white stone at(a, b), then it reduces

to the case t= 1. If Swchooses(a, b), we know that there are at most three variables with positive values (i.e. ra> 0,

cb > 0, ci ≤ 1), and P2still has two white stones to play (i.e., the one placed at(a, b) is withdrawn). Then P2can

place the two white stones in the a-th row and the b-th column, and we are done with ci ≤ 1. 

Lemma 2. P2has a winning strategy in m M B(p + 2, p).

Proof. Since all variables in C∪R are zero in the beginning, byLemma 1, we know that P2has a winning strategy. 

Then we have the following obvious consequence.

Corollary 1. P2can win m M B(n, p), when n ≥ p + 2.

Lemma 3. P2can tie Connect(k, p, q) when q ≤ p and k ≥ 4p + 7.

Proof. The strategy for P2is by divide-and-conquer:

1. Tile the game board with infinite many(p + 2) × (p + 2) tiles as shown inFig. 2(an example of p+ 2 = 4). There are three types of tiles: A, B and C as shown inFig. 1. Tile B and C are just “twisted” from tile A.

2. In each tile where P1placed black stones, P2responds with the same number of white stones in it. This is possible

since q≤ p. If q < p, P2has an extra p− q white stones to play in the following move.

3. Play m M B(p + 2, p) game in each tile, where P2has enough white stones to play. Note that when playing in a twisted tile P1tries to get(p + 2) black stones horizontally or diagonally. ByLemma 2, we know that P2has a

strategy such that there are at most p+ 1 black stones in a line in each tile A (horizontally or vertically), at most

p+ 1 black stones in a line in each tile B (horizontally or diagonally down), and at most p + 1 black stones in a

line in each tile C (horizontally or diagonally up).

In the whole game board (refer toFig. 2), since there are at most ( p+ 1)-consecutive black stones in a vertical line in section{Ai} and at most (p + 2)-consecutive black stones in a vertical line in section {Bi, Ci}, we obtain that there

are at most(4p + 6)-consecutive black stones in a vertical line, i.e., (p + 1) in A1,(p + 2) in B2,(p + 2) in C2, and

(p +1) in A2. Similarly, there are also at most(4p +6)-consecutive black stones in a diagonal line (diagonally up and diagonally down). As for the horizontal line, since there are at most(p + 1) black stones in section {Ai, Bi, Ci}, there

are at most(2p + 2)-consecutive black stones in a horizontal line. We show the longest possible black lines with the shaded cells inFig. 2. From the above, we get the desired result: there are at most(4p + 6)-consecutive black stones in a line (horizontally, vertically and diagonally). 

(5)

Fig. 2. The game board is divided into infinite many 4× 4 tiles.

Corollary 2. P2can tie Connect(m, n, k, p, q) for any m, n when q ≤ p and k ≥ 4p + 7.

Proof. It is obvious that the strategy for P2shown in the proof ofLemma 3can be applied to any finite board. 

Proof ofTheorem 3. This is true since P1can adopt the strategy for P2, shown inLemma 3as well. 

3. PSPACE-completeness

In this section, we investigate the computational complexity of the decision Connect(m, n, k, p, q) problem. Recall that the decision Connect(m, n, k, p, q) problem is to determine whether P1has a winning strategy when given an arbitrary non-empty Connect(m, n, k, p, q) position, where k and p are fixed constants. Since the given game position in the decision problem is not an empty board, q is irrelevant. We will show that the decision Connect(m, n, k, p, q) problem is PSPACE-complete when k− p ≥ max{3, p}.

Lemma 4. The decision Connect(m, n, k, p, q) problem is in PSPACE.

Proof. Since this game must end in O(mn) steps, this problem can be computed by an alternating Turing machine in

polynomial time. We know that ATIME(poly) = PSPACE [12]. Hence, this problem is in PSPACE. 

The next step is to show the PSPACE-hardness of the decision Connect(m, n, k, p, q) problem. It is already known for the case p= 1.

Lemma 5 ([10]). The decision Connect(m, n, k, p, q) problem is PSPACE-hard when k ≥ 5 and p = 1.

We focus on the case p ≥ 2 as follows. We show a polynomial time reduction from the generalized geography game played on a planar bipartite graph of maximum degree 3 to the decision Connect(m, n, k, p, q) problem. For an arbitrary generalized geography game, we will construct a corresponding Connect(m, n, k, p, q) game position, where m, n are polynomial in terms of the input size and q is negligible, such that the ∃-player has a winning strategy in the generalized geography game if and only if P1has a winning strategy from the constructed game position.

The main difference between Go-Moku and Connect(m, n, k, p, q) is that each player can place more than one stone in a move in Connect(m, n, k, p, q) game. In order to deal with this difference, we construct the connect game position with one simulation zone, one winning zone and p− 1 auxiliary zones, as shown inFig. 3. The key idea behind the construction is to force each player to place exactly one stone in each of the p− 1 auxiliary zones and

(6)

Fig. 3. The global view of the constructed connect game position.

Fig. 4. (a) The constructed position in the winning zone. (b) The constructed position in an auxiliary zone.

the simulation zone until the play in the simulation zone terminates, which means no more stone will be placed in the simulation zone. The constructed position in the simulation zone, in effect, forces P1and P2to play the generalized

geography game. The winner in the simulation zone, can then place stones in the winning zone and will win. Next, we show the constructed position of each zone in detail.

Construction of winning zone and auxiliary zones:

The constructed position in the winning zone is shown inFig. 4(a) and the constructed position in an auxiliary zone is shown inFig. 4(b). Note that the constructed positions of the p− 1 auxiliary zones are the same and the number of the repeated patterns will be determined later. InFig. 4, we find that no one has a threat in the winning zone (there are only k− p − 1 black and white stones, respectively), and P2has exactly one threat in each auxiliary zone (the (k − p)-consecutive white stones on the left-hand side), hence p − 1 threats in total, while P1has no threat in any of the auxiliary zones yet.

Construction of simulation zone:

We construct the simulation zone from an instance of the geography game. The purpose is to force two players to play the generalized geography game in the simulation zone. For a planar bipartite geography graph with maximum degree 3, we will first applyTheorem 2to draw it orthogonally on a grid, and then construct a corresponding game position in the simulation zone. Next, we give the corresponding constructed positions of the vertices and arcs, which are represented as gadgets. We use the gadgets to construct the desired connect position. Since the vertices and arcs are represented as gadgets, we can use copies of their mirror images or rotate them 90◦, 180◦or 270◦whenever necessary.

(7)

Fig. 5. (1a) and (1b) are two kinds of vertices with in-degree and degree 1. (2a) and (2b) are two kinds of vertices with in-degree 2 and out-degree 1. (3a) and (3b) are two kinds of vertices with in-out-degree 1 and out-out-degree 2. The other possibilities can be obtained by flipping or rotating the above.

Fig. 6. Vertices with in-degree 1 and out-degree 1 correspond toFig. 5(1a) and (1b), where node a indicates the entry point and node h the exit point.

In the construction, each vertex has one or more entry points and exit points (since there are 3 types of vertices to be defined later) and each arc has a head point and a tail point. More specifically, for an arc(u, v), the head point of its corresponding gadget will connect (overlap) the corresponding exit point of u’s gadget, and its gadget tail point will connect (overlap) the corresponding entry point ofv’s gadget. We show the constructions of gadgets as follows.

Gadgets for vertices:

Since the Connect(m, n, k, p, q) game is a two-player game and the generalized geography game is played on a bipartite graph, we can divide all vertices into two groups, Black and White. Moreover, the starting vertex belongs to Black, and w.l.o.g., we will illustrate the constructed positions of the vertices in the Black group as in the following examples. The constructed positions of the vertices in the White group can be obtained by exchanging the colors. According to [4,8], there are only three types of vertices in the generalized geography game played on a bipartite graph with maximum degree 3, i.e., (1) in-degree 1 and out-degree 1, (2) in-degree 2 and out-degree 1, (3) in-degree 1 and out-degree 2, and for each we construct two kinds of positions as shown inFig. 5. The constructed positions of the six kinds of vertices are shown inFigs. 6–8. InFig. 6, the entry point is at a and the exit point is at h. InFig. 7, the two entry points are at a and e, and the exit point is at z. InFig. 8, the entry point is at a and the two exit points are at u and z.

Gadgets for arcs:

There are two types of arcs: (1) from a vertex in the Black group to a vertex in the White group, and (2) from the White group to the Black group. W.L.O.G., we show the construction of type-1 arcs, and type-2 arcs can be obtained by exchanging the colors of the stones. ByTheorem 2, we can assume that each arc is horizontal, vertical, or composed of a horizontal segment and a vertical segment. The constructed position of the bend of an arc is shown inFig. 9(c). Since the usage of a bend is to connect a vertical segment and a horizontal segment, we can view it as a special vertex with the entry point at a and exit point at i . Furthermore, each straight arc and straight segment may consist of several unit components as shown inFig. 9(a), and we define the distance between a and c as a unit for convenience (that is, each unit equals 2(k − p) in the game board and suppose each side of the cell in the game board has length 1). Thus each arc gadget is of integer unit of length. Moreover, the head point of the arc shown inFig. 9(b) is at a and the tail point is at e.

(8)

Fig. 7. Vertices with in-degree 2 and out-degree 1 correspond toFig. 5(2a) and (2b), where nodes a and e indicate the entry points and z for the exit point.

Fig. 8. Vertices with in-degree 1 and out-degree 2 correspond toFig. 5(3a) and (3b), where nodes u and z indicate the exit points and a for the entry point.

(9)

Fig. 10. A starting vertex with in-degree 1 and out-degree 1 corresponds to Figure5.

Putting it together:

To obtain the desired connect position in the simulation zone, we need to deal with: (1) the starting vertex and (2) embedding the geography graph into the game board correctly. First the construction of the starting vertex is easy. Since there are only six kinds of vertices, we have six kinds of starting vertices. The constructed position of a starting vertex with in-degree 1 and out-degree 1, as shown inFig. 10, is modified fromFig. 6(a). The location a is replaced with a black stone and location b with a white stone. The constructed positions of the starting vertex of the other five kinds can be obtained similarly as follows. In Fig. 6(b), replace a with a black stone and b with a white stone. In

Fig. 7, replace a, e, c, g with black stones and b, f, d, h with white stones. InFig. 8, replace a with a black stone and

b with a white stone. Note that, in the simulation zone, P2has exactly one threat in the starting vertex (refer toFig. 10

for example) while P1has no threat.

Second, we need to embed the geography graph into the game board. ByTheorem 2, we can assume the geography graph is drawn orthogonally on aV2 × V2 grid, where V is the number of vertices in the geography graph. Next, we map(i, j) in the grid to (t × L × i + 3 × L, t × L × j + 3 × L) in the game board, where L = 2(k − p) and

t is a large enough constant (for instance, 5 is enough). The reason why we add 3× L is to reserve spaces for the

boundaries.

The constructed position of each vertex has a center point, and we will put the center point at the corresponding coordinate of the vertex. Note that the bend of an arc is viewed as a special vertex. Both of the center points inFig. 6

(Figs. 7and8) are at e (i and e respectively). The center point of a bend as inFig. 9(c) is at e. InFig. 6(a) and6(b), the distance between the center point and the entry (exit) point has 32units of length. Moreover, the entry (exit) point and the center point is either in the same vertical or horizontal line. The same properties also hold inFigs. 7,8and

9(c).

Now we are going to connect the head (tail) point of an arc gadget with the exit (entry respectively) point of the corresponding vertex gadget. Since each arc is of integer units of length, and its corresponding entry point and exit point lie in a line (we can view the bend as a vertex here) with distance a multiple of unit length, we can connect the vertex gadgets and the arc gadgets correctly.

An example with k− p = 4 (ignoring the boundaries) is shown inFig. 11. The starting vertex is located at (0,0). The vertices located at{(0,0), (1,1), (0,2)} belong to the Black group, and those located at {(0,1), (1,0), (1,2)} belong to the White group. The corresponding vertex gadgets in the game board are shadowed with gray color.

Correctness:

We now argue that the constructed position will mimic a generalized geography game if both of the players play “correctly”. If a player does not play correctly, then it leads to a losing game within a few moves. Let us consider the case that the starting vertex is of in-degree 1 and out-degree 1 as shown inFig. 10. The arguments for the other five cases are similar.

Proposition 1. ConsiderFigs. 4(b) and10. In the first move, if P1does not place stones at one of c1, c2, . . . , cppoints inFig. 10and one of a1, a2, . . . , apinFig. 4(b) in each of the auxiliary zones, then P2can win immediately.

(10)

Fig. 11. An example with k− p = 4 and the starting vertex gadget is located at (0,0).

Proof. Since P1has no threat, he cannot win in the first move. W.L.O.G., assume that P1does not place stone at any

(11)

Proposition 2. P1will have p threats against the second move if and only if he places stones at c1inFig. 10and a1 inFig. 4(b) in each of the auxiliary zones in the first move. Moreover, P2has no threat before the second move.

Proof. Clear. 

Proposition 3. P2will have p threats against the third move if and only if he places stones at d inFig. 10andw in

Fig. 4(b) in each of the auxiliary zones in the second move. Moreover, P1has no threat before the third move.

Proof. The same as forProposition 2. 

Proposition 4. In the first move, if P1does not place a black stone at c1inFig. 10or a1inFig. 4(b) in one of the auxiliary zones, then P2can win in two moves.

Proof. ByProposition 2, P1will have less than p threats in the second move. W.L.O.G., we can assume that P1has

no threat in the simulation zone (seeFig. 10). Then byProposition 3, P2can place p− 1 stones on w’s in the auxiliary

zones to get p− 1 threats and make P1have no threat. Moreover, P2can place one white stone at a in the winning

zone inFig. 4(a) to get 2 threats. Since P1has no threat and P2has more than p threats against the third move, P2can

win in the fourth move. 

Proposition 5. In the second move, if P2does not place a white stone at d inFig. 10orw inFig. 4(b) in one of the auxiliary zones, then P1can win within two moves.

Proof. Similar toProposition 4. 

The arguments for the following moves are similar and can be verified easily. Next, we show the cases of different situations.

Proposition 6. The constructed position inFig. 8(a) simulates a vertex of in-degree 1 and out-degree 2 in the Black

group.

Proof. According to the construction, when entering such a vertex, P1is forced to place a black stone at a, otherwise,

with a similar argument to the proof ofProposition 1, P1would lose. Then P2is forced to respond a white stone at b, P1is forced to respond a black at c, and then P2is forced to respond a white stone at d. Now, P1can respond at e or f since p > 1 (if p = 1, P1is forced to respond at e). Actually, the choice of e and f simulates a vertex with out-degree 2. The arguments for the following moves are straightforward. 

Proposition 7. The constructed position inFig. 8(b) simulates a vertex of in-degree 1 and out-degree 2 in the Black

group.

Proof. Similar toProposition 6. 

Proposition 8. If a player chooses to visit a visited vertex (not the starting vertex), then it leads to a losing game. Proof. W.L.O.G., assume P2revisits a vertex. Then this vertex must be of in-degree 2. ConsiderFig. 7(a). Assume

this vertex has been visited via the left entry point and hence there must be black stones at a, c and i, and white stones at b and d, otherwise P1would have lost the game earlier. Next, according to the construction of the connect position,

when reentering such a vertex, P1is forced to place one black stone at e, P2is forced to respond a white stone at f ,

and P1is forced to respond a black stone at g. Now, in the whole game board, P2has no threat and P1has p threats

byProposition 2. In the auxiliary zones, P2can get p− 1 threats in the following move and block P1’s threat there.

However, in the simulation zone (Fig. 7(a)), P2can only block P1’s threat but cannot create a new threat at the same

time, since there is already a black stone at i . Finally, similar to the argument inProposition 4, P2will lose in two

moves and P1will win. The case ofFig. 7(b) is similar. 

Proposition 9. If P2chooses to visit the starting vertex, then he will lose.

(12)

optimize the setting but reserve enough space, since k− p can be much smaller than p and cause interference among moves if we don’t require k− p ≥ p. The reason why k − p ≥ 3 is trivial, i.e., inFig. 7(a), there are two consecutive black stones next to b, and hence k− p must be greater than 2.

Finally, we have to make sure that the reduction can be done in polynomial time. We estimate the required size for each zone of the constructed position in the following:

1. Winning zone: O(k − p) × O(k − p), seeFig. 4(a).

2. Simulation zone: Since k and p are fixed constants, the size of the simulation zone is bounded by O(V ) × O(V ), referring toTheorem 2.

3. Auxiliary zone: We now determine the number of the repeated parts inFig. 4(b). Since we require that the play in the simulation zone always terminates a few moves earlier than the play in the auxiliary zones, the number of the repeated parts is related to the size of the simulation zone. Hence, the required size is O(1) × O(V ).

Therefore, we obtain that m = O(V ) and n = O(V ). Since the construction mentioned above can be done in polynomial time, we have the following lemma.

Lemma 6. The decision Connect(m, n, k, p, q) problem is PSPACE-hard when k − p ≥ max{3, p} and p ≥ 2. Theorem 4. The decision Connect(m, n, k, p, q) problem is PSPACE-complete when k − p ≥ max{3, p} and p ≥ 2. Proof. Immediate fromLemmas 4and6. 

Corollary 3. To determine whether P1 has a winning strategy in a given non-empty Connect6 game position is PSPACE-complete.

Proof. Immediate fromTheorem 4. 

Corollary 4. The decision Connect(m, n, k, p, q) problem is PSPACE-complete when k − p ≥ max{3, p}. Proof. Immediate fromLemma 5andTheorem 4. 

4. Conclusion and remarks

The main results in this paper are: (1) Fairness issue: no one can win Connect(m, n, k, p, q) for any m, n when

q ≤ p and k ≥ 4p + 7. (2) Complexity issue: The decision Connect(m, n, k, p, q) problem is PSPACE-complete

when k− p ≥ max{3, p}.

Open problems: (1) Can we have a better bound than the first result, since Zetters [16] showed that P2can tie the

game when k ≥ 8 for p = q = 1? (2) Is the decision Connect(m, n, k, p, q) problem still PSPACE-complete if we relax the restriction on k and p?

Acknowledgement

We appreciate the reviewers for their helpful comments and Janos Simon for showing us some useful references. The work is supported in part by the National Science Council of Taiwan under contract NSC-95-2221-E-009-094-MY3.

References

[1] S. Iwata, T. Kasai, The Othello game on an n× n board is PSPACE-complete, Theoretical Computer Science 123 (1994) 329–340. [2] G. Kant, Drawing planar graphs using the canonical ordering, Algorithmica 16 (1) (1996) 4–32.

[3] R. Kaye, Minesweeper is NP-complete, Mathematical Intelligencer 22 (2) (2000) 9–15.

[4] D. Lichtenstein, M. Sipser, Go is polynomial-space hard, Journal of the ACM 27 (1980) 393–401. [5] W.-J. Ma, Generalized Tic-tac-toe.http://www.klab.caltech.edu/˜ma/tictactoe.html, 2005.

(13)

[6] R.J. Nowakowski, Games of No Chance: Combinatorial Games at MSRI, Cambridge University Press, 1994. [7] R.J. Nowakowski, More Games of No Chance, Cambridge University Press, 2002.

[8] C.H. Papadimitriou, Computational Complexity, Addison Wesley Publishing Company, 1994. [9] A. Pluh´ar, The accelerated k-in-a-row game, Theoretical Computer Science 270 (2002) 865–875.

[10] S. Reisch, Gobang ist PSPACE-vollst¨andig (Gobang is PSPACE-complete), Acta Informatica 13 (1980) 59–66. [11] J.M. Robson, N by N Checkers is EXPTIME complete, SIAM Journal on Computing 13 (2) (1984) 252–267. [12] M. Sipser, Introduction to the Theory of Computation, PWS Publishing Company, 1997.

[13] H.J. van den Herik, J.W.H.M. Uiterwijk, J. van Rijswijck, Games solved: Now and in the future, Artificial Intelligence 134 (2002) 277–311. [14] I.-C. Wu, D.-Y. Huang, A new family of k-in-a-row games, in: The 11th Advances in Computer Games Conference, ACG’11, Taipei, Taiwan,

September 2005.

[15] J. Yolkowski, Tic-tac-toe.http://www.stormloader.com/ajy/tictactoe.html, 2003. [16] T.G.L. Zetters, 8(or more) in a row, American Mathematical Monthly 87 (1980) 575–576.

數據

Fig. 1. Three types of tiles of size (p + 2) × (p + 2), for p = 2.
Fig. 2. The game board is divided into infinite many 4 × 4 tiles.
Fig. 3. The global view of the constructed connect game position.
Fig. 6. Vertices with in-degree 1 and out-degree 1 correspond to Fig. 5(1a) and (1b), where node a indicates the entry point and node h the exit point.
+4

參考文獻

相關文件

• One technique for determining empirical formulas in the laboratory is combustion analysis, commonly used for compounds containing principally carbon and

After teaching the use and importance of rhyme and rhythm in chants, an English teacher designs a choice board for students to create a new verse about transport based on the chant

In this paper, we build a new class of neural networks based on the smoothing method for NCP introduced by Haddou and Maheux [18] using some family F of smoothing functions.

A subgroup N which is open in the norm topology by Theorem 3.1.3 is a group of norms N L/K L ∗ of a finite abelian extension L/K.. Then N is open in the norm topology if and only if

In summary, the main contribution of this paper is to propose a new family of smoothing functions and correct a flaw in an algorithm studied in [13], which is used to guarantee

Quantum Hall Effect in Black Phosphorus 2DEG.. Likai Li

In addition, to incorporate the prior knowledge into design process, we generalise the Q(Γ (k) ) criterion and propose a new criterion exploiting prior information about

Researches of game algorithms from earlier two-player games and perfect information games extend to multi-player games and imperfect information games3. There are many kinds of