Papers
Topics
Authors
Recent
Search
2000 character limit reached

Slice-Subtraction Algorithm Overview

Updated 4 July 2026
  • Slice-Subtraction Algorithm is a family of methods that exploits ordered locality to efficiently propagate winning (N) and losing (P) positions in subtraction games.
  • It encompasses techniques like the PTFN forward marking, divide-and-conquer interval slicing with Boolean convolution, and coloring automata in higher-dimensional settings.
  • The approach extends beyond combinatorial game theory to applications in big-integer arithmetic and proteomic baseline subtraction by partitioning data into manageable slices.

“Slice-Subtraction Algorithm” is not a standard algorithmic name in the arXiv literature. In the literature on subtraction games, the phrase most closely matches algorithms that process positions in ordered slices or intervals, especially the PTFN algorithm—short for PP-position To Find NN-position”—for one-pile subtraction games (He et al., 2012), and a later divide-and-conquer interval method that propagates hot/cold information between contiguous heap-size slices by Boolean convolution (Eppstein, 2018). In higher-dimensional vector subtraction games, the same interpretive label also fits segment-based methods that propagate P\mathcal P-positions through semi-infinite slices by translation rules or a coloring automaton (Larsson et al., 2023). Outside combinatorial game theory, similar wording can also describe blockwise big-integer subtraction and sliding-window baseline subtraction, but those are distinct algorithmic traditions rather than a single unified method (Bassil et al., 2012).

1. Terminology, formal setting, and scope

In its most developed mathematical use, a slice-subtraction algorithm operates on a subtraction game. For the standard one-pile normal-play case, the data consist of a finite subtraction set

S={s1,s2,,sk},s1<s2<<sk,S=\{s_1,s_2,\dots,s_k\}, \qquad s_1<s_2<\cdots<s_k,

a position given by a pile size nn, and legal moves nnsn\mapsto n-s for sSs\in S with nsn\ge s. The terminal position is $0$, and the last player to move wins (He et al., 2012). The standard recursive dichotomy is: 0P,0\in P,

NN0

NN1

The later fast-evaluation literature uses equivalent hot/cold terminology. For a single heap,

NN2

with NN3 cold in the ordinary subtraction game. For multi-heap subtraction games, the relevant invariant is the nim-value

NN4

and cold positions are exactly those with nim-value NN5 (Eppstein, 2018).

In higher dimensions, a position becomes a vector

NN6

with finite subtraction set

NN7

and legal moves NN8 whenever NN9 componentwise (Larsson et al., 2023). In that setting, “slice” usually refers not to a literal one-dimensional heap interval, but to rows, columns, wedge-shaped regions, or semi-infinite outcome segments.

A persistent source of confusion is that “Slice-Subtraction Algorithm” is an interpretive label rather than the title used by the cited papers. The principal named algorithms are PTFN in the 2012 one-pile paper (He et al., 2012), a divide-and-conquer Boolean convolution method for interval slices (Eppstein, 2018), and a coloring automaton for segmented higher-dimensional boards (Larsson et al., 2023).

2. PTFN as a forward slice algorithm for one-pile subtraction games

The 2012 paper “A New Algorithm for the Subtraction Games” introduces the PTFN algorithm, whose defining idea is to start from known losing positions and mark all positions reachable from them in one move as winning positions (He et al., 2012). Operationally, with an array P\mathcal P0, the intended interpretation is:

  • P\mathcal P1: treated as a P\mathcal P2-position unless later marked otherwise,
  • P\mathcal P3: an P\mathcal P4-position.

