Manuscript Offprint
arXiv:2610.31261A Polynomial-Time Algorithm for -Path Vertex Cover Reconfiguration on Trees under Token Sliding
Open access. PaperVantage converted this article to text, so layout and figures may differ from the original. This text is shared under the same licence.
Abstract
A k-path vertex cover (k-PVC) of a graph is a set of vertices meeting every path on k vertices. In Token Sliding, one token occupies each vertex of a cover; a move slides one token along an edge to an unoccupied vertex, preserving the cover property. We study whether two covers of a tree are joined by such moves. The case admits a linear-time decision algorithm. For every integer , we give an -time decision algorithm on trees of order , with part of the input. Two covers are reachable precisely when their rigid tokens, which never move, occupy the same set and every component remaining after their deletion has the same token count. The proof transforms configurations of equal size without rigid tokens into a canonical configuration built on properly rooted subtrees, whose paths on vertices pass through their roots. A rooted-subtree recurrence identifies movable candidate tokens. We also give a direct recursive construction between the supplied endpoints, returning at most slides in time.
ChatGPT 6 Pro and Claude Fable 5.1 were used to assist with developing and reviewing mathematical arguments and drafting and revising the paper. The author takes full responsibility for the correctness and content of the paper.
Keywords: combinatorial reconfiguration, token sliding, k-path vertex cover, tree, polynomial-time algorithm.
1 Introduction
Recently, combinatorial reconfiguration has attracted attention from both theoretical and practical viewpoints. A reconfiguration problem asks whether one feasible solution of a source problem can be transformed into another by a sequence of small changes, each of which keeps the solution feasible. For an overview of this research area, we refer readers to the surveys of Nishimura [4] and van den Heuvel [6].
For an integer , a k-path vertex cover of a graph is a set such that every path on vertices of contains a vertex of . Brešar, Kardoš, Katrenič and Semanišin [9] introduced the minimum k-PVC problem, proved that it is NP-hard for every fixed , and gave a linear-time algorithm on trees. A 2-PVC is a vertex cover. The complement of a 3-PVC is a dissociation set, that is, a set of vertices inducing a subgraph of maximum degree at most one [3, 9].
Hoang, Suzuki and Yagita [2] initiated the study of reconfiguring k-PVCs. In the Token Sliding model, a token is placed on each vertex of a k-PVC. A move slides one token along an edge to an unoccupied vertex so that the occupied vertices still form a k-PVC. A sequence of such moves is a TS-sequence. The problem k-Path Vertex Cover Reconfiguration (k-PVCR) under Token Sliding asks, given a graph G and two k-PVCs S and of G of the same size, whether there is a TS-sequence from S to .
For k = 2, taking complements identifies the problem with Token Sliding for independent sets: sliding a vertex-cover token from u to v moves an independent-set token from v to u [2]. Token Sliding for independent sets is PSPACE-complete on general graphs [10, 11], and its complexity on restricted graph classes has been studied extensively. We refer readers to Kamiński, Medvedev and Milanič [8] and to Nishimura [4] for examples. On trees, Demaine et al. [5] gave a linear-time decision algorithm. Their characterization uses the tokens that never move and compares token counts after deleting the vertices with those tokens together with their neighbors.
For general k, Hoang, Suzuki and Yagita [2] proved that k-PVCR is PSPACE-complete under each of Token Sliding, Token Jumping and Token Addition/Removal even on planar graphs of maximum degree three and bounded bandwidth. They gave polynomial-time algorithms under all three models.
for paths and cycles, and under Token Jumping and Token Addition/Removal for trees. For each fixed , Hoang, Suzuki and Yagita [2] also construct shortest TS-sequences on paths in time and TS-sequences on cycles in time whenever the target is reachable, where is the order of the input graph. They left open the complexity under Token Sliding on trees. For caterpillars and , Hoang [1] gave a polynomial-time algorithm based on the vertices with rigid tokens, which never move, and the token counts after deleting those vertices. For each fixed , Hoang [1] also constructs a TS-sequence in time between equal-size -PVCs of an -vertex caterpillar when neither has a rigid token. For , the same paper points out that verifying one condition of its characterization of rigid tokens in polynomial time may require further ideas [1]. As far as we know, the complexity on trees has remained open for every .
Theorem 1.1. There is an algorithm that, given an integer , a tree of order , and two -PVCs and of , decides in time whether there is a TS-sequence from to .
When , every vertex set is a k-PVC, and the answer is yes exactly when . Section 4 proves Theorem 1.1. For , we apply the algorithm of Theorem 1.1 to the complements to decide in time whether one dissociation set of a tree can be transformed into another by sliding its tokens along edges, one at a time, so that the occupied vertices always form a dissociation set.
The decision algorithm has two main ingredients.
- We characterize reachability by rigid tokens and token counts (Theorem 3.10). For a k-PVC S of a tree T, let be the set of vertices occupied in every k-PVC reachable from S; the tokens on these vertices never move and are called rigid. Two k-PVCs S and of T are reachable from one another if and only if and they have the same number of tokens in every component of . The condition is necessary because no token can enter or leave a component of , and it is sufficient by the Key Lemma (Lemma 3.9): two k-PVCs of equal size whose tokens are all movable are reachable from one another. The characterization has the form of the result of Hoang [1] for caterpillars and , and for k = 2 it describes the same relation as that of Demaine et al. [5] (Remark 3.11).
The Key Lemma rests on a canonical form: every k-PVC of a given size whose tokens are all movable can be transformed into one canonical k-PVC determined by the tree, its vertex order and the size. It is built one part at a time on the properly rooted subtrees of Brešar et al. [9] (Section 2.3), that is, subtrees U attached to the rest of the tree by one edge at a root u such that contains a path on k vertices and does not. While u is occupied, the tokens in do not interact with the rest of the tree, so tokens moved through u can put a prescribed set on U, after which the construction continues on the smaller tree. For k = 2, Demaine et al. cut off stars formed by a leaf, its neighbor and the other leaves there; already for k = 3, such small pieces do not suffice (Example 3.8), and properly rooted subtrees take their place.
- We compute with Algorithm 1, which follows the idea of the linear-time algorithm of Demaine et al. [5] for independent sets. It starts with all occupied vertices as candidates and repeatedly removes a candidate whose token can move while the other candidates stay occupied; the candidates that remain form (Theorem 4.9). What is new for general k is the test whether the token of a candidate can move. A slide from a candidate v creates only unoccupied paths through v, each made of v and at most two unoccupied paths starting at other neighbors of v, and the components of the tree minus the candidates can be rearranged independently. Hence, the test needs, for each such component P and its vertex r next to a candidate, only the least possible number of vertices of a longest unoccupied path starting at r. The integer is the minimum number of tokens in a configuration obtainable from the fully occupied configuration P by slides in and legal removals at r. Among the configurations with tokens obtained in this way, is the least number of vertices of a longest unoccupied path starting at r, with value zero when r is occupied. Since the tokens of these components stay movable, the number needed by the test is if P holds exactly tokens and zero otherwise (Corollary 4.7), where one recurrence on rooted subtrees computes and for every .
Our second result outputs a TS-sequence for every yes-instance. For this construction, running times count array, integer, and slide-record operations after reading the input. A binary encoding of k adds for reading that parameter.
Theorem 1.2. There is an algorithm that, given an integer , a tree of order , and two -PVCs and of such that is reachable from , outputs a TS-sequence from to with at most slides in time.
The construction in Section 5 connects the two supplied endpoints directly. It fixes the same properly rooted side in both endpoints and recursively connects their remaining restrictions once. Within that side, a single transfer loop maintains occupied roots in nonempty branches, and exchanges along one path adjust consecutive prescribed sets. The resulting quadratic local cost and the potential give the stated bound on the complete returned list. The running-time bound uses exact tree traversals, the rooted recurrence, and linear assembly of the returned lists, as specified in Section 5.4. The exponential bound is an upper bound; we do not claim that this procedure must return exponentially many slides.
The rest of this paper is organized as follows: Section 2 introduces notation and basic properties of TS-sequences; Section 3 proves the reachability characterization; Section 4 gives the decision algorithm and proves Theorem 1.1; Section 5 proves Theorem 1.2; and Section 6 presents the remaining questions.
2 Preliminaries
This section introduces the graph notation, token sliding on k-PVCs, and properly rooted subtrees used throughout the paper. We then prove the basic properties of TS-sequences needed for the characterization in Section 3 and the decision algorithm in Section 4, including a property of restrictions to one side of an edge (Lemma 2.12).
2.1 Graph Notation
We use and to denote the sets of vertices and edges of a (simple, undirected) graph , respectively. The neighborhood of a vertex in , denoted by , is the set . The closed neighborhood of in , denoted by , is simply the set . For two sets and , we sometimes use and to indicate and , respectively, and we write and for and . For , the subgraph of induced by is , and is obtained by removing and all incident edges; we write for . A path on vertices is a sequence of distinct vertices in which consecutive vertices are adjacent.
Throughout the paper, is an integer and is a finite nonempty tree of order . A fixed linear order of resolves all choices between vertices. A set is connected if is connected. We state the results for subsets of because the proofs apply them to subtrees; the reader may take at first reading. For adjacent vertices , the set is the vertex set of the component of containing . When is connected, and partition , and the edge is the only edge joining these two sets. The notation follows Demaine et al. [5], who use when . A connected set together with a vertex is a rooted tree , in which parents, children, ancestors and descendants are defined as usual. For a connected set rooted at , the sets , for , are its branches, rooted at the corresponding vertices . The rooted height of is the number of vertices of a longest path of starting at . The depth of is the number of edges of the path from to , and is the vertex set of the subtree of , that is, together with its descendants; the rooted tree is always clear from the context when is used. We sometimes identify a subtree with its vertex set.
For a finite multiset of nonnegative integers, denotes the sum of its two largest members, with missing members counted as zero. In particular, and . Deleting or decreasing members of cannot increase . All lists inside below are multisets, so equal entries are counted separately.
2.2 Token Sliding on k-PVCs
Let . Recall that a k-PVC of is a set meeting every path on k vertices of . Equivalently, contains no path on k vertices. Following Hoang, Suzuki and Yagita [2] and Hoang [1], we regard each vertex of S as occupied by a token, and each vertex of as unoccupied. Every superset of a k-PVC in W is a k-PVC of .
For two k-PVCs of , we write if for an edge of with and . We say that is obtained by sliding the token on to . For a k-PVC , a vertex and an unoccupied neighbor of , we denote the slide of the token on to by , and it is legal at if is a k-PVC of . A TS-sequence in is a sequence of k-PVCs with and for every . The number of slides of such a TS-sequence is . We write when such a TS-sequence starts at and ends at , and we denote by the set of k-PVCs reachable from . The relation is an equivalence relation, and every member of has tokens. When , we omit from subscripts.
Following Demaine et al. [5] and Hoang [1], the token on is -rigid if is occupied in every member of , and -movable otherwise. We denote by the vertices with rigid tokens and by the vertices that are never occupied in ; thus,
Both sets depend only on . When the ambient set and the k-PVC are clear, we simply say rigid or movable. The equality means that all tokens are movable; it does not imply that . For , we define when ; otherwise, is the number of vertices of a longest path of starting at . Since is a k-PVC, .
Figure 1 illustrates rigid tokens, never-occupied vertices, and the values of .

