You are on page 1of 3

A Network Representation of the Game of Go

Brian J. Olive
University of Central Florida
December 7, 2015
Abstract - The game of go is an ancient asian board game known for its deep strategy and, in
computer science, for its computational intractibility. Whereas efforts in AI have produced worldclass chess playing programs [6], best efforts have yet to produce a professional-level go playing
program. The large search space and extreme branching factor require different a different
approach for go programs in comparison with chess. Current practice is to use Monte Carlo Tree
Searches combined with move choice heuristics. One approach to the move choice problem is to
train a network representation of go move patterns [4-5]. In this work, a go network generation
algorithm was generated to extract move patterns from a database of professional-level go games
and store them in an adjacency list. A novel encoding scheme allows for partial move pattern
matching - a feature that can be beneficial when the network is integrated into a go-playing
program. Future work will proceed along four lines: to extract further data during the database
processing (partial matching of patterns, distance between patterns, frequency data), to study the
resulting topology of the resultant network representation [1-2], to integrate the network into a goplaying program, and finally to consider more go-specific solutions to achieving a successful go
AI, in contrast with general pattern recognition solutions.
Introduction
In computer game AI, such as chess, a tree graph is typically used to represent full board positions as nodes and
edges as the sequence of positions that occur as the players make their moves. These position trees are searched
using increasingly sophisticated algorithms to aid in the solution of the move selection problem of AI game
programming: to choose a move in the current position that will maximize winning changes for that player.
The extreme branching factor in the game of go makes the aforementioned tree search impractical (the search
space is exponentially much greater than chess, for example). Other approaches must be developed to be able to
solve the move selection problem.
One such alternative approach is to represent go playing not as a tree of full board positions, but as a network of
local move patterns [4-5]. Instead of a program's strength lying in its ability to search deeply into all the possible
future positions, a network of move patterns can allow a computer to match patterns that exist in a current game
position with its network store of move patterns that it has 'learned' from previous 'training'. By seeing what move
patterns patterns typically follow each other (connected by edges in the network) and by having access to frequency
and node distance data, it can effectively solve the move selection problem.
Go Network
Chess AI research has been successful by approaching the multiplicity of possible board positions by using brute
force searches of the game position tree, using an evaluation function to assign winning chances to the final leaf
nodes of this tree, and then propagating these evaluations back up to the current position, using a minimax
algorithm. As already noted, such an approach is intractable for go.
In this research, the game of go is represented not as a tree, but a cyclic network of move patterns, defined as
follows. Given a point p on the go board where a legal move is available in the current position, that move's move
pattern is defined as the configuration of stones that are already placed on the board around p. A move pattern is
further defined by its size s, where s is the maximal distance of points surrounding p that are to be considered part of
the move pattern of p. If, for example s = 3, then all points in the 3 'layers' around p are considered the move pattern
of p:
.
.
.
.
.
.
.

.
.
.
.
.
.
.

.
.
.
.
.
.
.

.
.
.
p
.
.
.

.
.
.
.
.
.
.

.
.
.
.
.
.
.

.
.
.
.
.
.
.

move pattern, centered on p, size s =3

