arXiv:2610.19724cs.DMOct 2026

Manuscript Offprint

arXiv:2610.19724

Graphs with Bounded Push-Pop Walk Orderings

Antoine Amarilli, Claire David, Nadime Francis, Victor Marsault, Mikaël Monet, Yann Strozecki

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Abstract

Consider a directed graph G and the (generally infinite) set Walks(G) of the walks in that graph. We are interested in ordering Walks(G) as w1,w2,…w_1, w_2, \ldots in a way that ensures that each walk is obtained from the previous one by a bounded number of elementary operations, namely, push operations (which add a new edge at either end of the walk) and pop operations (which remove the first or last edge of the walk). Our goal is to optimize the aforementioned bound, when it exists, in particular when imposing the additional requirement that walks must be ordered in increasing order of length.

To this end, we introduce a condition on graphs inspired by earlier work, called inner-connectedness, which is testable in linear time; we show that inner-connected graphs are precisely those which admit bounded walk orderings. Focusing on such graphs, we then introduce and study the pp-rank and the pp-increasing-rank. Namely, the pp-rank of a graph is the best possible bound on the number of push-pop operations in a bounded walk ordering for that graph; and the pp-increasing-rank is the same where we further impose that shorter walks appear before longer walks in the ordering. We show that the pp-rank of inner-connected graphs is in fact always bounded by 3. The pp-increasing-rank of inner-connected graphs is also always finite, but it can be up to linear in the input graph. More precisely, we show that the pp-increasing-rank is related to a new parameter we introduce, the peripherality of graphs. In particular, for cyclic graphs, peripherality is related to the pp-increasing-rank up to multiplicative and additive constants. We last study how to compute these parameters, and show that while peripherality can be computed in polynomial time, the pp-increasing-rank itself is generally NP-hard to compute.

2012 ACM Subject Classification Mathematics of computing → Enumeration; Mathematics of computing → Graph theory

Keywords and phrases Push-pop Distance, Walk Ordering, Walk Enumeration, Combinatorial Gray Code, Graphs

Acknowledgements Antoine Amarilli is partially supported by the project ANR-25-CE23-1215 (“Expand”); Victor Marsault and Nadime Francis by ANR-21-CE48-0015 (“VeriGraph”).

Usage of AI We used LLMs for two purposes: bibliographic search and finding examples to build our intuition or test our conjectures. In particular, we found [LW93] this way, which turned out to be crucial in the proof of Proposition 6.4. In terms of examples, the only one in the final paper which was found by an LLM is given in Figure 5, in Appendix A.

© Antoine Amarilli, Claire David, Nadime Francis, Victor Marsault, Mikaël Monet, and Yann Strozecki; licensed under Creative Commons License CC-BY 4.0

Graphs with Bounded Push-Pop Walk Orderings

1 Introduction

Efficient enumeration of combinatorial objects is a classical problem in theoretical computer science, with applications in exhaustive search, combinatorial generation and database query evaluation. The efficiency of enumeration algorithms is usually measured by its delay, i.e., the maximal time between consecutive outputs. While constant-delay is ideal [Seg14], it requires writing each solution in constant time, which is unrealistic when solution size depends on input size, or when there are infinitely many solutions. To bound the delay in such cases, we adopt the approach of combinatorial Gray codes [Müt23], where objects (e.g., binary strings, permutations or spanning trees) must be listed exactly once, with consecutive objects differing by a small change. In this setting, the time to write the output is not accounted for, following the “don’t count the output” principle of combinatorial generation [Rus03, p. 8].

In this paper, we apply this paradigm to the enumeration of all walks in a directed graph. Our motivation comes from graph databases, where modern query languages (Cypher [FG +^{+}18] or ISO standards GQL [ISO24] and SQL/PGQ [ISO23]) are based on extracting all walks satisfying navigational constraints (MATCH). Walks are usually computed and output in full, which is sometimes the bottleneck for some tasks, e.g., enumerating all shortest walks satisfying the constraints (MATCH SHORTEST, [DFM24]). Output handling is identified as one of the current research challenges in the field [LM +^{+}25, Sec. 7.1]: potential solutions include factorized representations [MN +^{+}23; MN +^{+}24] and outputting only the difference between consecutive outputs. Here, we study the latter approach in the simplest setting: unlabeled graphs with no constraint on walks, where we enumerate the (possibly infinite) set of all walks. We require each produced walk to be at a bounded push-pop distance from the previous one, i.e., to be obtained by applying at most dd push operations (add an edge to either end of the walk) or pop operations (remove the first or last edge of the walk), for some d∈Nd \in \mathbb{N}.