Figure 1: A 4-PVC of the tree of order 14. All figures use this tree, with the fixed vertex order . Black vertices carry tokens; a thick gray outline marks a rigid token, light gray vertices are never occupied, and white vertices are the other unoccupied vertices. Here , , and has 18 members. The numbers beside unoccupied vertices give . The arrow is a legal slide; the crossed arrow would leave the thick path unoccupied.
Every newly uncovered path must contain the vertex vacated by the proposed slide. The following test expresses that observation using .
Lemma 2.1. Let be a -PVC of , let , and let . Then if and only if
Proof. We determine the longest path of unoccupied vertices that contains v after the proposed slide. Figure 1 illustrates the two outcomes of the slide test. Every newly uncovered path must contain v, and it cannot use the occupied vertex z. Such a path uses at most two branches at v. The longest possible number of vertices on it is one plus the sum in Equation (1), because paths in two distinct branches can be joined through v. The new set is therefore a k-PVC exactly when that number is at most .
For an edge ay of , the value of at (at ) is . This value is zero when ; otherwise, it is the number of vertices of a longest unoccupied path that starts at and avoids . A finite multiset of nonnegative integers fits if . In these terms, Lemma 2.1 says that the slide is legal at if and only if the values at of the neighbors of in other than fit.
We also use token removals at a specified vertex . If and is a k-PVC of , then is obtained from by removing the token on . We write if is obtained from by zero or more slides in and removals of tokens on , with every intermediate set a k-PVC of . In particular, slides may occur before, between, and after removals, and exactly tokens are removed.
2.3 Properly Rooted Subtrees
The proofs in Sections 3 and 4 use the properly rooted subtrees of Brešar et al. [9]. A connected set rooted at is properly rooted if contains a path on vertices and does not. In particular, for an edge of , the subtree is properly rooted precisely when it has these properties with root . The same definition applies when and is a specified root. Every path on vertices of contains , so every subset of containing is a -PVC of .
Let be the branches of a properly rooted , with roots and rooted heights . We index the branches so that . Each branch contains no path on vertices, so . Let be the largest such that , and let
Among all submultisets of a given cardinality, the shortest heights minimize the two largest entries. Consequently, m is also the largest cardinality of a submultiset of the branch heights with at most . Moreover, : otherwise, every path through u would have at most vertices, and no branch contains a path on k vertices.
For every , we define a prescribed set . The set contains and further vertices. For the latter vertices, the branch roots come first, in decreasing order of their rooted heights and with ties resolved by the fixed vertex order; all vertices of other than and the branch roots follow in the fixed vertex order. The set consists of and the first vertices in this list. In particular, when fewer than branch roots are occupied, the empty branches have the smallest heights. The set is a -PVC because it contains .
Figure 2 illustrates a properly rooted subtree and its prescribed sets.
The next lemma gives the properly rooted subtrees used in the inductive proofs.
Lemma 2.2. Let be connected.
(a) If and contains a path on vertices, then some edge of gives a properly rooted subtree with .
(b) If contains a path on vertices and , then some edge of gives a properly rooted subtree .
Proof. We choose a smallest edge side that contains a path on k vertices and avoids r.
(a) The path lies in a component of , where is a neighbor of , so some edge of has containing a path on vertices and avoiding ; among such edges, is chosen with least. For every neighbor of , the set is contained in , so it is smaller and avoids . By the choice of , it contains no path on vertices, so is properly rooted at .
(b) As , some vertex lies outside a given path on vertices, and contains that path, so (a) applies.

(a)
(b)
(c)
Figure 2: The properly rooted subtree for is enclosed by a dotted outline, with outside it. Panels (a), (b), and (c) show , , , respectively; black vertices belong to the prescribed set and white vertices are unoccupied. The numbers in parentheses beside vertex names give positions in the list defining , with the root included separately. The branches rooted at , , have rooted heights 3, 3, 2, respectively, giving , , , and . In particular, and illustrate Lemma 3.1.
2.4 Basic Properties of TS-Sequences
We first show that fixing occupied vertices allows independent reconfiguration on the remaining components. We then study adding and removing tokens at one vertex, and use these operations to relate rigid tokens to vertices that are never occupied. The final consequences concern a maximum number of tokens on one side of an edge, the addition of a token to a k-PVC whose tokens are all movable, and the endpoint of an edge on one side of it.
Lemma 2.3. Let be a -PVC of , let , and let be a union of vertex sets of components of .
(a) For every k-PVC A of T[Q], the set is a k-PVC of T[W].
(b) Every TS-sequence in starting at extends to a TS-sequence in that agrees with S outside Q.
(c) Every TS-sequence in whose members contain X restricts, after repeated consecutive sets are omitted, to a TS-sequence in .
If , then consists exactly of the sets obtained by adjoining to independently chosen members of for the vertex sets of the components of .
Proof. We distinguish paths meeting X from paths lying in a component of .
(a) A path meeting X contains an occupied vertex. A path avoiding X lies in one component of , so a path on k vertices in Q meets A and one outside Q meets S - Q. Thus, is a k-PVC.
(b) Each slide in uses the same occupied source and unoccupied target after S - Q is adjoined. Part (a) ensures that both endpoints of every slide are k-PVCs of .
(c) No slide of the given sequence uses a vertex of X, since every such vertex remains occupied. The endpoints of every slide therefore lie in one component of . Its restriction to Q is either a slide or an unchanged set, which proves the assertion.
When , part (c) applies to every TS-sequence starting at , and gives one inclusion in the final assertion. Part (b), applied to the components one at a time, gives the reverse inclusion.
We will often reconfigure within a tree where every subset of the required cardinality is a k-PVC. The reachability assertion below is a special case of the connectivity result of Fabila-Monroy et al. [7]; we include a direct proof.
Lemma 2.4. Let be connected and let . If contains no path on vertices or , then every -element subset of is a -PVC, and every two such subsets are reachable from one another in .
Proof. We exchange one token with one unoccupied vertex at a time; every set below has elements, so it is a -PVC: under either hypothesis of the lemma, there is no path on vertices at all, or there are too few unoccupied vertices to form one. Let have elements, let and , and let be the path of joining them. We show by induction on that reaches . For , the exchange is the slide . For , there are two cases.
-
Case 1: . By the induction hypothesis, reaches . The slide then gives .
-
Case 2: . The slide first gives . By the induction hypothesis, this set reaches .
Now let have elements. If , the zero-slide TS-sequence joins them. If , then some and exist, reaches , and , so induction on joins to .
Adding a token at a fixed vertex preserves reachability when that vertex is unoccupied at both endpoints.
Lemma 2.5. Let be connected, let , and let be -PVCs of with . If , then .
Proof. We use induction on to replace each part of a TS-sequence during which becomes occupied and then becomes unoccupied. The assertion is immediate for . Let a TS-sequence from to be fixed. Every interval in which remains unoccupied extends to a TS-sequence after is added to all its members, since supersets of -PVCs are -PVCs. It remains to handle an interval consisting of a slide from a neighbor to , a sequence keeping occupied, and a slide from to a neighbor . Let be the -PVC immediately after the first slide and the -PVC immediately before the last slide. The required replacement joins to . For every neighbor of , the occupied interval restricts to a TS-sequence from to , by Lemma 2.3(c).
-
Case 1: . Both endpoints of the restricted sequence in omit . Since , the induction hypothesis joins to inside . We execute that sequence with occupied, followed by the restricted sequences in every other branch. All these sequences extend by Lemma 2.3(b), and the result is .
-
Case 2: . Starting at , we keep occupied and execute the restricted sequence in only. The resulting set is
The vertex j is unoccupied in , so the proposed slide from r to j gives
To check that is a -PVC, we compare it with the -PVC immediately before the original arrival at . A path on vertices outside is still met by that set. A path wholly inside meets , and a path crossing the boundary of contains the newly occupied vertex . Thus, the slide to is legal. The subsequent slide from to is also legal, because becomes occupied and every branch restriction is a -PVC. At this point, the restriction to is , the restriction to is , and every other branch still has its restriction from . Executing the restricted sequences in and in all branches other than , with occupied, ends at .
The replacements of all intervals concatenate to the required TS-sequence from to .
The next consequence allows a projected TS-sequence to add tokens at a boundary vertex, provided its token count never exceeds the initial count.
Corollary 2.6. Let be connected, let , and let be k-PVCs of . Suppose that consecutive sets differ by a slide, by a removal at , or by the addition of a token at , and that for every . Then for every .
Proof. We follow the sequence and undo each addition at with the last removal before it, using Lemma 2.5. We show that by induction on ; the case is trivial. Let ; by the induction hypothesis, slides and removals at lead from to , with every intermediate set a -PVC of . If arises from by a slide or by a removal at , these operations followed by that step lead to . Otherwise, with , so , and these operations contain a removal at , as slides keep the number of tokens. Let be the set just before the last of these removals. Then , the vertex lies in , the set is a -PVC of , and , since only slides follow that removal. By Lemma 2.5, applied to and , we have , so .
Removing tokens cannot allow a vertex that was never occupied to become occupied.
Lemma 2.7. Let , let , and let be a -PVC of . If , then is contained in a member of and .
Proof. We follow the slides and removals while maintaining a containing k-PVC reachable from Z. Initially, that containing set is Z itself. Suppose that the current set A is contained in a k-PVC . A removal from A preserves the inclusion without changing B. For a slide from x to y in A, if , then B still contains . If , then the same slide replaces B with , which contains and is a k-PVC because it contains a k-PVC. Thus, every set obtained by the operations is contained in a member of . The same argument applies after appending an arbitrary TS-sequence starting at Y. Every vertex occupied in a member of is therefore occupied in a member of , which gives the stated inclusion.
The vertices that are never occupied determine the smallest possible value of at a specified vertex.
Lemma 2.8. Let be connected, let be a -PVC of , and let . If , then . Otherwise, this minimum equals the number of vertices of a longest path of starting at . Moreover, some attains the minimum and, if , the component of containing lies in .
Proof. We attain the minimum by occupying all vertices just outside the component of never-occupied vertices that contains . If , some reachable -PVC contains , giving the minimum zero and the last assertion. Suppose that , and let be the vertex set of its component in . Every vertex of remains unoccupied, giving the asserted lower bound. Each component of has a unique edge to ; let be its endpoint outside . The uniqueness follows because is a tree and is connected. Moreover, , since otherwise would belong to .
We occupy the vertices one at a time and keep each treated component fixed afterwards. From the current reachable -PVC, there is a TS-sequence to one containing the next . No slide of this sequence meets , since its vertices are never occupied. We retain only the slides in components not yet fixed. Every resulting set is a -PVC: a path wholly inside a fixed component meets its fixed restriction, a path crossing its boundary contains its occupied vertex , and a path avoiding all fixed components has the same occupation as in the original sequence. Every retained slide also has its original source and target occupations. Thus, the retained slides legally occupy the next without changing the earlier components. After all components have been treated, every neighbor of outside is occupied. The component of unoccupied vertices containing is then exactly , which attains the lower bound and gives the last assertion.
A rigid token adjacent in to a vertex without a rigid token must be the only token on a path whose other vertices can never be occupied.
Lemma 2.9. Let be connected and let be a -PVC of . If has a neighbor in outside , then some path on vertices of contains and has every other vertex in . In particular, such a path exists whenever and .
Proof. We prepare the branches at so that the unoccupied vertices joined to their roots are never occupied, and then use that the token on cannot slide to an unoccupied neighbor. Let , and let a reachable -PVC omit . Since stays occupied, Lemma 2.3 identifies the possible restrictions to its branches with their independent sets of reachable -PVCs. In particular, the vertices never occupied in each branch are exactly the vertices of in that branch. Keeping unoccupied, we apply the last assertion of Lemma 2.8 in every other branch at its root, independently; this gives with such that, for every neighbor of with , the component of containing lies in . As , the slide is not legal at , so some path on vertices of avoids . The path meets , and only at , so it contains . Its other vertices are joined to by vertices outside , so each of them lies, for some neighbor of with , in the component of containing , hence in . Finally, if , then is nonempty. When is also nonempty, connectivity supplies an edge from that set to its complement, so the first assertion applies.
A restriction to an arbitrary subtree need not retain movable tokens. The maximum-count hypothesis in the next consequence supplies the property we will use.
Corollary 2.10. Let be connected, let be an edge of , and let . Suppose that is a -PVC of with . Let . If , then every with satisfies .
Proof. We project a TS-sequence onto Q and apply the persistence of never-occupied vertices. Let for a restriction attaining M. A TS-sequence starting at restricts to slides in Q and additions or removals at u when a slide crosses uv. Every restriction is a k-PVC of and has at most M tokens. By Corollary 2.6, each restriction can therefore be obtained from A by slides and removals at u. By Lemma 2.7, every vertex of is unoccupied throughout . If , then and Lemma 2.9 give a path on k vertices in with all but one vertex in . Every member of must occupy the remaining vertex to meet that path. That vertex would belong to , a contradiction.
When all tokens are movable, adding a token at a fixed vertex keeps all tokens movable unless every vertex becomes occupied. Corollary 3.12 uses this fact to compare consecutive token counts.
Corollary 2.11. Let be connected, let be a -PVC of with , and let . Some omits , and is independent of the choice of . If , then .
Proof. We combine Lemma 2.5 with the path forced by a rigid token. A reachable omitting exists because , and Lemma 2.5 proves the independence assertion. Suppose that and . By Lemma 2.9, some path on vertices has all but one vertex in . Since removing the token on from gives , Lemma 2.7 yields . The remaining vertex of that path must then be occupied throughout , contradicting .
The next lemma shows that restricting a k-PVC whose tokens are all movable to one side of an edge leaves the endpoint on that side without a rigid token, unless that side is full. Other tokens on that side need not be movable.
Lemma 2.12. Let be connected, and let be a -PVC of with . For an edge of , let . If , then .
Proof. We carry an invariant along each TS-sequence: its restriction to is obtainable from by slides and removals at . Suppose that , and let be a TS-sequence in . The invariant holds at with no slides or removals. Suppose that it holds at , and let . A slide inside appends an internal slide, a slide from to appends a removal at , and a slide outside leaves the restriction unchanged. For a slide from to , we have and by the invariant. Equality would mean that the sequence supplied by the invariant has no removal, so , contrary to rigidity at the unoccupied vertex . Thus, . Appending the addition at keeps every count at most , so Corollary 2.6 converts the resulting sequence into slides and removals at , proving the invariant at . Consequently, every restriction of a member of has at most tokens, so attains the maximum count on . Since , Corollary 2.10 makes all its tokens movable in , contradicting rigidity at .
3 Characterization of Reachability
This section proves that is determined by and the token counts in the components of . We first reconfigure the restriction to a properly rooted subtree to a prescribed k-PVC, while ensuring that every token in the remaining subtree is movable. The resulting reduction proves the Key Lemma by induction on the order, and fixing the rigid tokens then gives the characterization.
3.1 Unoccupied Vertices in a Properly Rooted Subtree
Let be connected, let be an edge of such that is properly rooted, and let . We use the branches , roots , heights , integers , and prescribed -PVCs from Section 2.3. The first statements also apply to a properly rooted tree by itself, with no . When is occupied, every -PVC and every TS-sequence on extends with the restriction to fixed, because every path crossing contains . The same assertion holds for removals of a token at a vertex of , provided every intermediate restriction is a -PVC of .
We begin by interpreting as an exact bound and recording when the token on u can be removed from .
Lemma 3.1. Let be properly rooted.
(a) The maximum number of unoccupied vertices in a k-PVC of T[U] omitting u is .
(b) For every , the set is a k-PVC with and . If , then is also a k-PVC of .
Proof. We count the branches that must contain a token when u is unoccupied. Figure 2 illustrates the prescribed sets in part (b).
(a) Let be a -PVC of omitting . The heights of the branches containing no token have at most ; otherwise, their rooted paths together with would contain an uncovered path on vertices. At most branches are empty, so each of at least branches contains a token. Thus, . Equality is attained by leaving the shortest branches empty and placing one token at the root of every other branch, with unoccupied. Every path avoiding these tokens either lies in a branch, which has no path on vertices, or passes through and has at most vertices.
(b) The set contains and other vertices, so it is a -PVC with exactly unoccupied vertices. If , then . When at least vertices other than are occupied, every branch root is occupied. Otherwise, the empty branches are at most the shortest branches, and every other branch root is occupied. After the token on is removed, every unoccupied path through therefore has at most vertices, as in part (a). No branch contains a path on vertices, so is a -PVC.
For a k-PVC with , let and let . When the restriction to is fixed, let , the exterior value; when there is no , let . The internal slide condition used below is
there is an with such that .
(3)
The union in Equation (3) is a multiset union, so the occurrence of x is included even when it equals a branch height.
Lemma 3.2. Let be properly rooted in a connected set , and let be a -PVC of with . After slides inside that keep occupied, a first slide of the token on to a vertex of is possible with fixed if and only if Equation (3) holds. The same equivalence holds for by itself with .
Proof. We compare the branch counts before the first slide from u with the slide test in Lemma 2.1.
(⇒) Until the first slide from u, every branch retains its number of tokens. If that slide goes to , then . Every empty branch other than still has its entire rooted path of height unoccupied, and still has value x at v. The necessary slide test implies Equation (3), since omitting the contributions of other branches can only decrease .
( ) Let A satisfy Equation (3). By Lemma 2.4, we can make unoccupied because , and we can occupy the root of every other nonempty branch. These preparations are independent and legal while u is occupied, by Lemma 2.3. The nonzero values in the slide test for the slide from u to are then exactly the heights of the empty branches other than and the value x. Thus, Equation (3) makes the slide legal.
Before normalizing a restriction, we may need to occupy its root.
Lemma 3.3. Let be properly rooted in a connected set , and let be a -PVC of with . There is a TS-sequence using only edges of from to a -PVC containing . The restriction to and the number of tokens in remain unchanged. The same assertion holds for by itself.
Proof. We move a closest token in U toward u along their unique path. Such a token exists because contains a path on k vertices. Every vertex strictly between the chosen token and u is initially unoccupied. At each step, a newly uncovered path would have to contain the vertex just vacated by that token. If the path leaves the branch containing that vertex toward u, it contains the new position of the token. If it avoids that position, it lies entirely in a branch of , which has no path on k vertices. Thus, every slide is legal, and the last slide occupies u.
We next show that the numerical condition suffices to reach the prescribed k-PVC on U. The proof first increases the number of nonempty branches and then balances their token counts against the prescribed set.
Theorem 3.4. Let be properly rooted in a connected set , and let be a -PVC of with satisfying Equation (3). For , a TS-sequence inside , with fixed, reaches a -PVC whose restriction to is . The assertion also holds for by itself with , and for with a zero-slide TS-sequence.
Proof. We use two phases of transfers through u, preserving Equation (3) after each transfer. The first phase spreads tokens to empty branches, and the second phase corrects the branch counts to those of . Figure 3 illustrates one such transfer.