The procedure is:

  1. initialize P\mathcal P5 to P\mathcal P6;
  2. regard P\mathcal P7 as terminal and therefore a P\mathcal P8-position;
  3. scan P\mathcal P9;
  4. whenever S={s1,s2,,sk},s1<s2<<sk,S=\{s_1,s_2,\dots,s_k\}, \qquad s_1<s_2<\cdots<s_k,0, treat S={s1,s2,,sk},s1<s2<<sk,S=\{s_1,s_2,\dots,s_k\}, \qquad s_1<s_2<\cdots<s_k,1 as a S={s1,s2,,sk},s1<s2<<sk,S=\{s_1,s_2,\dots,s_k\}, \qquad s_1<s_2<\cdots<s_k,2-position and, for each S={s1,s2,,sk},s1<s2<<sk,S=\{s_1,s_2,\dots,s_k\}, \qquad s_1<s_2<\cdots<s_k,3 with S={s1,s2,,sk},s1<s2<<sk,S=\{s_1,s_2,\dots,s_k\}, \qquad s_1<s_2<\cdots<s_k,4, set

S={s1,s2,,sk},s1<s2<<sk,S=\{s_1,s_2,\dots,s_k\}, \qquad s_1<s_2<\cdots<s_k,5

In cleaned form, the paper’s pseudocode is NN49 This is a forward procedure: known S={s1,s2,,sk},s1<s2<<sk,S=\{s_1,s_2,\dots,s_k\}, \qquad s_1<s_2<\cdots<s_k,6-positions generate nearby S={s1,s2,,sk},s1<s2<<sk,S=\{s_1,s_2,\dots,s_k\}, \qquad s_1<s_2<\cdots<s_k,7-positions, and anything left unmarked when reached becomes the next S={s1,s2,,sk},s1<s2<<sk,S=\{s_1,s_2,\dots,s_k\}, \qquad s_1<s_2<\cdots<s_k,8-position. That is why the paper calls it PTFN: use S={s1,s2,,sk},s1<s2<<sk,S=\{s_1,s_2,\dots,s_k\}, \qquad s_1<s_2<\cdots<s_k,9-positions to find nn0-positions (He et al., 2012).

The algorithm is naturally “slice-like” because it scans positions in increasing order and repeatedly applies the same local propagation rule on the integer line of heap sizes. The paper does not define formal slices, but the forward neighborhood of a newly discovered nn1-position nn2,

nn3

functions exactly as a local slice of newly classified nn4-positions.

The paper’s worked example uses

nn5

up to heap size nn6. Under PTFN, the nn7-positions are

nn8

and the remaining positions up to nn9 are nnsn\mapsto n-s0-positions (He et al., 2012). The paper’s comparison with Sprague–Grundy theory is also explicit: if nnsn\mapsto n-s1, then nnsn\mapsto n-s2 is a nnsn\mapsto n-s3-position; if nnsn\mapsto n-s4, then nnsn\mapsto n-s5 is an nnsn\mapsto n-s6-position. PTFN avoids computing mex values and computes only the nnsn\mapsto n-s7 classification.

This restriction is also its main limitation. The paper states that for sums of subtraction games, “Sprague-Grundy theory is better than PTFN algorithm, but for one pile subtraction games, PTFN has certain advantages” (He et al., 2012). A plausible implication is that PTFN is best viewed as a direct outcome-classification method rather than a full replacement for nim-value computation.

3. Divide-and-conquer interval slicing and Boolean convolution

The 2018 paper “Faster Evaluation of Subtraction Games” develops a more literal slice-based algorithm: it recursively decomposes the heap-size range into contiguous intervals and propagates hot/winning information from one interval into the next using Boolean convolution (Eppstein, 2018). In that setting, “slice” means an interval such as nnsn\mapsto n-s8 or nnsn\mapsto n-s9, and the computational gain comes from batching many predecessor checks.

The paper first introduces subtraction games with hotspots. Besides the subtraction set sSs\in S0, one specifies a set sSs\in S1 of heap sizes called hotspots; if a move leaves a heap in sSs\in S2, the mover immediately loses. Then

sSs\in S3

If some set sSs\in S4 of positions is already known to be cold, then every position that can move to sSs\in S5 is hot. That set is