Our first goal is to classify which graphs are orderable, i.e., admit such a bounded walk ordering, and then to quantify the best possible distance that can be achieved: we call this the pp-rank of the graph. Note that some graphs are not orderable, as shown in Figure 1; whereas others can be shown to be orderable, in Figure 2 (ignoring all edge colors and numbers for now). Next, motivated by shortest walk enumeration in graph databases, our second goal is to classify which graphs are orderable by increasing length, i.e., admit a bounded ordering with walks occurring in increasing order of length. The minimal achievable distance in that case is called pp-increasing-rank of the graph. Last, since it is sometimes harder to order “short” walks than “long” walks, our third goal is to study the eventual pp-increasing-rank, i.e., the smallest possible distance d for which we have a walk ordering by increasing length that satisfies bound d, except for finitely many walks. Note that graphs are orderable by increasing length iff they are eventually orderable by increasing length, but their eventual pp-increasing-rank is generally smaller than their pp-increasing-rank.

Contributions. Our first contribution is to provide a linear-time testable characterization of graph orderability and to establish a distance bound of 3 for orderable graphs. To this end, we use inner-connectedness, inspired by a notion from [AM23] (see the related work paragraph for details). Their results imply that inner-disconnected graphs are not orderable. Conversely, we show that inner-connected graphs have a pp-rank of at most 3, i.e., each admits a walk ordering where consecutive walks differ by at most 3 operations.

Our second and main contribution is to study orderability by increasing length. Inner-disconnected graphs are not orderable by increasing length because they are not orderable at all. We show that, conversely, all inner-connected graphs are orderable by increasing length,

Figure

(a)

Figure

(b)

Figure 1 Two graphs that are inner-disconnected, hence not orderable

Figure

(a)

Figure

(b)

Figure

(c)

Figure

(d)

Figure 2 Four graphs that are inner-connected, hence orderable by increasing length

with a pp-increasing-rank bound which is generally linear in the graph size.

To this end, we introduce peripherality as a graph parameter that allows us to approximate the pp-increasing-rank. Informally, the peripherality of a walk is the smallest number of edges to remove from the walk in order to be able to reach a nontrivial scc from one of its endpoints. The peripherality of a graph G, denoted by Peri(G)\text{Peri}(G), is the maximal peripherality among its walks, and its eventual peripherality, denoted by EvPeri(G)\text{EvPeri}(G), is the maximal peripherality achieved by infinitely many walks. We show that the pp-increasing and eventual pp-increasing-rank of a cyclic graph G are in Θ(Peri(G))\Theta(\text{Peri}(G)) and Θ(EvPeri(G))\Theta(\text{EvPeri}(G)), respectively. By contrast, the pp-increasing-rank of an acyclic graph is in O(Peri(G))O(\text{Peri}(G)) but there are acyclic graphs with arbitrary peripherality but constant pp-increasing-rank.

Our results on inner-connected graphs are summarized in the following theorem. We exclude trivial graphs with zero or one edge, as they do not follow the general bounds.

▶ Theorem 1.1. Let G=(V,E)G = (V, E) be an inner-connected graph with at least two edges.

a. The pp-rank of G belongs to [1,3][1,3].

b. The pp-increasing-rank of G belongs to [2,6k][2,6k] if G is acyclic, and to [k,6k][k,6k] otherwise, where k=max⁡(1,Peri(G))k = \max(1, \text{Peri}(G)).

c. The eventual pp-increasing-rank of G is 0 if G is acyclic, it is 1 if the only cycle in G is a self-loop on a vertex with no other incident edge, and it belongs to [2k′,6k′][2k', 6k'] otherwise, where k′=max⁡(1,EvPeri(G))k' = \max(1, \text{EvPeri}(G)).

d. We have EvPeri(G)≤Peri(G)<∣V∣\text{EvPeri}(G) \leq \text{Peri}(G) < |V| and EvPeri(G)<∣V∣2\text{EvPeri}(G) < \frac{|V|}{2}.