(a) S
(b) after slides 1, 2
(c) on U
Figure 3: For , a transfer in the proof of Theorem 3.4 moves a token from the branch rooted at to the branch rooted at through . The dotted outline encloses , and the restriction to remains fixed. Black vertices carry tokens, and white vertices are unoccupied. Panel (a) shows , with . The labels at the branches rooted at , , give their token counts 0, 2, 1, respectively. The only empty branch is rooted at ; taking it as gives in Equation (3). The numbered arrows are executed in order: , , . Panel (b) shows the state after the first two slides, and panel (c) the state after the last slide, whose restriction to is .
By Lemma 3.2, a first internal slide from u is possible. After that slide, the restriction to U omits u and still has h unoccupied vertices, so Lemma 3.1(a) gives . Thus, is defined. Whenever u is occupied, Lemmas 2.3 and 2.4 let us rearrange tokens inside each branch at its current count. In particular, a nonempty branch can have its root occupied, and a branch that is not full can have its root unoccupied.
For distinct indices , suppose that is not full and is nonempty. A transfer of one token from to is made by first making unoccupied and occupying the roots of all other nonempty branches, then sliding from to and from to . The first slide is legal exactly when the empty branches other than , together with , have at most . The second slide restores occupation of and is legal because every branch contains no path on vertices. The transfer increases by one and decreases by one. If remains nonempty, we occupy its root again by routing inside that branch. After a transfer, Equation (3) holds with as the witness: is not full, and every empty branch other than was empty before and differs from .
If there is an empty branch, one of largest height can always be chosen as under Equation (3). Indeed, if the index witnessing the condition is not empty, all empty-branch heights together with x already satisfy the bound. If that index is empty, removing a largest empty-branch height instead leaves the two largest remaining entries no larger. The conclusion holds also when some heights are equal.
For every branch , let . The branch order is decreasing height, with equal heights ordered by their root labels. Initially, we occupy the root of every nonempty branch, in increasing root order. Every root preparation uses the elementary routing procedure to reach the first vertices in label order subject to its required root occupation. The totals satisfy . The definition of has two possible forms: either every is positive, or every is at most one and the branches with form an initial segment of the branch order.
Spreading to empty branches. While there is an empty branch and another branch with at least two tokens, the recipient is the first empty branch in the branch order and the donor is the first branch with at least two tokens. The recipient has largest height among the empty branches, so the preceding argument makes this choice admissible. The donor remains nonempty after giving one token, and the recipient becomes nonempty. Thus, each transfer decreases the number of empty branches by one, and at most transfers occur. At the end of this phase, either every branch is nonempty or every branch has at most one token. No claim about the prescribed-count deficit is needed in this phase.
Balancing the prescribed counts. As long as some differs from , equality of the totals supplies both a deficient branch and a surplus branch. The recipient is the first branch with in the branch order, and the donor is the last branch with in that order. The recipient is not full, and the donor is nonempty. We verify the recipient's admissibility in the two possible states left by the spreading phase.
-
Case 1: every branch is nonempty. The internal slide condition implies , so every nonfull recipient is admissible. Since and , some prescribed count is at least two. The shape of the prescribed counts therefore makes every positive. The donor retains at least tokens, so every branch remains nonempty after the transfer.
-
Case 2: every branch has at most one token. If every were positive, equal totals would force all current and prescribed counts to equal one, contrary to the need for a transfer. Thus, every is at most one and its positive entries form an initial segment. The first deficient branch is empty and belongs to this segment. Every earlier branch of the segment is already occupied, and no empty branch outside the segment precedes it. Hence, is the first empty branch and has largest height among the empty branches, which makes it admissible. The recipient changes from zero tokens to one and the donor from one to zero, preserving the property that every branch has at most one token.
Each balancing transfer decreases by exactly one. This nonnegative integer is initially at most , so at most balancing transfers reach all prescribed counts. Finally, with occupied, the branches are routed in increasing root order to their exact restrictions in . All preparations and transfers keep fixed and consist of legal slides, as required.
For the tree by itself, the next lemma gives all possible token counts with no rigid token and joins to , for , by one removal of the token on followed by slides.
Lemma 3.5. Let be properly rooted.
(a) For every , a TS-sequence in leads from to ; it changes only one branch and , and its last slide moves the token on into that branch.
(b) For every , we have . The possible cardinalities of -PVCs of whose tokens are all movable are exactly .
(c) For every , we have by a sequence with exactly one token removal.
Proof. We first move from to inside one branch, and then derive the other two assertions.
(a) The set is together with the next vertex of the list defining the prescribed sets; let be the branch containing , with root . Then : either , or is not a branch root, and then all branch roots come before in the list and lie in . The sets and agree outside , and has one more token in than . As contains no path on vertices, Lemmas 2.3 and 2.4 turn into while stays occupied. Then the token on slides to ; the result is a -PVC of by Lemma 3.1(b), as .
(b) By (a), the token on in is movable. If some token of were rigid, then, as , Lemma 2.9 would give a path on vertices through a rigid vertex whose other vertices are never occupied; the path contains , since every path on vertices of does, and is occupied in and not rigid, a contradiction. Conversely, if all tokens of a -PVC are movable, then can be unoccupied in a reachable -PVC. By Lemma 3.1(a), its token count is at least , and it is less than because the full set has no possible slide. The sets attain every cardinality in this interval.
(c) By Lemma 3.1(b), removing the token on from leaves a -PVC, and the reverse of the sequence of (a) for leads from to . Exactly one token has been removed.
We now determine the largest number of unoccupied vertices that a prescribed properly rooted subtree can contain along a TS-sequence when all tokens are movable.
Theorem 3.6. Let be connected, let be properly rooted, and let be a -PVC of with . Then
Proof. We bound the count when the token on first moves, then show that a strict inequality at a maximizing -PVC permits one more token to move from to . Let . For a reachable -PVC omitting , Lemma 3.1(a) bounds its number of unoccupied vertices in by . For a reachable -PVC containing , there is a first slide from because its token is movable. Until that slide, the number of unoccupied vertices in does not change. An internal slide preserves the count, and a slide to increases it by one. The resulting restriction to omits , so the same bound applies to the original count as well. The total number is a second upper bound.
Let be the maximum on the left of Equation (4), and let attain it. By Lemma 3.3, we may assume that without changing . Suppose that .
Along a TS-sequence starting at , the first slide from cannot go to , since that would increase . Thus, it is internal. At the -PVC just before that slide, Lemma 3.2 and Theorem 3.4 replace the restriction to by with fixed, which gives with . The restriction has unoccupied vertices and the largest token count among the restrictions to of members of , so by Corollary 2.10. Keeping fixed, we can make unoccupied by slides in , using Lemma 2.3. Since , the set is a -PVC of by Lemma 3.1(b). The token on can now slide to : the restriction to becomes , the restriction to gains , and every path crossing contains the occupied vertex . The slide increases the number of unoccupied vertices in , contradicting the choice of . Therefore, equality holds in Equation (4).
For the induction, the restriction to must depend only on the tree and the total number of tokens. The following theorem gives such a restriction and proves that every remaining token is movable, including for every other reachable -PVC with the same restriction to . For a -PVC as in the next theorem, let and let . Since all tokens are movable and is nonempty, .
Theorem 3.7. Let be connected, let be properly rooted, let , and let be a -PVC of with . Some satisfies . Every such satisfies , and every TS-sequence in starting at extends with fixed.
Proof. We normalize at a maximum of Theorem 3.6 and, when that maximum accounts for all unoccupied vertices of , move one unoccupied vertex back to . By Theorem 3.6 and Lemma 3.3, some contains and has unoccupied vertices in , the maximum over . The first slide from along a TS-sequence starting at cannot go to , because that would exceed the maximum, so it is internal, and immediately before it, Lemma 3.2 and Theorem 3.4 take the restriction to to with fixed. Let be the resulting member of .
- Case 1: . Then , and has all unoccupied vertices of , so . By Lemma 3.5(a), a TS-sequence in leads from to , and it extends with fixed by Lemma 2.3, as is occupied. Then the token on slides to : the result has the restriction to , which contains , and the restriction to , which has one unoccupied vertex and is therefore a -PVC of , and every path crossing contains .
• Case 2: . Then and .
Let satisfy . If , then has exactly one unoccupied vertex, and by Lemma 2.4 all such subsets of are -PVCs reachable from one another in , so each vertex can be unoccupied. If , then has the maximum of unoccupied vertices in , so has the largest token count among the restrictions to of members of and unoccupied vertices, and by Corollary 2.10. In both cases, , so Lemma 2.3 extends every TS-sequence on while the restriction to remains fixed.
3.2 The Key Lemma
Demaine et al. [5] delete a safe degree-1 vertex, that is, a leaf whose neighbor has at most one neighbor of degree more than one, together with its neighbor and the resulting isolated vertices. Our proof deletes a properly rooted subtree instead, and the next example shows that, already for k = 3, the smaller subtrees deleted by Demaine et al. do not suffice for this argument.
Example 3.8. Let , and let be the path . A 3-PVC of with two tokens leaves five unoccupied vertices, and every component of has at most two vertices; hence, the 3-PVCs of with two tokens are , and . They are reachable from one another, since the token on can slide to and then the token on can slide to , and all their tokens are movable. The safe degree-1 vertices of are and , and the deletion of Demaine et al. removes or , respectively. Fixing the tokens of a 3-PVC on with occupied leaves at most one token for the path . The empty set is not a 3-PVC of this path, and the only 3-PVC of it with one token is , whose token cannot move. In the other two 3-PVCs, and are unoccupied, so the path keeps the token on in place, and a slide on the remaining path that vacates does not give a 3-PVC of . By symmetry, the same holds for . Hence, in every TS-sequence in that keeps the tokens on a deleted set fixed, some vertex of the remaining path stays occupied: for , this vertex is if is occupied and otherwise, and symmetrically for . Therefore, neither deletion can be used as in the proof of the Key Lemma, which needs a remaining part in which all tokens can be moved by TS-sequences that extend to while the deleted part stays fixed. The properly rooted subtree with the vertex set and the root behaves as required: the 3-PVC has two unoccupied vertices in it, and on the remaining path , the 3-PVCs and are reachable from one another, so all their tokens are movable.
The preceding theorem replaces part of each k-PVC by the same prescribed set and leaves a smaller tree on which all tokens are movable. That reduction proves the following analogue of the Key Lemma for independent sets of trees in Demaine et al. [5].
Lemma 3.9 (Key Lemma). Let be connected, and let be k-PVCs of with and . Then .
Proof. We use induction on , normalizing both k-PVCs on the same properly rooted subtree before applying the induction hypothesis to its complement. Let and . If , both sets are empty. If , the feasible positions of the token are the intersection of the vertex sets of all paths on vertices, or all of when there is no such path. For every two positions in that intersection, the unique path joining them in lies in every one of those paths. Thus, every vertex on the joining path is a feasible position, and the token slides along it from to . If or contains no path on vertices, Lemma 2.4 applies.
In the remaining case, , , and contains a path on vertices. In particular, , and Lemma 2.2(b) gives a properly rooted subtree with nonempty complement . A fixed choice, for example the least tuple among such subtrees, depends only on the ordered tree. By Theorem 3.7, both and reach -PVCs and whose restrictions to are . The restrictions and have the same number of tokens, all movable in . Since , the induction hypothesis joins those restrictions by a TS-sequence in . The sequence extends with the prescribed restriction to fixed, by Theorem 3.7. Concatenating the sequence from to , the extended sequence from to , and the reverse of the sequence from to proves .
3.3 The Characterization
Fixing the rigid tokens separates a k-PVC into restrictions whose tokens are all movable. The Key Lemma therefore yields a characterization for arbitrary k-PVCs of a tree.
Theorem 3.10. Let be connected, and let be k-PVCs of . Then if and only if and for the vertex set of every component of .
Figure 4 illustrates how the component counts distinguish reachable and unreachable k-PVCs with the same rigid set.