sSs\in S6

which the paper writes as

sSs\in S7

Representing sSs\in S8 and sSs\in S9 as bitvectors turns this into a Boolean convolution, computable in

nsn\ge s0

time by FFT-based numerical convolution followed by thresholding (Eppstein, 2018).

The divide-and-conquer algorithm for hot/cold status on an interval nsn\ge s1 is:

  1. recurse on the lower half nsn\ge s2, where nsn\ge s3;
  2. compute the set nsn\ge s4 of upper-half positions made hot by lower-half cold positions, using Boolean convolution;
  3. recurse on the upper half nsn\ge s5 with hotspot set enlarged by nsn\ge s6.

The runtime satisfies

nsn\ge s7

hence

nsn\ge s8

The paper states this as:

We can determine which positions are hot and which are cold, in a range of nsn\ge s9 positions of a subtraction game with hotspots, in time $0$0 (Eppstein, 2018).

The same framework yields nim-values by repeated hotspot solves. If

$0$1

then the positions with nim-value $0$2 are exactly the cold positions of the hotspot game with hotspot set $0$3. If the maximum nim-value among $0$4 is $0$5, the total cost is

$0$6

and the paper emphasizes that

$0$7

This algorithm is significantly closer to a canonical “slice-subtraction algorithm” than PTFN, because it explicitly partitions the heap-size range into interval slices and uses a batched propagation step between them. The paper also discusses a simpler sieve-like cold-position algorithm:

  1. initialize a Boolean array of hot marks to false;
  2. for $0$8 to $0$9, if 0P,0\in P,0 is unmarked, output 0P,0\in P,1 as cold and mark 0P,0\in P,2 hot for every 0P,0\in P,3.

That sieve runs in

0P,0\in P,4

where 0P,0\in P,5 is the set of cold positions up to 0P,0\in P,6, and for subtract-a-square it was faster than convolution in the tested range (Eppstein, 2018). This shows that “slice-subtraction” in subtraction games spans both asymptotically fast interval methods and simpler forward sieves.

4. Segments, slices, and coloring automata in higher-dimensional subtraction games

The 2023 paper “Subtraction games in more than one dimension” generalizes the slice viewpoint from one-dimensional heap intervals to geometric regions in 0P,0\in P,7 and higher (Larsson et al., 2023). For a two-move ruleset 0P,0\in P,8, the paper proves the 0P,0\in P,9-to-NN00 principle

NN01

In vector form, for NN02,

NN03

This gives a complete reduction mechanism: repeatedly subtract NN04 until reaching a smallest representative, then decide that representative locally.

In two dimensions, the paper makes the geometric structure explicit. For one-move games NN05, the NN06-positions are repeated NN07-shapes

NN08

and

NN09

For two-move rulesets NN10, the paper defines a slope

NN11

and partitions the board into regions NN12, NN13, NN14, and mirrored counterparts; all further NN15-positions are then generated by translations

NN16

For three or more moves, a single translation vector is usually insufficient. The paper therefore introduces a coloring automaton on a segment

NN17

A legal coloring scheme NN18 consists of an initial colored set NN19, a finite color set NN20, and a finite update set NN21. Each update rule takes a colored position NN22 and outputs

NN23

When the colored positions are exactly the NN24-positions of the ruleset inside NN25, the segment is an outcome segment.

This framework yields explicit segmented solutions for some three-move rulesets. The paper proves a perfect outcome segmentation into three segments for

NN26

and gives a segmentwise construction for symmetric additive rulesets

NN27

with update vectors

NN28

The paper also proves that every finite two-dimensional subtraction ruleset has row/column eventually periodic outcomes, via a finite-window argument on

NN29

where NN30 for NN31 (Larsson et al., 2023).