The upper bounds on peripherality given in Item d are virtually tight: one can easily find infinite families of graphs with peripherality Ω(∣V∣)\Omega(|V|) (see, e.g., Figure 3); and the same remark holds for eventual peripherality. We also construct infinite graph families achieving three of the four lower bounds in Items a–c of Theorem 1.1 exactly, with the fourth off by one (Proposition 5.9). Finally, we show that peripherality and eventual peripherality can be computed in polynomial time (Propositions 6.2 and 6.3), but computing the pp-increasing-rank is NP-hard (Proposition 6.4).

Graphs with Bounded Push-Pop Walk Orderings

Related work. The enumeration of paths and walks in graphs has been studied across multiple areas. For instance, [Epp98] studies algorithms to enumerate the k shortest walks between two vertices in a digraph. In database theory, [MT18] studies efficient enumeration of simple paths and trails that match regular expressions, and [LO+24][LO^{+}24] studies enumeration of simple paths in graphs satisfying a restricted kind of regular expressions. More relevant to us, [AGM24] studies constant-delay enumeration of walks that have length m or length between ℓ\ell and m. In their case, constant delay relies on edits to a compressed representation of the walks rather than push-pop edits on one explicit walk.

The main originality of our work is to address two goals: (1.) producing walks by performing a constant number of modifications on the walks (specifically via push-pop edits); and (2.) ordering the infinite set of all walks (rather than simple paths, or walks in a specific length range). For goal (1.), push-pop operations are considered more generally in [CDG92], and enumeration with a constant push-pop distance specifically appears in [AD +^{+}26]. More precisely, [AD +^{+}26] studies the enumeration of all binary words of length ℓ\ell via push-pop operations, and can be extended to enumerate all binary words by increasing length (corresponding to goal (2.)). Since binary words correspond to walks in a single-vertex graph with two self-loops labeled 0 and 1, our work generalizes [AD +^{+}26] to arbitrary directed graphs; by contrast, we only focus on the existence of suitable orders and not on computing them in computational models with stringent time and space bounds like in [AD +^{+}26].

The work most closely related to ours is [AM23]. It studies how to enumerate the set LL of the words accepted by a deterministic finite automaton AA, while obeying a bound on the push-pop distance between consecutive words. Together with [AD+^{+}26], this is (to our knowledge) the only existing work that addresses goals (1.) and (2.). Specifically, a linear-time-testable criterion on AA called interchangeability is presented in [AM23] to decide whether a bounded ordering of LL exists. Since any directed graph can be converted into a deterministic automaton (where walks in the graph correspond to the words accepted by the automaton), the results of [AM23] also apply to graphs. Thus, our notion of inner-connectedness specializes their interchangeability criterion, and their results directly imply that inner-disconnected graphs do not admit bounded walk orderings (Proposition 3.2). The novelty in our work relative to [AM23] is twofold. First, by focusing on walks in graphs, we obtain a more favorable upper bound on pp-rank: Item a of Theorem 1.1 shows a bound of 3, while their construction would give a bound of 48(∣V∣+1)248(|V| + 1)^2, in fact 48∣Q∣248|Q|^2 where QQ is the automaton state set. Second, our main contributions are about ordering walks by increasing length, which is not studied by [AM23] and simpler in our setting (e.g., the language a(aa)∗+b(bb)∗+((a+b)(a+b))∗a(aa)^* + b(bb)^* + ((a + b)(a + b))^* is orderable but not orderable by increasing length).

Outline. The rest of the paper is organized as follows. Section 2 introduces preliminary notions (graphs, walks, orderings, pp-ranks). We then introduce terminology in Section 3 on object kinds and walk types, which we use to define inner-connectedness and restate the result from [AM23] that inner-disconnected graphs do not admit bounded walk orderings. We then focus in Sections 4 and 5 on enumerating walks by increasing order of length and on the pp-increasing rank. Specifically, in Section 4, after defining peripherality and eventual peripherality, we establish the upper bounds of Theorem 1.1, Items a–c, as well as Item d. We then prove in Section 5 the lower bounds of Theorem 1.1, Items b and c, by introducing the criticality and eventual criticality graph parameters, and exhibit graph families that (nearly) meet the lower bounds in Items a–c. Section 6 addresses computational aspects, showing that peripherality and eventual peripherality are tractable to compute while pp-increasing-rank is not. Finally, we discuss extensions and future directions in Section 7.

Due to space constraints, the details of most proofs are deferred to Appendix B–E. We also provide some open problems in Appendix A.

References (27)