1 Games Played on Directed Graphs.
Definition.
Adirected graph,G,is a pair (X, F) where X is a nonempty set of vertices
(positions) and F is a function that gives for each x∈X a subset of X, F(x)⊂X.For
(4) The player who is confronted with a terminal position at his turn, and thus cannot move, loses.
As defined, graph games could continue for an infinite number of moves. To avoid this possibility and a few other problems, we first restrict attention to graphs that have the property that no matter what starting pointx0is used, there is a number n, possibly depending onx0, such that every path from x0 has length less than or equal ton.(A path is a sequence x0,x1,x2,...,xm such that xi ∈F(xi−1) for all i=1,...,m, where m is the length of the path.) Such graphs are called progressively bounded.If X itself is finite, this merely means that there are nocycles. (A cycle is a path, x0,x1,...,xm,with x0=xmand distinct verticesx0,x1,...,xm−1, m≥3.)
This completely defines the game.
Fig. 1 The Subtraction Game withS={1,2,3}.
It is useful to draw a representation of the graph. This is done using dots to represent vertices and lines to represent the possible moves. An arrow is placed on each line to indicate which direction the move goes. The graphic representation of this subtraction game played on a pile of 10 chips is given in Figure 1.
2 The Sprague-Grundy Function
Graph games may be analyzed by considering P-positions and N-positions. It may also be analyzed through the Sprague-Grundy function.
Definition.
TheSprague-Grundy functionof a graph,(X, F), is a function,g, defined on X and taking non-negative integer values, such that
g(x)=min{n≥0:n=g(y) for y∈F(x)}. (1)
In words,g(x) the smallest non-negative integer not found among the Sprague-Grundy values of the followers of x. If we define the minimal excludant or mex of a set of non-negative integers as the smallest non-negative integer not in the set, then we may write simply
g(x)=mex{g(y):y∈F(x)}. (2)
Note that g(x) is defined recursively. That is, g(x) is defined in terms of g(y)for
all followersy ofx. Moreover, the recursion is self-starting. For terminal vertices, x, the definition implies that g(x)=0,since F(x) is the empty set for terminal x. For
non-terminalx, all of whose followers are terminal, g(x)=1.
Given the Sprague-Grundy functiongof a graph, it is easy to analyze the corresponding graph game. Positions xfor which g(x) = 0 are P-positions and all other positions are N-positions. The winning procedure is to choose at each move to move to a vertex with Sprague-Grundy value zero.
(1) Ifxis a terminal position, g(x)=0.
(2)Atpositionsxfor which g(x) = 0, every followeryofxis such that g(y)=0,and
(3)Atpositions xfor which g(x) = 0, there is at least one followery such that g(y)=0.