(a) S
(b)
(c)
Figure 4: The 4-PVCs of the tree in Figure 1 illustrate Theorem 3.10. Black vertices carry tokens, thick gray outlines mark rigid tokens, and white vertices are unoccupied. Dotted outlines enclose the components of , and the labels give their token counts. Panels (a), (b), and (c) show , , and , respectively, all with rigid set . In component order ; ; ; , the counts for and are , whereas those for are . Thus, is reachable from , and is not.
Proof. We fix the vertices with rigid tokens and use Lemma 2.3 in both directions. Let .
(⇒) If , their sets of reachable k-PVCs agree, so . Every TS-sequence starting at keeps occupied. By Lemma 2.3(c), it restricts to a TS-sequence on each component of , and such a sequence preserves the token count there.
(⇔) Suppose that the rigid sets and the stated counts agree. For every vertex , some member of omits . Projecting a TS-sequence to that member onto the component containing shows that . Thus, for every such , and the same argument gives . The token counts on agree, so Lemma 3.9 joins to inside . By Lemma 2.3(b), we execute these sequences one component at a time while keeping occupied. The resulting -PVC agrees with on every component and on , and is therefore .
For k = 2, Theorem 3.10 and the characterization of Demaine et al. [5] describe the same relation, but they delete different vertices. The next remark shows how the two deleted sets correspond.
Remark 3.11. Let , let be a 2-PVC of , let , and let ; we denote by the set of vertices outside with a neighbor in , and set . A slide of from to is a slide of the independent set from to , so is the set of vertices with rigid tokens of in the sense of Demaine et al. [5]; they delete together with its neighbors and compare the numbers of tokens of in the components of . We claim that consists of the vertices of and of the components of that contain no vertex of . Hence, the components of are the sets with , which contain no token of , and the components of with , on which has tokens. We prove the claim by fixing and examining the remaining components. Every vertex of is unoccupied throughout [S]. A vertex adjacent to a vertex of is occupied in every member of [S], because the edge joining the two vertices must meet the 2-PVC; thus, . By Lemma 2.3 with , the set [S] consists of the unions of with independently chosen members of for the vertex sets of the components of , and these sets are the sets with and the vertex sets of the components of . The singleton components with contain no token of . Let now be the vertex set of a component of .
• Case 1: . Then , so no slide is possible in . Hence, .
- Case 2: . Suppose that . By Lemma 2.9, some edge of has an end in . The product description of implies that this end belongs to , contradicting . Thus, , and no vertex of belongs to .
We finish with a consequence used to analyze token removals in Section 4. For a nonempty connected set , let be the set of cardinalities of -PVCs of with . When all such -PVCs of cardinality are reachable from one another, we denote their common set of reachable -PVCs by .
Corollary 3.12. For every nonempty connected set , the set is a nonempty interval of integers ending at , and exists for every . For every and , adding a token at successively gives and then the full -PVC . Equivalently, for , every -PVC in can be obtained from every -PVC in by slides and exactly removals at , where the set at consists only of .
Proof. We combine uniqueness from the Key Lemma with the effect of adding a token in Corollary 2.11. The sets with exactly one unoccupied vertex are all k-PVCs and are reachable from one another by Lemma 2.4. Each vertex is unoccupied in one of them, so , including when . The full set has no legal slide and has a rigid token on every vertex, so . By Lemma 3.9, all k-PVCs of each count with movable tokens have the same set of reachable k-PVCs. For every fixed , Corollary 2.11 gives a unique set of reachable k-PVCs after adding a token, and its tokens are all movable unless it is the full set. Hence, is upward closed up to , and these successive additions give the asserted sets . Reversing each addition edge gives a token removal at ; TS-sequences within each set of reachable k-PVCs connect the required representatives before and after the removal. The count difference fixes the number of removals at exactly .
4 Algorithm for Trees
By Theorem 3.10, deciding reachability reduces to computing the vertices with rigid tokens. We first define two integers for every rooted subtree and show how they determine the minimum of when all tokens are movable. The proof counts the tokens that can be removed at the root, first from the set in which every vertex is occupied and then from an arbitrary k-PVC whose tokens are all movable. We then give Algorithm 1, which removes vertices from a set of candidates for rigid tokens, and prove its correctness. Finally, we analyze its running time and prove Theorem 1.1.
4.1 A Recurrence for Rooted Subtrees
Throughout this subsection, is nonempty and connected, and . For each neighbor of in , the rooted subtree supplies two integers and . The following recurrence defines and by induction on . Let be the number of positive members of the multiset , and let list those members in nondecreasing order. Let be the largest integer in such that . For each , choosing the smallest members minimizes the sum of the two largest chosen members. Consequently, is also the maximum cardinality of a submultiset of the positive members whose two largest members sum to at most . With the maximum of an empty multiset interpreted as zero, the recurrence is
(5)
Figure 5 illustrates the recurrence and a set attained by slides and removals at the root.

(a)