The paper’s computational visualizations go further and report a five-move ruleset with an outcome segmentation into six semi-infinite slices. That observation is empirical rather than a general theorem, but it places the term “slice-subtraction algorithm” on firm geometric ground: in higher dimensions, the slice is a region of the game board with a finite propagation law, not merely an interval of heap sizes.

5. Periodicity, empirical rules, and the PTFN-based period literature

The paper “The Period of the subtraction games” uses PTFN to study periodic behavior in finite subtraction games and argues that it is “more suitable than Sprague-Grundy Theory” for that task (Qin et al., 2012). Its role in the history of slice-subtraction methods is methodological: PTFN is used to generate binary outcome sequences and to observe repeating blocks.

The paper presents four families of period formulas, including

NN32

for NN33-games, and

NN34

for a family of rulesets of the form

NN35

with NN36 or NN37 (Qin et al., 2012). The practical procedure is to compute the NN38 sequence of NN39-positions until a repeated block appears, then read off the period.

However, the paper also illustrates an important caution. Its theorem statements for NN40 and NN41 conflict with their own tables, and the text itself later describes Theorems 1–3 as “assumptions” (Qin et al., 2012). This makes the article better read as a computational note on pattern discovery than as a complete proved theory. It remains relevant because it demonstrates a distinctive use of PTFN: not merely solving a bounded subtraction game, but using forward marking to expose eventually periodic structure.

A common misconception is that these period papers replace Sprague–Grundy theory. They do not. They replace full mex-valued computation by binary NN42 propagation when the object of study is the period of the win/loss pattern rather than the full nim-sequence. That distinction is central to understanding both the strengths and the limits of slice-based subtraction-game algorithms.

6. Broader uses of the phrase and domain-specific ambiguity

Outside subtraction games, the expression can describe unrelated “slice” or “block” subtraction procedures. The paper “Sequential & Parallel Algorithms for Big-Integer Numbers Subtraction” proposes a blockwise decimal subtraction method in which large operands are partitioned into tokens of at most 18 decimal digits, corresponding to about 60 bits, and subtraction is performed tokenwise with borrow propagation (Bassil et al., 2012). In that setting, the slice is a fixed-size decimal token, the radix is

NN43

and the method has both sequential and parallel variants. This is a slice-based subtraction algorithm in arithmetic, but not in combinatorial game theory.

The paper “Informed baseline subtraction of proteomic mass spectrometry data aided by a novel sliding window algorithm” uses a different local-slice idea. Its baseline estimate is a morphological opening

NN44

and the baseline-subtracted signal is the top-hat

NN45

Its novelty is a continuous line segment algorithm (CLSA) for rolling minima and maxima on an irregularly spaced transformed axis (Stanford et al., 2016). Here the slice is a sliding window

NN46

not a game-state interval or arithmetic token.

These uses matter because they show that “Slice-Subtraction Algorithm” is best understood as a nonstandard umbrella label. In subtraction games, it denotes forward or interval-based propagation schemes such as PTFN, Boolean-convolution interval decomposition, or segment-coloring automata (He et al., 2012). In big-integer arithmetic, it denotes tokenwise borrow-resolving subtraction (Bassil et al., 2012). In signal processing, it denotes sliding-window baseline estimation (Stanford et al., 2016). A plausible implication is that the phrase has descriptive value, but only when its domain is specified.

Taken in the most coherent technical sense, the slice-subtraction algorithm is therefore a family of methods that exploit ordered locality—positions, intervals, tokens, or geometric segments—to replace naïve pointwise subtraction-state evaluation by structured propagation. In subtraction games, that family begins with forward NN47-to-NN48 marking, becomes explicitly interval-recursive with Boolean convolution, and extends to geometric segmentation and coloring in higher dimensions (Eppstein, 2018).

Topic to Video (Beta)

No one has generated a video about this topic yet.

Whiteboard

No one has generated a whiteboard explanation for this topic yet.

Follow Topic

Get notified by email when new papers are published related to Slice-Subtraction Algorithm.