A linear algorithm for the restricted subtraction games - Yang, Zongbao; He , Zhimin; Li , Lvzhou; Dong , Shoubin; Zheng , Shenggeng (Frontiers in Physics, 2022)
Subtraction game is a well-known problem in the field of game theory, which is often called as a one-heap Nim game. There are two players, a heap of tokens and a strategy matrix in this game. It is called a restricted subtraction game, if some constrains are imposed on the strategy matrix. The subtraction game could be solved by a classical algorithms with query complexity no less than O(N^2) and computed by an O(N^\frac{3}{2} log N) quantum query algorithm with error probability $ε ≤ \frac{1}{N}$. The restricted subtraction game proposed by Huang et, al. can be computed by an exact quantum algorithm with $O(N^\frac{3}{2})$ queries. They also proved that the classical exact query complexity is Θ(N^2). In this paper, we use an array and an adjacency list to replace the strategy matrix, and propose another more general subtraction game comparing to the one introduced by Huang et, al. Based on the dynamic programming and the replaced game strategy, two linear classical query algorithms are designed to solve the restricted subtraction game proposed by Huang and this paper, respectively.