(b)
Figure 5: The values of the recurrence in Equation (5) for on rooted at . In panel (a), every vertex is labeled with the pair of its rooted subtree, and no tokens are shown. At , the positive child values are , so , , , and . Panel (b) shows the set , reached from by slides and removals at ; black vertices carry tokens, and white vertices are unoccupied. The set attains both bounds of Theorem 4.3: and .
In particular, the pair for a single vertex is . The recurrence always gives : when , the largest positive member is at most , and when , the value is zero. It also gives . Indeed, if has children, the induction hypothesis and give
The values occur only through their sum. Thus, changing one by an integer while keeping every fixed changes by and leaves unchanged. A child with contributes only to the recurrence. Both observations continue to hold when the change is passed along the path to another root.
The recurrence takes a simple form for the two smallest values of k.
Remark 4.1. For , every positive value equals 1, which exceeds , so . Thus, is plus the number of children with , and if no child has and otherwise. For a graph , let denote its independence number, the maximum cardinality of an independent set of , with value zero for the empty graph. For , we have and . We prove these identities by induction on . For , they follow from . Suppose that the identities hold for every child . Then and . Consequently, . The maximum cardinality of an independent set containing is , so . This maximum exceeds by one exactly when no child has . In particular, exactly when belongs to every maximum independent set of . For , the positive values are 1 and 2, and if some child has and otherwise. Thus, , and is 1 if no child has a positive value, 2 if exactly one child has a positive value and this value is 1, and 0 otherwise.
We will use the following direct interpretation on subtrees that contain no path on k vertices.
Lemma 4.2. For every integer , every connected set such that contains no path on vertices, and every , the recurrence gives and equal to the number of vertices of a longest path in starting at .
Proof. We compare the recurrence with the rooted heights, by induction on . For a single vertex, the assertion follows from the pair . For each child of , the induction hypothesis gives and equal to the rooted height at . The two largest child heights sum to at most , since otherwise their paths together with would contain a path on vertices. Hence, , , and . The last expression is exactly the rooted height at .
4.2 Removing Tokens at the Root
We now interpret as the minimum number of tokens remaining after slides and removals at from the -PVC . Among the resulting -PVCs with that many tokens, the minimum of at is . The relation includes any number of slides and removals at , including zero removals.
Theorem 4.3. For every integer , every nonempty connected set , and every , the following statements hold.
(a) Every k-PVC Z with satisfies .
(b) Every such Z with satisfies .
(c) Some k-PVC Z with satisfies both and .
Proof. We prove (a) and (b) together by induction on , bounding the number of unoccupied vertices in the child subtrees; (c) is proved after Theorem 4.6, whose proof uses only (a) and (b). Figure 5 illustrates a set attaining both bounds in part (c). For a single vertex, removing its token gives the empty set, with and . For a child of , let , , , and . The induction hypothesis says that at most tokens can be removed at from , and that at is at least after removals. In particular, , since a set in which all vertices are occupied permits one removal. Let and be the integers used in Equation (5) at .
(a) We follow an arbitrary sequence of slides and removals at from to . Its restriction to consists of internal slides and of additions or removals at when a token crosses . The number of tokens in that restriction never exceeds . By Corollary 2.6, every restriction reached in this way can also be reached from by slides and removals at alone. Consequently, it has at most unoccupied vertices. Whenever it has exactly unoccupied vertices, its value of at is at least .
- Case 1: is unoccupied at the state under consideration. Among the children with , those whose subtrees have exactly unoccupied vertices must have their values in a multiset with . Otherwise, their unoccupied paths together with would contain an unoccupied path on vertices. There are at most such children. Each of the other children with positive has at most unoccupied vertices. Hence, the total number of unoccupied vertices is at most
- Case 2: r is occupied at the state under consideration. If no slide has yet brought a token to r, then r has never been unoccupied, and no token has left any through r. Every child subtree is then full, so the bound holds. Otherwise, immediately before the last slide bringing
a token to r, at most m children with positive had exactly unoccupied vertices. That slide changes the number of unoccupied vertices in only its source subtree. No later operation involving r occurs before the occupied state under consideration, since each departure or removal would require another arrival to occupy r again. Thus, at most children with positive have exactly unoccupied vertices. The total number of unoccupied vertices is at most
Both possible occupations of satisfy Equation (6), which proves .
(b) Suppose that the terminal configuration satisfies . If , then , and the assertion follows from the nonnegativity of . If , the bound for an occupied is , which is one smaller than Equation (6). Therefore, is unoccupied, and equality requires exactly unoccupied vertices in every . The induction hypothesis now gives
4.3 The Minimum of
To extend Theorem 4.3 to every k-PVC whose tokens are all movable, we again remove a properly rooted subtree. The next lemma computes the effect of that removal on c and .
Lemma 4.4. For every integer , every nonempty connected set , and every edge uv of such that is properly rooted, we have
Moreover, for every ,
Proof. We first evaluate the recurrence at and then follow the change along the path to . Every child subtree of in contains no path on vertices. By Lemma 4.2, its pair is , where is its rooted height. Since contains a path on vertices, not all these heights have . Thus, the recurrence gives and . Deleting removes a child with value from the recurrence at . It subtracts from there and does not change . At every subsequent vertex of the -path, one incoming value of decreases by , while every incoming value of is unchanged. The additivity observation after Equation (5) gives the same change at each vertex of the path, including .
We will also join two k-PVCs whose tokens are all movable, using occupied vertices at the joining edge.
Lemma 4.5. For every integer , every connected set , and every edge uv of , let and . If and are -PVCs of and , respectively, with , , and , then is a -PVC of and .
Proof. We keep one end of the joining edge occupied while performing TS-sequences on the other side. Every path that meets both sides contains u and v, so is a k-PVC. With B fixed, every TS-sequence in is valid in P, because v remains occupied. Hence, every vertex of U can be made unoccupied. Starting again at and keeping A fixed shows the same assertion for every vertex of , since u remains occupied. Therefore, no vertex belongs to .
The next theorem shows that the lower bounds of Theorem 4.3 are attained from every k-PVC whose tokens are all movable. The number of removable tokens is consequently .
Theorem 4.6. For every integer , every nonempty connected set , every , and every k-PVC S of with , the following statements hold.
(a) Every k-PVC Z with satisfies .
(b) Every such Z with satisfies .
(c) Some k-PVC Z with satisfies both and .
Proof. We obtain the lower bounds by adding tokens at , and prove attainment by induction on after removing a properly rooted subtree that avoids . Let and .
(a) By Corollary 3.12, . Concatenating those operations with gives . Part (a) of Theorem 4.3 yields .
(b) The same concatenation and part (b) of Theorem 4.3 give whenever .
(c) We distinguish the following cases for the induction proving attainment.
-
Case 1: contains no path on vertices. As long as a token remains, Lemma 2.4 permits a TS-sequence that occupies . Removing that token leaves a -PVC, since every subset of is a -PVC. After removals, the empty set remains. By Lemma 4.2, its token count is , and its value of at is the rooted height .
-
Case 2: contains a path on vertices, and does not. The definitions of , and apply to the whole rooted tree , with no exterior. The computation in the first paragraph of the proof of Lemma 4.4 gives . By Lemma 3.5, the number lies between and , and all tokens of are movable. By Lemma 3.9, there is a TS-sequence from to . Repeatedly applying the last assertion of Lemma 3.5 removes tokens at until is reached. The latter -PVC has tokens and occupies , so it attains both bounds.
-
Case 3: contains a path on vertices. By Lemma 2.2(a), there is an edge such that is properly rooted and . Let , , and . We first prove attainment for all -PVCs at the current order whose number of unoccupied vertices is greater than .
-
Case 3.1: . By Theorem 3.7, a TS-sequence reaches a k-PVC that agrees with on and whose restriction to has all tokens movable. That restriction has tokens and is not full, since it has unoccupied vertices. The induction hypothesis on the strictly smaller tree removes tokens at and reaches a k-PVC with
Every slide and removal in these operations is valid in with fixed, because stays occupied. An unoccupied path starting at cannot enter for the same reason. Thus, the resulting -PVC satisfies
where the last equalities follow from Equation (7).
-
Case 3.2: and . Let on , and let be a -PVC of with exactly one unoccupied vertex other than . All tokens of are movable by Lemma 3.5. All tokens of are movable by Lemma 2.4, since every position of its single unoccupied vertex is permitted. The two incident vertices and are occupied. By Lemma 4.5, all tokens of are movable. Its token count gives unoccupied vertices in . The preceding argument, already proved at the current order using only the induction hypothesis on , gives operations from attaining the bounds. Since , we have . By Corollary 3.12, adding tokens at from reaches, at count , the unique set of pairwise reachable -PVCs whose tokens are all movable. That set is by Lemma 3.9. Reversing the additions, with their intervening TS-sequences, gives using exactly removals. Following the operations just established from proves attainment from .
-
Case 3.3: and . The complementary set is , and . The k-PVC has tokens. Keeping occupied allows every vertex of to become unoccupied, since all tokens of are movable in . In particular, a TS-sequence in can make unoccupied. The token on can then slide to : its new position meets every path crossing the edge , and the newly unoccupied vertex has no other neighbor. Hence, all tokens of are movable in . At itself, removing the token on leaves , a k-PVC of , and its value of at is one because is occupied. The singleton pair and Equation (7) give
The assumption is exactly . As in the preceding case, Corollary 3.12 and Lemma 3.9 give with removals. The final removal at therefore attains both bounds.
The induction uses only smaller trees, except for the explicitly completed case at the current order.
Proof of Theorem 4.3(c). We remove the token on from and apply Theorem 4.6(c). The set has one unoccupied vertex, so it is a -PVC of , and by Lemma 2.4, all such sets are reachable from one another, so . Theorem 4.6(c) for gives a -PVC with , and , and the removal at followed by these operations gives .
For a nonempty connected set , a nonnegative integer , and , let
The following consequence is the form used by Algorithm 1.
Corollary 4.7. For every integer , every nonempty connected set , and every k-PVC S of with , we have, for every ,
Moreover,
Proof. We separate the cases according to whether a token can still be removed at . By Theorem 4.6, .
-
Case 1: . The operations attaining include a first removal at . The preparation before that removal is a TS-sequence from to a -PVC occupying . The minimum in Equation (9) is therefore zero.
-
Case 2: . No removal is possible, so the k-PVCs reached by are precisely the members of . Parts (b) and (c) of Theorem 4.6 give the minimum .
Finally, a vertex is never occupied exactly when its minimum value of is positive, which proves Equation (10).
4.4 Computing the Rigid Tokens
Like the linear-time algorithm of Demaine et al. [5] for independent sets, Algorithm 1 starts with all tokens as candidates for rigid tokens and repeatedly removes a candidate whose token can move while all other candidates stay occupied. Demaine et al. [5] delete such a token from the independent set without changing the rigidity of the other tokens; deleting a token from a k-PVC may destroy the k-PVC property, so Algorithm 1 keeps S fixed and removes the vertex only from the set of candidates.
Let be nonempty and connected, and let be a k-PVC of . For and , let be the vertex set of the component of containing , and let
Algorithm 1: Computing the rigid tokens
Input: An integer , a nonempty connected set , and a k-PVC S of
Output: and
1 ;
2 while true do
3 foreach vertex set P of a component of do
4 ;
5 Compute for all by Equation (5);
6 and ;
7 Find a pair satisfying Equation (11), if one exists;
8 if no such pair exists then
9 return ;
10 ;
Definition 4.8. For , , and a neighbor of , the pair satisfies the slide condition for if
The braces in Equation (11) denote a multiset, with one member for each indicated neighbor.
The condition matches Lemma 2.1 after making z unoccupied and minimizing independently at the other neighbors outside B. The proof below establishes that these preparations are available whenever the condition is used.
Algorithm 1 uses the formula for the minimum of only on restrictions for which all tokens are movable. That property follows from the invariant of the proof below, which each removal preserves.
Theorem 4.9. For every integer , every nonempty connected set , and every k-PVC S of , Algorithm 1 terminates after at most rounds and returns .
Proof. We prove that every removal preserves the invariant, and then use the first slide from a remaining candidate to prove completeness at termination. At the start of each round, the invariant is that every vertex of is unoccupied in some k-PVC reachable from S by slides that keep every vertex of B occupied. Initially, , and every vertex of is unoccupied in S itself. The invariant gives
since, by Lemma 2.3(c), the sequence for a vertex restricts to a TS-sequence in from to a set omitting .
Suppose that the invariant holds for . While stays occupied, TS-sequences inside different components of can be performed independently by Lemma 2.3. By Equation (12) and Corollary 4.7, Algorithm 1 computes the actual minimum of for each restriction .
Suppose that satisfies the slide condition. Distinct neighbors of outside lie in distinct components of , since a path joining two of them in that graph would create a cycle through . The invariant permits a TS-sequence making unoccupied in its component. For every other neighbor of outside , Corollary 4.7 permits a TS-sequence reaching value at in its component. All these preparations can be performed independently while keeping occupied. After the preparations, the token on can slide to by Lemma 2.1 and Equation (11). Equivalently, every newly unoccupied path must pass through , avoid the now occupied vertex and the vertices of , and have at most vertices.
The preparations and the slide form a TS-sequence from that keeps every vertex of occupied and makes unoccupied, and the sequences of the invariant for the vertices of keep , hence , occupied. So the invariant holds for .
Every round except the last removes one vertex from , so at most rounds occur. Suppose that the final set contains a vertex that is not rigid. A TS-sequence from making such a vertex unoccupied has a first slide that makes some vertex of unoccupied. Let that slide move a token from to , and let be the preceding -PVC. Until that slide, all vertices of stay occupied, so every restriction to a component of stays in . In particular, , and, for every other neighbor of ,
Because all vertices of are occupied, an unoccupied path starting at cannot leave . The actual values on the right therefore satisfy the necessary slide test at . Decreasing entries of a multiset cannot increase , so satisfies Equation (11). That conclusion contradicts termination. Hence, . The invariant already shows that every vertex outside can be made unoccupied globally, so .
With the true rigid set fixed, Lemma 2.3 identifies with the independent choices of its restrictions to the components of . By Equation (10), each is exactly the set of vertices never occupied in its component. No vertex of is never occupied. Therefore, their union is , as required.
Figure 6 illustrates the successive candidate sets in Algorithm 1.

(a)