As a network, move patterns represent nodes whereas edges represent moves played in sequence during a game.
A further and necessary refinement to the move pattern concept is to account for the fact that the symmetry of the
go board allows for equivalent rotations and reflections of the same move pattern as well as equivalent patterns with
colors reversed. A network of move patterns should not include such duplication of information.
Related Work
Some work has been done in the area of representing go as a complex network. Work most similar to the author's
approach is based on nodes consisting of small local 3x3 (s = 1) move patterns. This research has not only shown the
resulting network model to exhibit many of the defining characteristics of other abtract and real-world complex
networks, but they also have positive preliminary data regarding this model's potential predictive power when
applied to the go problem. The same researchers published further results using 5x5 (s = 2) move patterns and
reported that the resulting network topology exhibited meaningful features not observable using the smaller move
pattern sizes.
A survey of published work on go network representation and training does not exhibit consensus on what such a
network representation of go should look like. Some researchers are studying the resulting topology of go move
pattern networks. Others are training deep convolutional neural network representations of go. Some are supervising
such network training with professional game databases whereas others are working on self-playing machine
learning algorithms to train their neural networks.
The conclusion to draw from current research is that developing a using network representation of go is still in the
conceptual/formative stages. The aim of the author's current research therefore, was to first replicate a network
representation approach already published and then consider first-hand its value and possible (beneficial)
modifications or reconception.
Approach
A go network generation algorithm (GNG) was developed to extract move patterns from a database of
professional-level go games. The input to GNG are standard-format go game files (.sgf). The output is an adjacency
list of move patterns. The outline of the GNG algorithm is as follows:
GNG(file directory sgf, file gn):
open files sgf, gn
declare board and initialize to all 0s
declare pointer cn to current node (begins as null)
while sgf has next move m
add m to board
encode m as move pattern mp
compare mp pattern to patterns in gn
if partial or no match found
add mp as new node in gn
update layer frequencies
check if edge exists from current node cn to mp
if no edge exists
add mp to adjacency list of cn
update edge frequency and edge distance variables
update cn to point to mp
close files sgf, gn
During encoding, all possible rotations and reflections, as well as color reversal (see 'Go Network' above) are
reduced to the same encoding.
Results, New Ideas, and Future Direction
The GNG has been successfully implemented as outlined above. From an implementation perspective a new idea
of the author, not noted in other publications was the manner in which move patterns are encoded. Each move
pattern is encoded as a tuple (in the case of s = 3, as used in the author's implementation) of bit encodings, where
each member of the tuple is a discrete representation of a 'layer' of surrounding stones. In other words, it is possible

with this encoding to know efficiently what stones immediately surround p (so, s = 1). The second member of the
tuple indicates the second layer of stones (s = 2) and the final member of the tuple indicate the stones at s = 3. This
separation of layers will allow for partial move pattern matching when the network is integrated into a go-playing
program.
A further extension in this research is to enlarge the move pattern size (s). Similar enlarging of the move pattern
from 3x3 (s = 1) to 5x5 (s = 2) in other research resulted in meaningful data, and is it intuited that a similar finding
will occur in future research by the author. To a human or chess go player, a full board evaluation is essential to any
winning strategy. This is also the case in computer chess. Therefore, if larger patterns can be efficiently processed,
more relevant feature information should be expected. A cautionary note would be to remember the branching factor
of go. It is for the fact that go is polynomial-space hard [3] that full board position patterns are not used in
computations.
The above discussion leads to some other fundamental thoughts: are square-shaped move patterns an arbitrary
convenience of computation and not based on a true understanding of the structure and dynamics of the game of go?
Are there other ways to conceive of 'patterns' in the game of go that could better capture the inherent nature of the
game dynamics? Future work on go pattern recognition by the author will involve looking into, for example,
dynamically shaped move patterns, based on actual tactical and strategic features of the current position, in contrast
to the static, predetermined move pattern size used in the research reported here.
Conclusion
The challenge of computer go is an active area of AI research. The GNG algorithm reported here successfully
processes move patterns using a novel encoding that allows for partial pattern matching (useful when the trained
network is incorporated into a go-playing program that must evaluate a never-before-seen position). Further work is
needed to: integrate more data collecting during the move pattern extraction (distance between move patterns,
frequency data, etc.), analize the resultant network topology, and to incorporate the network into an actual go
playing program.
References
[1] M. E. J. Newman, "The Structure and Function of Complex Networks", SIAM Review, 45:2 (2003)
[2] E. Estrada, The Structure of Complex Networks, Oxford (2012)
[3] D. Lichtenstein, M. Sipser, "Go is Polynominal-Space Hard", Journal of the Association for Computing
Machinery, 27:2 (1980)
[4] B. Georgeot, O. Giraud, "The game of go as a complex network", Europhys. Lett. 97, 68002 (2012)
[5] V. Kandiah, B. Georgeot, O. Giraud, "Move ordering and communities in complex networks describing the game
of go", Eur. Phys. J. B 87: 246 (2014)
[6] S. Gelley et al., "The Grand Challenge of Computer Go: Monte Carlo Tree Search and Extensions",
Communications of the ACM 55:3 (2012)
[7] L. Xu, "Weiqi games as a tree: Zipf's law of openings and beyond", EPL, 110 (2015)
[8] D. Stern et al., "Bayesian Pattern Ranking for Move Prediction in the Game of Go", Proceedings of the 23rd
International Conference on Machine Learning (2006)