Faster Evaluation of Subtraction Games

04/18/2018
by   David Eppstein, et al.
0

Subtraction games are played with one or more heaps of tokens, with players taking turns removing from a single heap a number of tokens belonging to a specified subtraction set; the last player to move wins. We describe how to compute the set of winning heap sizes in single-heap subtraction games (for an input consisting of the subtraction set and maximum heap size n), in time Õ(n), where the Õ elides logarithmic factors. For multi-heap games, the optimal game play is determined by the nim-value of each heap; we describe how to compute the nim-values of all heaps of size up to n in time Õ(mn), where m is the maximum nim-value occurring among these heap sizes. These time bounds improve naive dynamic programming algorithms with time O(n|S|), because m<|S| for all such games. We apply these results to the game of subtract-a-square, whose set of winning positions is a maximal square-difference-free set of a type studied in number theory in connection with the Furstenberg-Sárközy theorem. We provide experimental evidence that, for this game, the set of winning positions has a density comparable to that of the densest known square-difference-free sets, and has a modular structure related to the known constructions for these dense sets. Additionally, this game's nim-values are (experimentally) significantly smaller than the size of its subtraction set, implying that our algorithm achieves a polynomial speedup over dynamic programming.

READ FULL TEXT
research
06/17/2022

Universal Complexity Bounds Based on Value Iteration and Application to Entropy Games

We develop value iteration-based algorithms to solve in a unified manner...
research
08/10/2018

On the Complexity of Solving Subtraction Games

We study algorithms for solving Subtraction games, which sometimes are r...
research
07/01/2020

Some i-Mark games

Let S be a set of positive integers, and let D be a set of integers larg...
research
06/12/2015

New Results for Domineering from Combinatorial Game Theory Endgame Databases

We have constructed endgame databases for all single-component positions...
research
03/07/2018

Partition games are pure breaking games

Taking-and-breaking games are combinatorial games played on heaps of tok...
research
02/19/2019

Taking-and-merging games as rewrite games

This work contributes to the study of rewrite games where positions are ...
research
01/05/2021

Partizan Subtraction Games

Partizan subtraction games are combinatorial games where two players, sa...

Please sign up or login with your details

Forgot password? Click here to reset