(b)
(c)
(d)
Figure 6: The run of Algorithm 1 on with . Panels (a)–(d) show the candidate set after removals, for . Black vertices carry the tokens of the fixed input ; thick gray outlines mark the candidates in , while the other black vertices have been removed from the candidate set. White vertices are unoccupied, and the light gray vertices in the final panel are never occupied. Values beside neighbors outside are ; each arrow gives a pair satisfying the slide condition and indicates removal of its source from the candidate set, without changing . The successive pairs are , , ; the output is .
Remark 4.10. The choice of a pair satisfying the slide condition in Algorithm 1 is arbitrary. The invariant is preserved for every such pair, and the proof at termination uses only the absence of another pair. Thus, every removal order returns the same sets and .
4.5 Running Time and Proof of the Decision Theorem
We describe how to compute every pair in one component in time, and how to check all slide conditions in linear time per round. These bounds give the claimed running time after at most rounds.
For each vertex set of a component, each round of Algorithm 1 roots temporarily at an arbitrary vertex and makes two passes. The first pass, from the leaves toward the temporary root, computes the pair for every subtree below an edge. The second pass, from the temporary root toward the leaves, computes the pair on the other side of every edge. At a vertex , a sum stores the incoming values of , and a histogram with indices stores the multiplicities of the incoming values of . Initializing the histograms takes time, and accumulating their entries and the sums takes time.
The histogram determines , , and in time. To find , the positive indices are processed in increasing order while retaining the largest selected value and the number of selected entries. For an index of positive multiplicity, its first occurrence is permitted exactly when its sum with the previous largest selected value, or zero if none was selected, is at most . After that first occurrence, all further occurrences of are permitted exactly when . Thus, each index takes constant time: either all of its occurrences are included, or the longest permitted prefix ends after zero or one occurrence at that index. After the first failed inclusion, no longer prefix is permitted. The scan therefore computes exactly the value of Equation (5), without listing every occurrence separately for each edge.
In the second pass, all pairs entering a vertex are known when is processed. The pair sent toward a neighbor is obtained by subtracting the incoming value of from and one occurrence of its value of , and then evaluating the recurrence on the remaining histogram. The subtracted entry is restored before processing another neighbor. Each evaluation takes time. There are two ordered ends of each edge and one full-root evaluation for each vertex, so the two passes take time in total. They also compute for every possible root . Over all components of , the work is , where . Finding the components, counting the original tokens in them, and computing the values and the sets take additional time.
For a candidate , a scan of its neighbors outside keeps the three largest values , with multiplicity and their corresponding vertices. For every proposed target , removing its occurrence from those three, if present, leaves the two largest values among the other neighbors; missing values count as zero. If is not among those three vertices, removing it does not change the two largest values. Thus, each pair is tested in constant time after the scan at . The sum of the vertex degrees in the tree is , so finding all candidates for removal takes time per round. For , one round of Algorithm 1 consequently takes time and uses polynomial space, where .
Proof of Theorem 1.1. The decision algorithm computes the two rigid sets and applies the characterization of reachability. For , every subset is a k-PVC, so Lemma 2.4 gives reachability exactly when . Suppose that . The tree condition and the two k-PVC conditions can be checked in time. For the latter checks, a pass through each component of and of records the two largest downward path lengths at every vertex and rejects if their sum together with that vertex is at least . The input satisfies the k-PVC conditions exactly when neither unoccupied forest contains a path on vertices.
The decision algorithm runs Algorithm 1 for and for with . By Theorem 4.9, the returned first sets are and . If they differ, it rejects. Otherwise, with their common value denoted by , it accepts exactly when for the vertex set of every component of . By Theorem 3.10, this condition is equivalent to reachability. Comparing the rigid sets and the component counts takes time. There are at most rounds per input -PVC, each taking time by the preceding analysis. The total running time is therefore .
5 Finding a TS-Sequence
We first describe short branch operations and a normalization procedure, then give two procedures for choosing a k-PVC with a prescribed property at one vertex. We then connect the two supplied endpoints by recursion on smaller subtrees. Both endpoints first receive the same prescribed restriction on one side of an edge, and a single recursive call connects their remaining restrictions. Finally, we bound the length of the output and the running time in terms of the order of the tree. Throughout this section, all choices among vertices follow the fixed order from the preliminaries.
5.1 Elementary Procedures and Prescribed Targets
Under the hypotheses of Lemma 2.4, the following explicit routing procedure joins two sets of the same cardinality on a tree with vertices. This leaf-pruning procedure appears in Kornhauser [12]. The procedure fixes a leaf at a time, always choosing the least remaining leaf. If its occupation differs from the target, a breadth-first search finds a nearest vertex with the desired occupation. Every intermediate vertex of the joining path has the opposite occupation, so successive slides along the path give the leaf its desired occupation. The leaf is then fixed, and the procedure continues on the remaining tree. The token counts in the remaining tree agree with the target counts, so the search always succeeds when the leaf differs from its target. At a stage with vertices, at most slides are needed. Thus, the procedure uses at most slides. It applies when the tree contains no path on vertices or when fewer than vertices are unoccupied.
The same search occupies the root of a nonempty branch of a properly rooted subtree, or makes the root unoccupied when that branch is not full. In the first case, a nearest token moves toward the root. In the second case, successive tokens move toward a nearest unoccupied vertex, until the root is unoccupied. These moves are legal while the root of the properly rooted subtree is occupied, since the branch contains no path on k vertices. When the root u of the properly rooted subtree itself is unoccupied, a nearest token inside that subtree can move to u by Lemma 3.3. Indeed, at each slide, a path through the newly unoccupied vertex either meets the token at its new position or stays inside one branch, where no path on k vertices exists. This procedure leaves the entire exterior fixed.
When two branch configurations differ only by exchanging one occupied vertex with one unoccupied vertex, we route the tokens along the path joining those vertices. For a connected vertex set and vertices , the procedure EXCHANGE() returns the empty list if . Otherwise, it scans the unique path from to . Starting at , it moves each token encountered along that path back to the position vacated by the preceding token, with the first token moving to . The scan continues until it has moved the token initially at . The next lemma gives the conditions under which these slides are legal in the ambient tree.
Lemma 5.1. Let , let be a tree, let be properly rooted, and let be a branch of . Suppose that is a -PVC of with and that . If and , then EXCHANGE( ) is a TS-sequence from to with exactly slides. Every slide has both ends in , so every prefix fixes the entire restriction outside . If , the returned list is empty, regardless of the occupation of that vertex.
Proof. We partition the path into intervals ending at its initially occupied vertices. The case follows from the first test of the procedure. In the other case, let be the path, with and . Let be its initially occupied indices, listed in increasing order, so that , and let . For , the token at moves successively to . The destination is vacant: this holds initially for , and the preceding interval has just vacated it when . The intermediate vertices of the interval were initially unoccupied and have not yet been visited. Thus, every slide goes from an occupied vertex to an adjacent unoccupied vertex. The vertex stays occupied, and contains no path on vertices, so Lemma 2.3 makes every slide legal in . Each initially occupied internal path vertex is vacated and then occupied by the following interval. Consequently, the only final occupation changes are at and , and the number of slides is . All these slides stay inside , proving the assertion for every prefix.
We now specify the normalization used by the pair construction. Its endpoint is the same prescribed set as in Theorem 3.4. For a properly rooted side , let be its branches, let be their roots, and let be their heights. The branch order is decreasing height, with equal heights ordered by their root labels, as in the definition of . For a configuration containing , let and . Let and . The procedure NORMALIZE( ) returns immediately when is full. Otherwise, it first occupies every nonempty branch root by the nearest-token procedure, processing the roots in increasing label order. While the branch counts differ from the prescribed counts, it chooses the first empty branch as recipient if there is one, and otherwise the first deficient branch, for which . Its donor is the last surplus branch, for which . It makes the recipient root unoccupied by the nearest-unoccupied-vertex procedure, slides from to that root and from the donor root to , and occupies the donor root again if the donor remains nonempty. Finally, it routes each branch to its exact restriction in , processing the roots in increasing label order. All searches visit neighbors in increasing vertex order.
The occupied roots make each transfer use only two branch preparations. The following lemma proves both the required ambient correctness and the quadratic length bound.
Lemma 5.2. Let , let be a tree, let be properly rooted, and let be a -PVC of with . Suppose that or that Equation (3) holds with the exterior value . The procedure NORMALIZE( ) returns a TS-sequence of at most slides from to . Every prefix fixes the restriction outside .
Proof. We maintain the internal slide condition and occupied roots in nonempty branches at the boundaries of each transfer, and decrease the total deficit from the prescribed branch counts at each transfer. The full case returns the empty list and has . Otherwise, Lemma 3.2 permits an internal departure from . The restriction after that departure omits and has unoccupied vertices, so Lemma 3.1(a) gives . Thus, is defined and has the same token count on as .
The initial root preparations are legal because stays occupied and every branch contains no path on vertices. They preserve all branch counts and the exterior, hence also the internal slide condition. At the start of the transfer loop, every nonempty branch has an occupied root and . The definition of gives two possibilities: every is positive, or the are zero or one and their positive entries form an initial segment of the branch order.
If the counts differ, equality of the totals supplies a surplus branch and a deficient branch. When there is an empty branch, the first such branch is deficient. Indeed, this follows at once if every is positive. In the other case, if the first empty branch were beyond the positive initial segment, every prescribed positive branch would contain at least one token, and equality of the totals would force all counts to agree. If there is no empty branch, the first deficient branch exists by equality of the totals. In either case, the recipient is not full, and the last surplus branch is a distinct nonempty donor.
We next verify that the chosen recipient permits a departure from . If there is an empty branch, has largest height among the empty branches. Removing its height from the tested multiset leaves the two largest entries no larger than when any other empty height is removed. If the witness in Equation (3) is nonempty, the entire multiset of empty-branch heights already satisfies that condition. Thus, the condition holds with in either case. If no branch is empty, the condition reduces to , and every nonfull recipient is admissible.
Making unoccupied is legal while u stays occupied. Every other nonempty branch root remains occupied, so the admissibility just proved makes the slide from u to legal. The slide from the donor root to u is then legal because it occupies u and the branch contains no path on k vertices. If still has a token, its nearest token is moved to . This restoration is legal with u occupied and reestablishes the occupied-root invariant. The recipient count increases by one, the donor count decreases by one, and all other counts stay fixed. After the transfer, is not full, and every empty branch other than was empty before the transfer and differs from . Therefore, Equation (3) holds with B as its next witness.
The nonnegative integer decreases by exactly one at each transfer. Its initial value is at most , so iterations suffice. If no donor or recipient exists, equality of the totals already gives for every branch. Thus, the loop with iterations as its limit ends with all prescribed counts attained. The final branch routings are legal with occupied and reach the exact sets . Every emitted slide has both ends in , so the complete list and all its prefixes preserve the exterior.
For the length bound, let . The branches partition , so , and distinct branches have total order at most . The initial root preparations use at most slides. A transfer from to uses at most slides, including donor restoration when needed. Finally, the branch routings use at most slides. The complete length is therefore at most
Lemma 2.12 supplies the movability needed when a preparation is restricted to one side of an edge.
We next choose a target before constructing a TS-sequence to it. For a connected set , a vertex , and an integer , suppose that some -PVC of has tokens and all its tokens are movable. There are two possible requests: the target must leave unoccupied, or it must minimize among -PVCs with movable tokens. By Lemma 3.9, all these -PVCs are reachable from one another, so the latter request is also a minimum over each of their sets .
Lemma 5.3. If are integers with , is connected, , and some -PVC of has tokens, all movable, then a -PVC of with tokens, all movable, can be constructed in time polynomial in subject to either prescribed requirement: , or is minimum among all such -PVCs.
Proof. We give a recursive construction that keeps in the remaining subtree, and prove its properties by induction on . Since all tokens of some -token -PVC are movable, . Let .
-
Case 1: contains no path on vertices. Every -element subset is a -PVC, and Lemma 2.4 joins every two such subsets. Since , each vertex can be left unoccupied, so every token is movable. For the first request, the target consists of the first vertices of . For the second request with , it consists of and the first other vertices, attaining . When , the only target is the empty set, which attains the only possible value of .
-
Case 2: contains a path on vertices. The tree is rooted at . A deepest vertex whose descendant subtree contains a path on vertices determines a properly rooted subtree with root . Among vertices of maximum depth, the least triple resolves ties, where is the parent of when . Every branch of contains no path on vertices.
-
Case 2.1: . Then . By Lemma 3.5, , where . For the minimum request, the target is . Its root is occupied, so it attains zero, and all its tokens are movable by Lemma 3.5. For the request that be unoccupied, the target first occupies the roots of the longest branches, using the fixed order to resolve ties. It then occupies the least unused vertices other than until its cardinality is . The set of the roots of the longest branches is a -PVC: its entirely unoccupied branches are the shortest branches, whose heights have at most , so every unoccupied path through has at most vertices, as in the proof of Lemma 3.1(a). The target contains this set and is therefore a -PVC as well. The procedure for occupying gives a TS-sequence from this target to a -PVC with occupied. The reverse of the last slide is an internal slide from . Thus, the resulting -PVC satisfies Equation (3) with exterior value zero and reaches by Theorem 3.4. All tokens of the original target are therefore movable by Lemma 3.5.
-
Case 2.2: . Let . The set is connected and contains . Except for the final special case below, the target places on , where , and recursively constructs the requested target on with tokens. To justify this recursive call, Theorem 3.7 supplies a reachable -PVC with on and all tokens movable in its restriction to . The induction hypothesis therefore applies at the stated count. By Lemma 3.9, the resulting target on is reachable from that restriction. These moves lift with occupied by Lemma 2.3. Hence, the combined target has all tokens movable in . The argument certifies reachability of the target; the procedure computes only its vertex set and does not seek the TS-sequence used in this justification. The first request is satisfied because remains in and is unoccupied in the recursive target.
For the minimum request, three cases remain.
-
Case 2.2.1: . Then and , where . By Lemma 4.4, and . The formula in Corollary 4.7 gives the same minimum at count on and at count on . An unoccupied path from cannot cross the occupied vertex , so the recursive target attains that minimum in as well.
-
Case 2.2.2: and . The recursive target on has exactly one unoccupied vertex. Such a -PVC can occupy , so its minimum at is zero. The induction hypothesis attains zero, which is also the minimum in .
-
Case 2.2.3: and . The target is instead . Its cardinality is , and it occupies , attaining zero. Every vertex of can be made unoccupied while remains occupied, by Lemmas 2.3 and 3.5. After is made unoccupied in this manner, the slide from to is legal: becomes occupied, and is a leaf of . Thus, the token on is movable as well.
Every recursive call removes a nonempty set and recurses only once on the smaller set . There are at most calls. The subtrees, branch heights, ordered branch lists, and sets are computed by tree traversals and finite lists of vertices. Each call therefore takes polynomial time, proving the running-time assertion.
Algorithm 2: CONNECTPAIR(P, S, S')
Input: two reachable k-PVCs S, S' of the tree T[P] Output: a list of slides from S to S'
1 if S = S' then 2 return the empty list; 3 ; 4 if then 5 For each component Q of T[P] - R, call CONNECTPAIR(Q, S \cap Q, S' \cap Q), keeping all other vertices fixed; 6 return the concatenation of these lists; 7 ; 8 if q < k or T[P] contains no path on k vertices then 9 return the elementary routing list from S to S'; 10 if then 11 return the path of the token from its position in S to its position in S'; 12 Choose the properly rooted side by the least triple ( ); let ; 13 ; 14 ; 15 , omitting the call if the two restrictions agree; 16 return ;
5.2 The Recursive Construction
The procedure CONNECTPAIR(P, S, S') constructs a TS-sequence between its two supplied endpoints. It first fixes the common rigid set. When no token is rigid, it puts the same prescribed set on a properly rooted subtree in each endpoint and makes one recursive call between the remaining restrictions. For a list A of slides, its inverse reverses the list and exchanges the source and destination of every slide. The concatenation of lists is denoted by . Every returned list is retained in full, including repeated slides and consecutive inverse slides.
We first specify how a recursive call prepares the exterior of a properly rooted subtree. Let be connected and let . To make unoccupied, the preparation returns the empty list if is already unoccupied. Otherwise, its precondition is . It computes and the vertex set of the component of containing . All tokens of are movable by Lemma 2.3. The preparation constructs the target of Lemma 5.3 on , with the same token count and with unoccupied, and calls CONNECTPAIR once to reach that target. The resulting list lifts with and the other components fixed.
To minimize , the preparation returns the empty list if is occupied. Otherwise, it uses the minimum target of Lemma 5.3 in the component defined above. Every unoccupied path from avoids , so the minimum in is also the minimum in . The exact product assertion of Lemma 2.3 justifies fixing the other components. Each preparation therefore makes at most one recursive call, on . When the current restriction already equals the chosen target, that call is omitted.
The next algorithm states the pair recursion. The components in its rigid case are processed in increasing order of their greatest vertices. In its one-token case, the unique token moves along the path to the unique token of . Both positions meet every path on k vertices, and their joining path also lies in every such path, so every intermediate position is feasible.
In the nonbase case, , , and contains a path on vertices. The existence of the proper side follows from Lemma 2.2. Its choice depends only on , , and the vertex order. Let . The procedure SETTLE returns a reachable endpoint whose restriction to is exactly . Its early return tests equality with this set, rather than only the number of unoccupied vertices. In Algorithm 3, is updated after every slide, and records those slides in their execution order.
The normalizations in Algorithm 3 use the single transfer loop of Lemma 5.2. The two calls to EXCHANGE return the empty list when . All nearest-token and nearest-unoccupied-vertex preparations use breadth-first search, visiting neighbors in increasing vertex order.
The following lemma justifies all changes made by SETTLE, including the two-step bound in its first
Algorithm 3: SETTLE(P, U, W, u, v, S)
Input: a k-PVC S of T[P] with no rigid token and a properly rooted side , with
Output: an endpoint A with and its list from S
1 ; ; ;
2 if then
3 return ;
4 Occupy u by the nearest-token procedure inside U;
5 for do
6 if then
7 break;
8 Minimize by preparation in W;
9 if Equation (3) holds for x then
10 Normalize U by Lemma 5.2, keeping W fixed; break;
11 Occupy the root of every nonempty branch of , in increasing root order;
12 Make v unoccupied by preparation in W;
13 Slide u to v, then occupy u by the nearest-token procedure inside U;
14 ;
15 while do
16 Make v unoccupied by preparation in W; slide u to v;
17 Let z be the unique vertex of , let B contain z, and let w be its root;
18 Slide w to u; execute EXCHANGE(B, S, z, w); ;
19 if then
20 Let z be the unique vertex of , let B contain z, and let w be its root;
21 Execute EXCHANGE(B, S, w, z);
22 Slide u to w, then slide v to u;
23 return ;
stage and the final return of one token. Its hypothesis on smaller calls will be supplied by induction in the pair construction.
Lemma 5.4. Let , let be a tree, let be properly rooted, and let . Suppose that is a -PVC of with no rigid token and that every recursive pair call on a proper subset of returns a TS-sequence between its supplied reachable endpoints. Then terminates and returns a TS-sequence from to its returned endpoint , with . Every token of is movable in .
Proof. We first reach a prescribed set on U, then adjust its number of unoccupied vertices to . Every operation below is legal, so every intermediate configuration remains reachable from S and has no rigid token in . The early return has the required restriction by its exact equality test. Otherwise, Lemma 3.3 occupies u without changing the number of unoccupied vertices in U or the exterior.
The first normalization. If is full, its restriction is already . Otherwise, the minimum preparation attains by Lemmas 3.9 and 5.3 and the hypothesis on smaller pair calls. If Equation (3) holds, Lemma 5.2 reaches for the current count while preserving the entire exterior. Suppose that this condition fails at the attained minimum. Before a first slide from , branch counts are unchanged and the exterior stays in its current reachability class. Every possible exterior value is at least , and increasing that value cannot make the failed condition hold. Thus, Lemma 3.2 rules out an internal first slide from . Since its token is movable in , a first slide from must be possible and must go to . The branches that are empty before this slide remain empty after it, so their heights have at most . The exterior cannot be full, since then it could not change while remained occupied and the first slide to would be impossible. By Lemma 2.12, the preparation can therefore make unoccupied inside .
The algorithm occupies every nonempty branch root and makes v unoccupied. The slide from u to v is legal: paths crossing uv meet v, and an unoccupied path through u inside U has at most vertices. The nearest-token procedure occupies u again inside U. This failure step increases h by one and leaves v occupied. Consequently, the second minimum preparation is empty and its exterior value is zero.
To justify normalization at that value, suppose that is occupied and is not full in any reachable state. A first slide from is possible because its token is movable. If that slide is internal, Lemma 3.2 gives the internal slide condition, which remains true after the exterior value is decreased to zero. If the slide goes to , the entirely empty branch heights have . At least one branch is not full, and choosing it as the receiving branch gives the same condition with exterior value zero. Thus, the second step normalizes successfully. There is at most one failure and at most one normalization, within the two stated steps. The algorithm now recomputes from the resulting configuration, whose restriction to is .
Increasing the count to . Suppose that . Then , and is not full because it has unoccupied vertices. The attachment lemma and a smaller pair call make unoccupied. By Lemma 3.1(b), is a -PVC of , so sliding to is legal. The sets and differ in exactly one vertex . Let contain and let be its root. The definition of the prescribed sets puts in , because branch roots precede other branch vertices. The slide from to is legal: it occupies , and contains no path on vertices. The two slides have replaced the restriction by and added to the prepared exterior. If , this restriction is already , and the exchange is empty. Otherwise, is occupied and is unoccupied, so Lemma 5.1 moves a token from to and leaves every other occupation unchanged. The restriction on is then exactly , while the prepared exterior retains its added token at . Each iteration increases by one, so the loop reaches if it starts below that value.
Returning one token when the initial count is larger. By Theorem 3.6, the count after the first stage is at most . If that count exceeds , it is therefore exactly , with and full. The increasing loop makes no move. Let be the unique vertex of , let contain , and let be the root of . The root lies in . If , the exchange is empty, and already holds. Otherwise, and , so Lemma 5.1 exchanges their occupations inside with occupied. In both cases, the resulting restriction is exactly . After the slide from to , the restriction on is exactly . That set is a -PVC by Lemma 3.1(b), since , and the full exterior meets every path crossing . The slide from to then reaches exactly
It is legal because u becomes occupied and the only unoccupied vertex in W is v. The restriction to U is without any further normalization.
All preparations use smaller pair calls, the first stage has at most two steps, and the increasing loop has at most steps. Thus, the procedure terminates with the asserted actual list and endpoint. Finally, Theorem 3.7 applies to every reachable endpoint with the exact prescribed restriction and gives movability of every token in .
We can now prove that the pair recursion reaches the supplied target. No canonical endpoint for the whole tree is needed.
Theorem 5.5. For every integer , every tree , and every reachable pair of -PVCs of , the procedure CONNECTPAIR( ) terminates and returns a TS-sequence from to . On a tree, a wrapper that first checks the cover conditions and the decision test of Theorem 1.1 rejects precisely the invalid or unreachable pairs and otherwise returns this TS-sequence.
Proof. We use strong induction on for the actual list returned between the two endpoints. Equal inputs return the empty list. For unequal inputs, reachability gives the same rigid set and the same token count in each component of . If , each component is smaller, and the exact product statement of Lemma 2.3 makes its two restrictions reachable. The induction hypothesis supplies their pair lists. These lists lift with all other vertices fixed and concatenate to a TS-sequence ending at .
Suppose that . The unrestricted-routing cases are justified by Lemma 2.4, and the one-token case was justified before Algorithm 2. In the remaining case, both calls to SETTLE use the same , the same , and the same . Every recursive preparation is on a subset of , which is smaller than , so the induction hypothesis supplies the assumption in Lemma 5.4. The returned lists and lead from to and from to , with . The restrictions and have equal cardinalities and no rigid tokens. By Lemma 3.9, they are reachable in . The induction hypothesis supplies the list between these exact restrictions. Since remains occupied, that list lifts to a TS-sequence from to with fixed. Therefore, the returned list is a TS-sequence from to . Every pair call has smaller order, and the local routines terminate by Lemma 5.4, proving termination as well. The assertion about rejection follows from the cover checks and Theorem 1.1.
5.3 The Length of the Output
We first count the recursive preparations made while settling one endpoint. The cutoff at and the empty second minimum preparation are both used in this count. Let , let , and let be the initial number of unoccupied vertices in . Let be one if the first stage takes its failure step and zero otherwise. The first stage ends with unoccupied vertices, where and if . If , that stage makes no recursive preparation; otherwise, it makes at most . The subsequent loop makes at most one preparation for each increase of . For a real number , let .
The next bound counts the complete lists from smaller pair calls, including repetitions. It also bounds the slides emitted locally by a settling stage. For a properly rooted side of order a, let
Lemma 5.6. In a nonbase call of Algorithm 2, each call to SETTLE makes at most g smaller pair calls on subsets of W and emits at most slides in addition to their returned lists.
Proof. We count the recursive preparations and then use the branch partition to bound the local operations. An early return satisfies both bounds. Otherwise, Theorem 3.6 gives , and in a nonbase call. The total number of preparations is at most
If , the inequality follows from . If and , its left side is . In the remaining case, , and the left side is . The final return uses no recursive preparation.
Proper rooting gives and . The initial occupation of uses at most slides. If the first stage fails once, the occupation of all nonempty branch roots uses at most the sum of their orders, which is . That failure also uses one slide from to and at most slides to occupy again, for a total of at most local slides. The single successful normalization uses at most slides by Lemma 5.2. Each increasing step uses two attachment slides and a path exchange in one branch . By Lemma 5.1, this costs at most , because . There are at most such steps, and the final return, if taken, has the same bound of slides. Consequently, the total local cost is at most
since
For the length induction, let and define the real potential on the nonnegative integers by
For an ambient order , the corresponding natural-number budget is
These quantities are used only in the length proof; the construction evaluates neither square roots nor floors.
The potential accounts for both the components of a rigid decomposition and the smaller calls on the complement of a properly rooted side. The following sum inequality applies to every finite list of nonnegative integers, including the empty list.
Lemma 5.7. The function is nonnegative and nondecreasing, and . For nonnegative integers and an integer , it satisfies
The budgets are nondecreasing, satisfy , and obey
The sum in Equation (20) may be empty.
Proof. We first prove the real inequalities and then transfer them to integer budgets. Since , nonnegativity, monotonicity and follow from Equation (15). Moreover,
which proves Equation (17). For every integer , we have . The cases and follow from and , respectively. The implication from to follows from and . Therefore,
proving Equation (18). Finally, gives .
Because , an integer satisfies exactly when . This observation transfers monotonicity and the value at zero to the budgets. For Equation (20), each summand is at most , and repeated use of Equation (17) bounds their sum by . The left side is an integer, so the floor gives the asserted inequality, including the empty sum. Similarly, Equation (18) gives
and the integer left side is at most . For Equation (22), the case is equality. When , we have , so , and the floor again gives the result. The final bound follows from Equation (19) and .
The quadratic local cost now gives an explicit length bound for the actual returned list.
Lemma 5.8. For every integer , every tree of order , and every reachable pair of -PVCs of , the list returned by CONNECTPAIR( ) has length at most
Proof. We use strong induction on to bound the list for every reachable pair on a connected set of order by . The correctness of these actual lists was established in Theorem 5.5. Equal inputs return no slides. In an elementary or one-token case, the output has at most slides, which is at most by Equation (22). For a nonempty rigid set, the component calls have disjoint vertex sets with total order at most . Their endpoints are valid and reachable by Lemma 2.3. The induction hypothesis, Equation (20) and monotonicity bound their concatenation by , including when there are no components.
In the remaining case, let and , so and . Every recursive preparation is on a subset of with valid reachable endpoints, and its length is at most by the induction hypothesis and monotonicity. By Lemma 5.6, the two settling stages use at most such lists, and the middle pair call contributes at most one more. Since , there are at most retained smaller lists. The two settling stages emit at most local slides. Reversing the second list does not change its length. Thus, Equation (21) bounds the complete list by
Taking p = n and applying Equation (23) proves the stated bound.
5.4 Running Time
We analyze the algorithm with exact tree computations and explicit lists of slides. Let and let be the length of its actual output, before any shortening. Vertex sets are Boolean arrays. We count unit-cost array accesses, arithmetic operations on integer labels and counts, and reads and writes of slide records. These are arithmetic-operation bounds, not bit-complexity bounds. The cost of reading the encoded input is added separately; in particular, a binary encoding of contributes additional time. Child lists are assembled by one pass over each list occurrence, using tail pointers or arrays with a final concatenation. Repeatedly copying an accumulated prefix is unnecessary. The bound below includes all retained child lists and their reversals.
When , the algorithm first uses elementary routing, before any computation whose cost depends on . For unequal equal-size inputs, both sets are nonfull and every token is movable by Lemma 2.4, so this shortcut returns exactly the list that the pair recursion would return. Equal inputs return the empty list. For the remainder of the analysis, suppose that . Only calls to CONNECTPAIR are nodes of the recursive call tree; target synthesis and local routines are counted within their calling node. Every child acts on a strictly smaller vertex set, so the depth is at most . A rigid split has at most children, and Lemma 5.6 bounds the number of children of a nonbase call by . Every nonempty returned list occurs in full in the final list, possibly reversed. At any fixed depth, these occurrences are disjoint, so there are at most calls with nonempty output at that depth. There are therefore at most nonempty calls. By Theorem 5.5, an empty pair list has equal endpoints, and the equality guard returns before making any recursive call. All empty calls are leaves. Attaching the at most empty children of each nonempty call gives
The work at one node, apart from reading its returned child lists, is operations. The following bounds give explicit ways to obtain every required quantity.
• Components, paths, diameters, and rooted heights are computed by tree traversals, within operations using Boolean arrays. The unoccupied forest contains a path on vertices exactly when one of its components has diameter at least . Testing every ordered attaching edge and its branches therefore finds the least properly rooted side within operations. Branch heights, the sorted branch order, , and each are computed within this bound.
• A target computation in Lemma 5.3 has at most recursive levels, each with at most operations. All target computations at the node therefore use operations.
- The rigid sets are evaluated by Algorithm 1 and the rooted recurrence of Equation (5). There are evaluations at a node, each using operations, for a total of when .
• An elementary routing uses at most searches and costs operations. A nearest-token or nearest-unoccupied-vertex preparation uses one search and at most slides, within operations. The normalizer has at most initial root preparations, at most transfers with two such preparations each, and at most final elementary branch routings. Scanning the ordered branch counts selects each recipient and donor within operations. Thus, a normalization costs operations. Each path exchange finds one path, scans its occupations, and emits at most slides, within operations. There is at most one normalization in each settling stage, and all other exchanges and root preparations also fit within operations per node.
These computations test paths by diameters and rooted heights and evaluate the branch and rigid formulas by sorted lists and the rooted recurrence. In particular, the largest compatible set of branch heights is obtained from a sorted prefix, as in Equation (5), instead of enumerating subsets of branches. Exact values of are rooted heights in the unoccupied forest. These evaluations preserve the tests and fixed choices of the construction without enumerating configurations. The running-time bound applies to this realization of the algorithm. The Lean definitions use finite path and subset enumerations as reference definitions for some of these quantities; their literal evaluation is not claimed to satisfy this time bound.
The sum of the lengths of all returned lists is at most , since each final slide occurrence belongs to at most one call at each depth. One pass over each child-list occurrence, including reversals and endpoint updates, therefore uses additional operations. Together with Equation (24), the local bound gives
The intermediate estimate concerns the complete retained list; the proof below substitutes the length bound to obtain a running time in terms of n alone. It does not assert a matching lower bound on the length of that list or on shortest TS-sequences.
Proof of Theorem 1.2. We combine pair correctness with the length and running-time estimates. By Theorem 5.5, the algorithm returns a TS-sequence between the supplied endpoints. Its length is at most by Lemma 5.8. When , Equation (25) gives operations. Since , substituting the length bound gives operations. When , every subset is a k-PVC, and direct elementary routing uses at most slides in time, satisfying the stated length and time bounds. For pairs not known to be valid and reachable, the initial cover checks and the decision algorithm reject precisely the other pairs; their time is also within the stated bound.
6 Concluding Remarks
In this paper, we have shown that Token Sliding for k-PVCs of trees of order n can be decided in time for every integer , and we have given a direct recursive construction with at most slides and running time . The decision algorithm computes the vertices with rigid tokens and uses the token counts in the components remaining after their deletion.
It remains open whether TS-sequences of polynomial length between reachable k-PVCs of trees can be found in polynomial time for every fixed .
For , Demaine et al. [5] proved that a TS-sequence of length can be found in time whenever the target is reachable, and they gave paths on which every such sequence has length . Their result transfers from independent sets to 2-PVCs by taking complements. The bound proved here for the direct pair construction does not recover that quadratic guarantee. It remains open whether slides suffice for every fixed . Another question is whether the decision bound can be improved to linear time for each fixed , as is known for .
Acknowledgements
Duc A. Hoang's research was supported by the Vietnam National University, Hanoi under the project QG.25.07 "A study on reconfiguration problems from algorithmic and graph-theoretic perspectives".
AI Declaration
ChatGPT 6 Pro and Claude Fable 5.1 were used to assist with developing and reviewing mathematical arguments and drafting and revising the paper. The author takes full responsibility for the correctness and content of the paper.
References
[1] Duc A. Hoang. “TS-reconfiguration of k-path vertex covers in caterpillars for ”. In: Theory and Applications of Graphs 10.1, 8 (2023). DOI: 10.20429/tag.2023.10108.
[2] Duc A. Hoang, Akira Suzuki, and Tsuyoshi Yagita. "Reconfiguring k-path vertex covers". In: IEICE Transactions on Information and Systems E105.D.7 (2022), pp. 1258–1272. DOI: 10.1587/transinf.2021EDP7177.
[3] Jianhua Tu, Zhipeng Zhang, and Yongtang Shi. "The maximum number of maximum dissociation sets in trees". In: Journal of Graph Theory 96.4 (2021), pp. 472–489. DOI: 10.1002/jgt.22627.
[4] Naomi Nishimura. "Introduction to reconfiguration". In: Algorithms 11.4, 52 (2018). DOI: 10.3390/a11040052.
[5] Erik D. Demaine, Martin L. Demaine, Eli Fox-Epstein, Duc A. Hoang, Takehiro Ito, Hirotaka Ono, Yota Otachi, Ryuhei Uehara, and Takeshi Yamada. "Linear-time algorithm for sliding tokens on trees". In: Theoretical Computer Science 600 (2015), pp. 132–142. DOI: 10.1016/j.tcs.2015.07.037.
[6] Jan van den Heuvel. “The complexity of change”. In: Surveys in Combinatorics 2013. Vol. 409. London Mathematical Society Lecture Note Series. Cambridge University Press, 2013, pp. 127–160. DOI: 10.1017/CB09781139506748.005.
[7] Ruy Fabila-Monroy, David Flores-Peñaloza, Clemens Huemer, Ferran Hurtado, Jorge Urrutia, and David R. Wood. "Token graphs". In: Graphs and Combinatorics 28 (2012), pp. 365–380. DOI: 10.1007/s00373-011-1055-9.
[8] Marcin Kamiński, Paul Medvedev, and Martin Milanič. “Complexity of independent set reconfigurability problems”. In: Theoretical Computer Science 439 (2012), pp. 9–15. DOI: 10.1016/j.tcs.2012.03.004.
[9] Boštjan Brešar, František Kardoš, Ján Katrenič, and Gabriel Semanišin. “Minimum k-path vertex cover”. In: Discrete Applied Mathematics 159.12 (2011), pp. 1189–1195. DOI: 10.1016/j.dam.2011.04.008.
[10] Takehiro Ito, Erik D. Demaine, Nicholas J. A. Harvey, Christos H. Papadimitriou, Martha Sideri, Ryuhei Uehara, and Yushi Uno. "On the complexity of reconfiguration problems". In: Theoretical Computer Science 412.12–14 (2011), pp. 1054–1065. DOI: 10.1016/j.tcs.2010.12.005.
[11] Robert A. Hearn and Erik D. Demaine. “PSPACE-completeness of sliding-block puzzles and other problems through the nondeterministic constraint logic model of computation”. In: Theoretical Computer Science 343.1–2 (2005), pp. 72–96. DOI: 10.1016/j.tcs.2005.05.008.
[12] Daniel Martin Kornhauser. “Coordinating pebble motion on graphs, the diameter of permutation groups, and applications”. Master’s thesis. Massachusetts Institute of Technology, May 1984. URL: https://www.cs.cmu.edu/~glmiller/Publications/Papers/KornhauserMaster84.pdf.