Manuscript Offprint
arXiv:2610.19724Graphs with Bounded Push-Pop Walk Orderings
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 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 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 .
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,

(a)

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

(a)

(b)

(c)

(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 , is the maximal peripherality among its walks, and its eventual peripherality, denoted by , 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 and , respectively. By contrast, the pp-increasing-rank of an acyclic graph is in 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 be an inner-connected graph with at least two edges.
a. The pp-rank of G belongs to .
b. The pp-increasing-rank of G belongs to if G is acyclic, and to otherwise, where .
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 otherwise, where .
d. We have and .
The upper bounds on peripherality given in Item d are virtually tight: one can easily find infinite families of graphs with peripherality (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 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 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 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 of the words accepted by a deterministic finite automaton , while obeying a bound on the push-pop distance between consecutive words. Together with [AD26], this is (to our knowledge) the only existing work that addresses goals (1.) and (2.). Specifically, a linear-time-testable criterion on called interchangeability is presented in [AM23] to decide whether a bounded ordering of 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 , in fact where 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 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.
2.1 Classical Graph Definitions
For every integer , we write . By initial segment of we refer to the whole set or any set for . An ordering of a countable set is a bijection from an initial segment of to , written or ; it may be finite or infinite depending on the finiteness of . For a binary relation over a set , we use the notation , , and as usual: is the identity over , for the relation is , the relation is , and is .
Graphs and walks. A directed graph (or simply graph) is a pair where is the set of vertices, and is the set of edges. All graphs are implicitly finite unless stated otherwise. For every edge , we call , resp. and denote by , resp. the source of , resp. the target of . Note that we allow self-loops of the form in . We collectively call the elements of the objects of . A subgraph of is a graph where and .
A walk in a graph is a finite sequence of edges in with for each ; we call the length of and denote it by . When is nonempty, we also say that is a walk from to . The empty sequence of edges is called the empty walk and denoted by . For and two walks, if at least one of them is empty or if , we write or simply for the concatenation of and . The set of all walks in is denoted by ; we also use the notation , resp. , resp. to denote the walks in of length , resp. at most , resp. at least .
▶ Remark 2.1. We define walks as edge sequences rather than vertex sequences, motivated by our future application to databases. Although we restrict our analysis to graphs for the sake of clarity, this convention ensures our results generalize immediately to multigraphs, the predominant model for graph databases.
Strong connectedness. Two vertices and of a graph are strongly connected if either or there is a nonempty walk from to and a nonempty walk from to . Strong connectedness is an equivalence relation, whose classes are the strongly connected components (scc for short) of . A graph is strongly connected if it has at most one scc. An scc is trivial if it consists of a single vertex with no self-loop. A graph is acyclic if all its sccs are trivial, and cyclic otherwise. The condensation of [Har69] is the acyclic graph with the sccs of as vertices, and with an edge from to whenever and has an edge from some to some .
We say that a nonempty walk starts in (resp. ends in, resp. encounters) an scc C if its first vertex (resp. its last vertex, resp. some of its vertices) belongs to C. We also say that a walk entirely belongs to a nontrivial scc C if all its vertices belong to C.
Graphs with Bounded Push-Pop Walk Orderings
Weak connectedness and undirected graphs. We sometimes consider graphs while ignoring the orientation of their edges. An undirected graph is a graph such that implies for all . Given a directed graph , let be the undirected graph . Two vertices of are weakly connected if they are strongly connected in or equivalently if either or there is a walk in from to or from to . We say that is weakly connected if is strongly connected. Note that weak and strong connectedness coincide for undirected graphs; we then simply say connected. For clarity, a walk in an undirected graph is called a chain.
2.2 Graph Orderability
We are interested in the walks that can be transformed into one another with at most push and pop operations at either end. We materialize this notion as the relation , defined next. First, two walks satisfy iff either is obtained from with a push-right operation), , for some edge . Second, is defined as . A similar notion, defined as a distance function, is used on words in [AM23] and was introduced earlier under the name substring distance in [NRS17]. We will also use , a refinement of that only relates walks of the same length: .
▶ Remark 2.2. The relation is less intuitive than it seems. First, is equal to , for all . Indeed, a single push or pop operation always changes the length of the walk, hence the extra operation is useless in that case. Second, is always included in , but the converse usually fails. Indeed, only relates walks of the same length, hence requires the (up to) intermediate walks to all have the same length, while imposes no such constraints on intermediate walks. For instance, consider the disjoint union of two walks of length . Notice that and are related by (pop all edges from one walk and push all edges from the other) but not by , for any .
A walk ordering of a graph is an ordering of Walks. We are interested in two properties of a walk ordering , both quantified over the indices such that and are in : it is -bounded if for all , and increasing if for all . Note that the increasing condition does not require the lengths to be strictly increasing, as a graph may have many walks of the same length (and the order between them is unconstrained).
▶ Definition 2.3 (Graph orderability). Let be a graph and let . We say that is:
a. -orderable if Walks admits a -bounded ordering;
b. eventually k-orderable if Walks≥ℓ(G) admits a k-bounded ordering for some ℓ ∈ ℝ;
c. k-orderable by increasing length, resp. eventually k-orderable by increasing length, if the ordering in Item a, resp. in Item b, is moreover required to be increasing;
d. orderable if it is k-orderable for some k; we define eventually orderable, orderable by increasing length and eventually orderable by increasing length similarly.
We point out that orderable and eventually orderable are the exact same notion, and the same holds for orderable by increasing length and eventually orderable by increasing length; but the distance bounds that they achieve can be distinct. Furthermore, note that a k-bounded ordering is -bounded for every , so the set of integers k witnessing each of the notions above is upward closed. Moreover, the following minima exist:
▶ Definition 2.4. The pp-rank of an orderable graph G is the least k such that G is k-orderable. We define pp-increasing-rank and eventual pp-increasing-rank analogously.
3 Inner-Connectedness and Terminology for Vertices, Edges and Walks
In this section we give a necessary structural condition for graph orderability, called inner-connectedness. It specializes the notion of interchangeability used in [AM23] for automata. To define it, we assign a kind to the vertices and edges of a graph according to how they are connected to nontrivial sccs. We then define inner-connectedness and show that inner-disconnected graphs are not orderable. We close the section by introducing the notion of walk types, which we will use throughout the following sections.
3.1 Object Kinds and Inner-Connectedness
Let G be a graph, and recall that an object of G is a vertex or an edge. We consider the two following properties that an object o of G may satisfy.
o is part of a walk that starts in some nontrivial scc
(1a)
o is part of a walk that ends in some nontrivial scc
(1b)
These two properties partition the objects of G into four kinds. An object is:
inner, or of kind I, and coloured blue in figures, if it satisfies both (1a) and (1b);
left-outer, or of kind L, and coloured orange in figures, if it satisfies (1b) only;
right-outer, or of kind R, and coloured orange in figures, if it satisfies (1a) only;
finitary, or of kind F, and coloured mint green, if it satisfies neither.
Left-outer and right-outer objects are collectively called outer objects.
Every vertex of a nontrivial scc is an inner object, but the converse fails: an inner vertex may form a trivial scc on its own, and an inner edge may lie outside every nontrivial scc, as illustrated in Figure 2d. We may now define inner-connectedness.
▶ Definition 3.1. The inner subgraph of G is the subgraph consisting of its inner objects. We say that G is inner-connected if its inner subgraph is weakly connected (in particular if the inner graph is empty), and inner-disconnected otherwise.
Two inner-disconnected graphs are shown in Figure 1, while Figure 2 shows graphs that are inner-connected. Finally, Figure 2c illustrates several possible ways outer and finitary edges may combine. Inner-connectedness coincides with the notion of DFA interchangeability of [AM23] (in the special case where all transitions use distinct letters), so that [AM23, Theorem 3.9] yields the following statement in our setting.
▶ Proposition 3.2 ([AM23]). No inner-disconnected graph is eventually orderable.
For the sake of completeness, we provide a self-contained proof of Proposition 3.2 in Appendix B. In the remainder of the paper we focus on inner-connected graphs. Notice that this includes all acyclic graphs since their inner subgraph is empty, hence weakly connected.
3.2 Walk Types
Following our definition of object kinds, we now define walk types, which we use afterwards to define peripherality and eventual peripherality. Most proofs will also proceed by case analysis on the walk types.
A nonempty walk consisting only of edges of kind is called a walk of type . Note that its first and last vertices may have a kind other than (e.g., the walk 34 in Figure 2c is of type R but starts in a vertex of kind I).
Graphs with Bounded Push-Pop Walk Orderings
A type specification is a nonempty sequence over in which no element occurs twice and each element is optionally marked with . For , a walk is of type , or a -walk, if we can write , where is a walk of type for each , and is moreover allowed to be empty when carries a . A walk may be of several types, e.g., a walk can be both of type and of type . For a fixed specification however, the factorization is unique, since the letters are pairwise distinct and the kind of an edge of determines which factor it belongs to. We call it the factorization of with respect to . For this agrees with the definition of the previous paragraph.
We state a few properties of walk types below; in particular, Item c provides the two main types we use in case analysis.
▶ Property 3.3. Let G be a graph.
a. Let be a walk such that and are nonempty. Then is of type (resp. ) if and only if is of type (resp. is of type ).
b. No walk contains both an edge of kind I and an edge of kind F.
c. Each walk in G is either of type or of type
4 Peripherality and Upper Bounds
We now have the requisite definitions to show the upper bounds for the different push-pop ranks (Theorem 1.1, Items a–c). Our strategy generally relies on the “even-odd trick” [Sek60; Kar68; Fed94] that builds a Hamiltonian path in the cube of any connected finite undirected graph . In our settings, we will apply it to walk graphs, whose vertices are the walks to be ordered and where two walks are connected by an edge if they are at small push-pop distance. Since these graphs are generally infinite, we must adapt this technique, which we present in Section 4.1: namely, Proposition 4.3 gives a generic method to build a 3k-bounded walk ordering by partitioning walks such that each part is connected for the relation. Then, building on walk types, we define in Section 4.2 two graph parameters, peripherality and its variant eventual peripherality. The values of these parameters provide us with a distance bound suitable for Proposition 4.3, as shown in Section 4.3 when peripherality is equal to 0, and in Section 4.4 in the general case.
4.1 Orderability and Walk Graph Connectedness
In the following, we will often consider possibly infinite undirected graphs whose vertices are walks (e.g., or ) and whose edge relation is or for some ; we informally call them walk graphs. We now show how walk orderability of a graph can be studied through the simpler lens of connectedness of its walk graphs. Specifically, we demonstrate the approach by showing the following result:
▶ Proposition 4.1. Let be a graph and a positive integer. If the undirected graph is connected for every , then is 3k-orderable by increasing length.
We will leverage this result later to show our upper bounds on orderability by increasing length, with a choice of k given by our subsequent definitions of peripherality.
The proof of Proposition 4.1 uses the classical “even-odd trick” [Sek60; Kar68; Fed94]:
▶ Theorem 4.2 ([Kar68], see also [Sek60; Fed94]). For every connected undirected (finite) graph and distinct endpoint vertices , there exists an ordering of , with and such that , for every .
Note that Theorem 4.2 only applies to finite , and not, e.g., to the bi-infinite chain and . As walk graphs are generally infinite, to show Proposition 4.1 we need a result that applies to possibly infinite undirected graphs:
▶ Proposition 4.3. Let be a possibly infinite undirected graph, and let be a partition of as non-empty finite vertex sets meeting the following conditions.
a. The subgraph of U induced by is connected, for every .
b. There is a vertex sequence such that:
for all
for all .
Then, there exists an ordering of meeting the following conditions.
c. For every , whenever we have and for some , then .
d. We have , for every .
The simplest choice for the is to take the walks of length , which we will do to show Proposition 4.1. However, we have phrased Proposition 4.3 in a more generic way because we will later use it with sets defined according to the peripherality notion that we will introduce. We also note that [AM23, Lemma 4.6] uses a similar result to Proposition 4.3 (under the name of stratum-connectedness); but in their work the sets always correspond to walks of a specific length range (called a stratum), which does not suffice for our purposes.
Proof sketch of Proposition 4.3. Apply Theorem 4.2 to each subgraph of induced by with and being any vertex in such that . Then, concatenate the obtained orderings.
Proposition 4.1 is then easily obtained from Proposition 4.3. If is cyclic, we use , for , and can be set as any walk sequence such that and is a prefix of (e.g., following any cycle in any nontrivial scc). If is acyclic, the proof is the same, except we replace by where is the length of the longest walk in .
4.2 Peripherality
We now define the peripherality and eventual peripherality of a graph, by first defining the peripherality of a walk. The peripherality of a walk is equal to the number of edges that must be popped to obtain a walk that can reach or be reached from a nontrivial scc. Formally:
▶ Definition 4.4. Let be a walk. The peripherality of , denoted , is the length of the shortest walk such that and is of type , or and is of type . We then define the peripherality of a graph and the eventual peripherality of a cyclic graph as follows.
We conventionally define the eventual peripherality of an acyclic graph to be equal to 0.
As a direct consequence of Property 3.3, if we denote by the number of edges of kind X in w, the peripherality of a walk can be computed as in Item a, below. Moreover, it is easy to show that eventual peripherality can be computed as in Item b. Together, they imply that peripherality and eventual peripherality are always well defined.
▶ Property 4.5. a. For every walk w, .
Graphs with Bounded Push-Pop Walk Orderings

(a)

(b)

(c)

(d)
Figure 3 Families of (inner-connected cyclic) graphs with high peripherality. Graphs in family (b) moreover have a high eventual peripherality.
b. For every cyclic graph , , where is the subset of Walks() of those walks that encounter some nontrivial scc.
For instance, the graph in Figure 2c has peripherality 2, attained by the walks 654 and 65. None of them encounters a nontrivial scc, so the eventual peripherality of this graph is 1, witnessed, e.g., by the walks 12 or 134. The graph in Figure 1b has peripherality 3, attained by 1234, but has eventual peripherality 0. The graph in Figure 2d has peripherality 1 and eventual peripherality 0, and all the remaining graphs in Figures 1 and 2 have peripherality 0. Note also that the peripherality of an acyclic graph is the length of its longest walk.
Finally, we illustrate in Figure 3 some families of cyclic graphs whose peripherality is linear in the size of the graph. The peripherality of the graph in Figure 3a is attained by the bottom finitary walk; its eventual peripherality is 0. The peripherality of the graph in Figure 3b is k and it is attained by a walk that encounters the nontrivial scc (the right vertex with a self-loop), hence this graph also has an eventual peripherality of k, i.e., linear in the size of the graph. The peripherality of the graph in Figure 3c is attained only by one walk; although this walk contains an inner vertex, it does not encounter a nontrivial scc; hence the eventual peripherality of this graph is in fact 0. These families showcase the worst cases for peripherality and eventual peripherality: by the pigeonhole principle, it is easily seen that the following inequalities hold for every graph :
▶ Lemma 4.6. We have: and .
Since by definition, , we have just shown Item d of Theorem 1.1.
4.3 Walks with Peripherality Zero
Next, we focus on walks with peripherality 0, i.e., of type or . We show that, in inner-connected graphs, any two such walks of equal length are related by , as stated next. This result will be used afterwards to show the upper bounds of Theorem 1.1, Items a–c.
▶ Proposition 4.7. Let be an inner-connected graph and two walks in . If and have peripherality 0 and , then .
Proof sketch. Let be the set of walks of that entirely belong to a single nontrivial scc; the scc is not fixed, so that whenever there is a nontrivial scc containing every edge of . Proposition 4.7 follows directly from the Claims 4.8 and 4.9, stated next.
▷ Claim 4.8. For every nonempty walk of peripherality 0, there exists a walk such that .
▷ Claim 4.9. For any two walks of the same length, we have .
Claim 4.8 relies on the fact that any walk with a peripherality of 0 is the prefix (or the suffix, which we handle symmetrically) of a walk that ends in a nontrivial scc . Given any walk that is entirely in , starts in and satisfies , the claim follows from the fact that consecutive factors of length in are related by . Now, for the proof of Claim 4.9, the reasoning depends on the relationship between the scc associated with and the scc associated with . In the special case where is reachable from (including ), we show Claim 4.9 just like Claim 4.8, using the fact that there is a walk such that is a valid walk. This special case corresponds to the case where can reach in the condensation of the inner subgraph of . By iterating this reasoning, we show Claim 4.9 in the general case by following a chain connecting and in , which exists thanks to our assumption that is weakly connected (because is inner-connected).
4.4 Upper Bounds
We now show the main results from this section: upper bounds for pp-rank (Proposition 4.10), pp-increasing-rank (Proposition 4.13) and eventual pp-increasing-rank (Proposition 4.15).
▶ Proposition 4.10. Every inner-connected graph is 3-orderable.
Proof sketch. First note that, for any graph (cyclic or acyclic), the graph Walks() is -connected (every walk is -related to the empty walk). Thus, when is acyclic then Walks() is finite and Theorem 4.2 applies. We assume from now on that is cyclic.
For every nonnegative integer , we write . The following claim can be shown using Proposition 4.7.
▷ Claim 4.11. For every nonnegative integer , is a connected graph.
Now, we write , for every . Notice that and . Note moreover that given a walk such that then either the prefix or the suffix of of length , which we write , has a peripherality of . In particular, implies that , and by iterating this reasoning we can reach , so Claim 4.12 follows.
▷ Claim 4.12. For every nonnegative integer , is a connected graph.
Since is cyclic, it contains an infinite walk that is of type , e.g., following any cycle in a nontrivial scc. We denote by the prefix of length of this walk, for ; note that . We write and, , for . Applying Proposition 4.3 to , and yields a 3-bounded ordering of .
The ordering we build in the proof of Proposition 4.10 is not increasing, but it is in some sense quasi-increasing. Indeed, the difference in length between a walk and any walk coming before has a constant lower bound:
Graphs with Bounded Push-Pop Walk Orderings
In order to be increasing, the ordering would need to satisfy (4) with 0 instead of , something that is never ensured by Proposition 4.10 since .
We have now shown the upper bound of Theorem 1.1, Item a, which improves the bound of [AM23]. We now show the upper bounds of Items b and c, which focus on ordering by increasing length, and which are shown using Proposition 4.1.
▶ Proposition 4.13. Every inner-connected graph G is 6k-orderable by increasing length, where .
Proof sketch. From Proposition 4.1, we only have to prove that is connected for every . This was established in the case where by Proposition 4.7, and it is obvious in the case where is acyclic. The remaining case of a cyclic graph with is handled by Claim 4.14 below. The claim is proved with a simple case analysis on whether is of type or .
▷ Claim 4.14. If is cyclic, then for every walk in with positive peripherality, there exists a walk in such that and .
Using Proposition 4.7 concludes the proof.
▶ Proposition 4.15. Every inner-connected graph G is eventually -orderable by increasing length, where .
The proof is the same as that of Proposition 4.13, except that we consider only the walks that are longer than . This ensures by the pigeonhole principle that only Case 1 in the proof of (the analogue of) Claim 4.14 can occur, and then the walk w under consideration encounters a nontrivial scc so its peripherality is at most the eventual peripherality of G, so we can indeed use instead of k in the statement.
5 Criticality and Lower Bounds
Having shown the upper bounds on Theorem 1.1, we now turn to the lower bounds. These hinge on the notions of criticality and critical walks, on the fact that critical walks are -disconnected from the other walks when k is the criticality of the graph. We give the relevant definitions and show this result in Section 5.1. We then show the lower bounds of Theorem 1.1 in Section 5.2, and discuss their tightness in Section 5.3.
5.1 Criticality and Critical Walks
▶ Definition 5.1. We define the criticality of a walk as follows. If is of type , then . Otherwise (i.e., is of type ), its criticality is defined as the maximal number such that can be factorized as where is an , is an , is a single edge of type and .
We also define the criticality of a graph G as the maximal criticality among walks in G, and the eventual criticality of G as the maximal criticality among walks that encounter a nontrivial scc (or -1 if there are no such walks, i.e., precisely when the graph is acyclic).
The next property can be shown by an easy induction over the peripherality of walks.
▶ Property 5.2. Every walk or graph with peripherality p and criticality c satisfies . Every graph with eventual peripherality and eventual criticality satisfies .
▶ Definition 5.3. A walk is critical if it is maximal for the preorder defined as if:
-
either each of and encounter some nontrivial scc (not necessarily the same), or neither of them encounters any nontrivial scc; and
-
either , or both and .
The following lemma shows that criticality is preserved when following : from a critical walk w of criticality k, one can only reach walks that are equivalent to w wrt. ; which intuitively means that these walks are disconnected from the other walks.
▶ Lemma 5.4. Let w be a critical walk with a positive criticality k. Then every walk such that is equivalent to w w.r.t. , hence critical.
Proof sketch. Since , the type of is either or . We focus in this sketch on the case where is of type , the other case is similar. We -factorize as with and . Since , we have the following factorization of and of , for some walks and some nonempty walks and . (Note that and .) Since is critical, it is maximal w.r.t. , hence greater, equivalent or incomparable to and to . We are then able to conclude from this that and , which finally yields that is equivalent to w.r.t .
5.2 Lower Bounds
We now show the main result from Section 5: criticality and eventual criticality yield lower bounds for the pp-increasing-rank and eventual pp-increasing-rank, respectively.
▶ Proposition 5.5. Let G be a cyclic graph.
a. If the criticality c of G is positive, then G is not -orderable by increasing length.
b. If the eventual criticality of G is positive, then G is not eventually -orderable by increasing length.
The proof of Proposition 5.5 hinges on Lemma 5.6, stated below, which serves as an approximate converse to Proposition 4.1. Its proof is straightforward.
▶ Lemma 5.6. Let be a graph and a positive integer. If is -orderable (resp. eventually -orderable) by increasing length, then the undirected graph is connected for every (resp. for almost every ).
We can now sketch the proof of Proposition 5.5:
Proof sketch for Proposition 5.5. We rely on the next two claims, shown using Lemma 5.4:
▷ Claim 5.7. If , there exists an integer such that is disconnected.
▷ Claim 5.8. If , there exist infinitely many integers such that is disconnected.
Item a follows from Claim 5.7 and Lemma 5.6, and Item b from Claim 5.8 and Lemma 5.6. The careful reader will have noticed that Claim 5.7 is stated with while application of Lemma 5.4 yields the statement for only. The apparent discrepancy is resolved by the fact that (see Remark 2.2).
Finally, combining Proposition 5.5 with Property 5.2 yields the lower bounds of Items b and c of Theorem 1.1:
Graphs with Bounded Push-Pop Walk Orderings
-
If is a (cyclic or acyclic) graph with at least two edges, then is disconnected, hence is not 1-orderable by increasing length from Lemma 5.6. So we immediately have Item 1.1b's lower bound for the pp-increasing-rank of acyclic graphs.
-
Let us show the lower bound of Item 1.1b for the pp-increasing-rank of cyclic graphs. We distinguish two cases depending on whether c > 0 or not.
In the case where , Item a of Proposition 5.5 yields that the pp-increasing-rank of satisfies , hence in fact since is an integer. From Property 5.2, we have , hence finally as promised.
Otherwise, if , we have from Property 5.2. Since has at least two edges, we may use the same reasoning as item 1, yielding that its pp-increasing-rank is at least 2 again, so that .
- We similarly show that the eventual peripherality multiplied by two is a lower bound for the eventual pp-increasing-rank (Item 1.1c). The theorem statement excludes the case where the only cycle of is a self-loop on an isolated vertex, so for every positive length contains two different walks of that length (using a cycle which is not a self-loop, or two different self-loops, or a self-loop together with one of its incident edges). We can then use Item b of Proposition 5.5 instead of Item a, and equality instead of inequality (Property 5.2). The case of gives and the claimed lower bound of is achieved like in the case of item 1 but using two walks of the same length for arbitrarily large lengths, whose existence was justified earlier.
5.3 Lower Bound Tightness
We conclude Section 5 with examples of graph families that meet or are close to the lower bounds of Theorem 1.1. Three of the four lower bounds are met, and the fourth is off by one:
Proposition 5.9a shows that the lower bound in Item 1.1a is tight.
Proposition 5.9b shows that the lower bound in Item 1.1b is tight for acyclic graphs.
Proposition 5.9d shows that the lower bound in Item 1.1c is tight.
The remaining case is the lower bound in Item 1.1b for cyclic graphs: Proposition 5.9c shows that this bound is almost tight but leaves a gap of one. We leave this gap open, as we do not know whether there is a family of cyclic graphs in which each graph has a pp-increasing-rank equal to its peripherality.
▶ Proposition 5.9. a. There are arbitrarily large cyclic graphs that are 1-orderable.
b. There are arbitrarily large acyclic graphs that are 2-orderable by increasing length.
c. There are graphs with arbitrary large peripherality p that are -orderable by increasing length.
d. There are graphs with arbitrary large eventual peripherality that are eventually -orderable by increasing length.
Proof sketch. It may be shown that, for every :
a. the cycle of length k is 1-orderable;
b. the simple directed path of length k is 2-orderable by increasing length;
c. the graph given in Figure 3d has criticality k, peripherality and is -orderable by increasing length, but not p-orderable by increasing length;
d. the graph given in Figure 3b has eventual peripherality k and is eventually 2k-orderable by increasing length.
▶
6 Parameter Computation
In this section, we show that inner-connectedness, peripherality, criticality, and their eventual versions can all be computed in polynomial time. First, by computing the condensation in linear time (using, e.g., Tarjan's algorithm [Tar72]), we obtain:
▶ Lemma 6.1. One may compute in linear time the kind of all objects in a graph.
We now turn to (eventual) peripherality, and show the next statement.
▶ Proposition 6.2. Let be a graph, and F the set of finitary vertices in G.
a. The eventual peripherality of G can be computed in time .
b. The peripherality of G can be computed in time .
Proof sketch. We first compute the kinds of objects thanks to Lemma 6.1. For every vertex v, we define the following quantities:
, the maximal length of the L-factor across walks of type ending at ;
, the maximal length of the R-factor across walks of type starting at ;
, for every , fixing if no such walk exists.
Since the subgraph is acyclic, where is not inner}, these quantities are all well-defined. The first two can be computed in time by dynamic programming on the condensation. The third one can be computed in by increasing again using dynamic programming. It may then be observed that the peripherality of -walks corresponds to , for , and that the peripherality of -walks corresponds to .
We now show that the criticality and eventual criticality can be computed in linear time, similarly to the proof of Proposition 6.2a. Indeed, we simply compute the maximal length of a walk of type (resp. of type ) ending in (resp. starting in) each vertex .
▶ Proposition 6.3. Given a graph , the criticality and eventual criticality of G can be computed in time .
Recall that the peripherality of graphs never exceeds twice the criticality plus two (Property 5.2), so peripherality can be 2-approximated by criticality plus one, in linear time.
We now show that, by contrast, it is NP-hard to determine whether the pp-increasing-rank of a given graph G is no greater than 4:
▶ Proposition 6.4. Deciding whether a graph is 4-orderable by increasing length is NP-hard, even for acyclic graphs.
Proof sketch. We reduce from the Edge Hamiltonian Path Problem on bipartite graphs [LW93]. In this problem, we are given as input an undirected bipartite graph , and we ask whether the line graph of has a Hamiltonian path. Recall that is the graph on where we connect any two edges that share an endpoint. We then build an acyclic graph from by orienting its edges from to and adding a source connected to every vertex of and a target connected to every vertex of . This ensures that walks of length 3 in correspond to edges of , and that two such walks are at push-pop distance of 4 precisely when the corresponding edges of share an endpoint. Thus, a 4-ordering of exists precisely when admits a Hamiltonian path.
We note that the proof focuses on walks of small length, so it does not generalize to eventual pp-increasing-rank. We do not know whether hardness generalizes to this parameter, and we also do not know complexity upper bounds: we will discuss this in the conclusion.
Graphs with Bounded Push-Pop Walk Orderings
7 Conclusion and Future Directions
Our work introduces the question of finding walk orderings of a graph that bound the push-pop distance between consecutive walks. Our main contribution is threefold. First, we proved that the pp-rank of inner-connected graphs is bounded by 3, improving upon the previous bound of . Second, we introduced two graph measures, peripherality and criticality, that yield almost tight lower bounds (sometimes up to an additive constant of 1) and approximate upper bounds (up to a constant factor) to determine the pp-increasing-rank and eventual pp-increasing-ranks. Third, we showed that peripherality and criticality can be computed in polynomial time, while computing the exact pp-increasing-rank is intractable.
Our third contribution leaves open several complexity questions. Indeed, we have no lower bound on the complexity of computing the pp-rank or the eventual pp-increasing-rank. More surprisingly, we have no complexity upper bounds on these tasks at all, even to show that they are computable. We give in Appendix A a more complete list of open questions.
Further, our initial motivation from the introduction is to efficiently enumerate walks in graph databases. Inner-connectedness determines the existence of a bounded walk enumeration, but one would like to design effective algorithms with good bounds on the delay between two consecutive walks and on the memory usage. We have hope that such algorithms can be designed in the model of deque machines from . This would be a substantial improvement over , which needs unbounded auxiliary memory. Another question is whether walk enumeration on non-inner-connected graphs can be done with a limited number of threads like in ; we expect that our results would generalize but leave this open.
In a different direction, a natural extension of our work would be to allow additional elementary operations beyond push and pop. For instance, we could allow the insertion and deletion of edges at arbitrary positions of the walk, leading to a distance on walks amounting to the Levenshtein distance on words. This raises the question of determining which graphs are Levenshtein-orderable and what is their Levenshtein-rank. One can see by inspecting the proof of Proposition 3.2 (Appendix B) or of [AM23, Theorem 3.9] that inner-connectedness remains a necessary condition for Levenshtein-orderability, and of course Levenshtein-rank is upper bounded by pp-rank so it is always at most 3 for inner-connected graphs. However, when ordering walks in increasing order of length, the situation is different, because the Levenshtein-increasing-rank (defined in the expected way) no longer admits a lower bound from peripherality and criticality. Indeed, Figure 4 shows a family of graphs with unbounded peripherality and bounded Levenshtein-increasing-rank. Indeed, notice that each walk is at Levenshtein distance 4 from , so we could use Proposition 4.3 to upper bound the eventual Levenshtein-increasing-rank by 12. Note that if we replace the loop labeled by g with a simple cycle of length k, then the Levenshtein increasing-rank is no longer bounded: this suggests that entirely new tools would be necessary to extend our results to other distances such as the Levenshtein distance.

Some walk w s.t.
Figure 4 Graphs of unbounded eventual peripherality and bounded Levenshtein increasing rank
8 Bibliography
[AD 26] A. Amarilli, C. David, N. Francis, V. Marsault, M. Monet and Y. Strozecki. 'Gray codes with constant delay and constant auxiliary space'. In: ICALP'26. Vol. 374. 2026. ISBN: 978-3-95977-428-4. DOI: 10.4230/LIPIcs.ICALP.2026.160.
[AGM24] D. Adamson, P. Gawrychowski and F. Manea. 'Enumerating m-length walks in directed graphs with constant delay'. In: LATIN. 2024. DOI: 10.1007/978-3-031-55598-5_3.
[AM23] A. Amarilli and M. Monet. 'Enumerating regular languages with bounded delay'. In: STACS. 2023. DOI: 10.4230/LIPIcs.STACS.2023.8.
[CDG92] F. Chung, P. Diaconis and R. Graham. 'Universal cycles for combinatorial structures'. In: Discrete Mathematics 110.1-3 (1992). DOI: 10.1016/0012-365X(92)90699-G.
[DFM24] C. David, N. Francis and V. Marsault. 'Distinct shortest walk enumeration for RPQs'. In: Proceedings of the ACM on Management of Data 2.2 (2024).
[Epp98] D. Eppstein. 'Finding the k shortest paths'. In: SIAM J. Comput. 28.2 (1998). DOI: 10.1137/S0097539795290477.
[Fed94] T. Feder. 'Network flow and 2-satisfiability'. In: Algorithmica 11.3 (1994). DOI: 10.1007/BF01240738.
[FG 18] N. Francis, A. Green, P. Guagliardo, L. Libkin, T. Lindaaker, V. Marsault, S. Plantikow, M. Rydberg, P. Selmer and A. Taylor. 'Cypher: An evolving query language for property graphs'. In: SIGMOD'18. ACM, 2018. DOI: 10.1145/3183713.3190657. URL: https://doi.org/10.1145/3183713.3190657.
[Har69] F. Harary. Graph theory. Addison-Wesley, 1969.
[ISO23] ISO/IEC JTC 1/SC 32. Part 16: Property Graph Queries (SQL/PGQ). https://www.iso.org/standard/79473.html. ISO/IEC 9075-16:2023. Information technology – Database languages SQL. 2023.
[ISO24] International Organization for Standardization. GQL. https://www.iso.org/standard/76120.html. Standard ISO/IEC CD 39075. 2024.
[Kar68] J. J. Karaganis. 'On the cube of a graph'. In: Canadian Mathematical Bulletin 11.2 (1968). DOI: 10.4153/CMB-1968-037-0.
[LM 25] L. Libkin, W. Martens, F. Murlak, L. Peterfreund and D. Vrgoc. 'Querying graph data: Where we are and where to go'. In: Companion of PODS'25. ACM, 2025. DOI: 10.1145/3722234.3725822.
[LO 24] Q. Liang, D. Ouyang, F. Zhang, J. Yang, X. Lin and Z. Tian. 'Efficient regular simple path queries under transitive restricted expressions'. In: VLDB Endowment 17.7 (2024). ISSN: 2150-8097. DOI: 10.14778/3654621.3654636.
[LW93] T.-H. Lai and S.-S. Wei. 'The edge Hamiltonian path problem is NP-complete for bipartite graphs'. In: Information Processing Letters 46.1 (1993). ISSN: 0020-0190. DOI: https://doi.org/10.1016/0020-0190(93)90191-B.
[MN 23] W. Martens, M. Niewerth, T. Popp, C. Rojas, S. Vansummeren and D. Vrgoc. 'Representing paths in graph database pattern matching'. In: Proc. VLDB Endow. 16.7 (2023). DOI: 10.14778/3587136.3587151.
[MN 24] W. Martens, M. Niewerth, T. Popp, C. Rojas, S. Vansummeren and D. Vrgoc. 'Compact path representations for graph database pattern matching'. In: ICDE'24. 2024. DOI: 10.1109/ICDEW61823.2024.00059.
[MT18] W. Martens and T. Trautner. 'Evaluation and enumeration problems for regular path queries'. In: ICDT. 2018.
Graphs with Bounded Push-Pop Walk Orderings
[Müt23] T. Mütze. 'Combinatorial Gray codes — An updated survey'. In: The Electronic Journal of Combinatorics Dynamic Surveys (2023). DOI: 10.37236/11023.
[NRS17] T. Ng, D. Rappaport and K. Salomaa. 'State complexity of prefix distance'. In: Theoretical Computer Science 679 (2017).
[Rus03] F. Ruskey. 'Combinatorial generation'. Working Version (1j-CSC 425/520). 2003. URL: https://page.math.tu-berlin.de/~felsner/SemWS17-18/Ruskey-Comb-Gen.pdf.
[Seg14] L. Segoufin. 'A glimpse on constant delay enumeration (invited talk)'. In: STACS. 2014.
[Sek60] M. Sekanina. 'On an ordering of the set of vertices of a connected graph'. In: Publ. Fac. Sci. Univ. Brno 412 (1960).
[Tar72] R. Tarjan. 'Depth-first search and linear graph algorithms'. In: SIAM journal on computing 1.2 (1972).

(a)

(b)
Figure 5 A 1-orderable acyclic graph with 6 edges (a) and its walk graph (b) admitting a Hamiltonian path (orange)
A Open Problems
In this section, we implicitly assume that graph families are infinite, and that they contain graphs with arbitrarily many edges. (Since we do not assume graphs to be weakly connected, a graph can contain arbitrarily many vertices that are isolated and hence irrelevant.)
A.1 Lower Bounds
▶ Open problem A.1. Find a family of 1-orderable acyclic graphs, or show that there is none.
We found several 1-orderable acyclic graphs, but none of them has more than twelve edges. We provide in Figure 5 a smaller example together with its walk graph. Given the constraints imposed on a 1-bounded ordering for a single path, we deem it likely that there are only finitely many acyclic graphs that are 1-orderable.
▶ Open problem A.2. Find a family of cyclic graphs where has a peripherality of and is -orderable by increasing length, or show that there is none.
We believe there is no such family and that the pp-increasing rank of a cyclic graph G is at least .
A.2 Upper Bounds
Unlike lower bounds, we have not shown our upper bounds to be tight at all. Hence there is much work to do in that direction.
▶ Open problem A.3. Find a graph (or a family of graphs) with a pp-rank of 3, or show that there is none.
We tend to think that there are indeed graphs that are not 2-orderable but we suspect that all trees, and possibly all acyclic graphs, are 2-orderable. Note that most graphs are not 1-orderable and it can be verified for instance that the graph consisting of a single directed path is not 1-orderable as soon as it has five edges.
▶ Open problem A.4. Improve the upper bounds of Theorem 1.1, Items b and c or find a graph family showing they are tight.
Graphs with Bounded Push-Pop Walk Orderings
A.3 Complexity of Computing Graph Ranks
In our opinion, the most striking problems left open by our work are the question of finding algorithms (and hopefully favorable complexity bounds) to compute the exact (eventual) pp-(increasing-)rank of an input graph. Indeed, we were able to show only one complexity lower bound (for the pp-increasing-rank) and no complexity upper bound at all (not even a decidability bound).
▶ Open problem A.5. Find any algorithm to compute either:
a. the pp-rank of a given graph;
b. the pp-increasing-rank of a given graph; or
c. the eventual pp-increasing-rank of a graph.
Note that Theorem 1.1 and Proposition 6.2 provide computable upper bounds for all three ranks. Hence, Theorem A.5 hinges on deciding whether, given a graph G and integer k, the graph G is (eventually) k-orderable (by increasing length). Recall that we do not know if any graph has a pp-rank of 3 (Theorem A.3). If there is none, Item a would amount to testing whether a graph pp-rank is 1, something that seems way easier.
▶ Open problem A.6. Show NP-hardness results for the pp-rank of a given graph or the eventual pp-increasing-rank of a given graph.
Computing any of the three ranks essentially amounts to computing a Hamiltonian path in one or several walk graphs. Hence this task should intuitively be NP-hard. However, it turns out that it is quite hard to control the shape of a walk graph. Computing the ranks could even be in higher classes.
A.4 Odd Ranks
It is mentioned in the main text that only makes sense if is an even number. Indeed, we have for every . Since we heavily use to obtain both lower and upper approximations of pp-increasing-ranks, it may be tempting to think that the pp-increasing-rank of any graph is always an even number. Example A.7, below, shows that it is not always the case.

Figure 6 A graph with an odd pp-increasing-rank
▶ Example A.7. We consider the graph from Figure 6 and denote it by G. It has four walks of length 2 ( , , and ), a single walk of length 3 ( ), and no walk of length 4 or more. Let us show the pp-increasing-rank of G is 3.
First note that is not 1-orderable by increasing length: and never relates two different walks of the same length.
Next, let us show that is not 2-orderable by increasing length. For this, observe that is an undirected line graph, so that there are only two 2-bounded orderings of , namely and its reverse. If there were an increasing
2-bounded ordering of Walks(G), then the predecessor of would necessarily be or , neither of which is related to by , a contradiction. Hence, G is not 2-orderable by increasing length.
On the other hand, since is a clique and , it is clear that G is 3-orderable by increasing length. Hence, the pp-increasing-rank of G is 3.
Indeed Example A.7 gives a case where the hardest part of the ordering is not to find an ordering for all walks of a given length, but to connect those orderings. We don’t know whether such example exists for the eventual pp-increasing rank:
▶ Open problem A.8. Find a graph with an eventual pp-increasing-rank that is an odd number, or show it is impossible.
B Supplementary Material for Section 3 (Inner-Connectedness and Terminology for Vertices, Edges and Walks)
B.1 Object Kinds and Inner-Connectedness
In this appendix section, we explain why the following result is true:
▶ Proposition 3.2 ([AM23]). No inner-disconnected graph is eventually orderable.
We first explain why the result follows from [AM23], before giving a self-contained proof which is easier to follow as it only uses graph terminology.
Proof of Proposition 3.2 via [AM23]. To obtain the result from [AM23], we will rely on the following:
▷ Claim B.1. Given a directed graph , we can build in linear time a DFA whose alphabet is the edge set E of G, such that the language accepted by is precisely the set of walks of G.
To prove Claim B.1, intuitively, we see G as an automaton where each vertex is a state and each edge is a transition labeled by the letter e, and all states are both initial and final. The only subtlety is that this does not give a deterministic automaton (because of the multiple initial states), whereas the results of [AM23] only apply to DFAs. To address this, we add one dedicated initial state. Formally:
Proof of Claim B.1. Let be the input directed graph. Let , where is a fresh state that does not occur in . Let be the automaton on alphabet with state space , with all states being final, and with the following kinds of transitions:
■ For each , we have a transition labeled from to ;
■ For each , we have a transition labeled from to ;
(Intuitively, we can also obtain by adding only the second kind of transitions together with -transitions from to every state in and then doing -transition removal.) It is immediate that as built is indeed a deterministic automaton (because for each letter there are only two transitions labeled and their source states are different), that the construction is in linear time, and that a sequence of edges of is accepted by precisely if it is a walk of .
Graphs with Bounded Push-Pop Walk Orderings
We can now prove Proposition 3.2 by appealing to the results of [AM23]. Let G be an inner-disconnected graph. Using Claim B.1, let be a DFA recognizing the language L of the walks of G. Let us show that L is not eventually orderable.
For this, let us first show that is not interchangeable in the sense of [AM23]: we show by contraposition that if were interchangeable then would be inner-connected. Indeed, the non-trivial sccs of are in bijection with the non-trivial sccs of , and the loopable states of (in the terminology of [AM23]) are in bijection with the vertices of the non-trivial sccs of . Further, if were interchangeable, then all its loopable vertices would be related by the transitive closure of the connectedness relation of [AM23]: it is easy to see from the structure of that the compatibility relation on is the identity because non-empty runs starting at a loopable state of must start with a letter with , so there cannot be a non-empty word that labels a loop on two different loopable states of . Thus, if were interchangeable, then the graph formed of its loopable vertices and the directed paths from a loopable vertex to another (possibly via non-loopable vertices) would be weakly connected, implying that would then be inner-connected. Hence, by contraposition, as is not inner-connected then is not interchangeable.
We can then invoke [AM23, Theorem 3.9]. This result implies that the language of is not orderable for the Levenshtein distance, hence also for the push-pop-distance, and so indeed is not an orderable graph. This establishes Proposition 3.2, noting that if were eventually orderable with some finite distance bound then it would be orderable with some finite distance bound , e.g., we can take to be the maximum between and the (finite) maximal distance between two consecutive walks in the (finite) prefix of the witnessing sequence for eventual orderability to which the distance bound does not apply.
Self-contained proof of Proposition 3.2. For our self-contained proof of Proposition 3.2, we will rely on the following preliminary lemma, which is the analogue in our setting of [AM23, Proposition 3.10].
▶ Lemma B.2. Let be an inner-disconnected graph. Then, for every integer , there exists such that we can partition into two infinite sets such that there are no edges of between and .
Proof. Let be a graph. Just like strong connectedness, weak connectedness defines an equivalence relation on V and we call its equivalence classes the weakly connected components (or wcc for short) of G. Note that each wcc is a union of sccs.
We denote by the inner subgraph of and by the wccs of ; as is inner-disconnected we have .
Let . We associate each walk of of length at least to one of , as follows. Since , some edge of occurs twice in , hence must encounter at least one nontrivial scc of ; this scc is contained in some wcc of ; and we associate with . Note that this correctly defines a mapping from walks of of length at least to the wccs of , because if encounters more than one nontrivial scc of then they must all belong to the same wcc of . This implies that contains no edge that belong to a wcc of with . As we have , we know that contains at least edge occurrences that are repeated, and the corresponding edges must belong to a nontrivial scc of , hence to .
For every , we let denote the set of the walks in associated with the wcc . Note that each wcc contains at least one nontrivial scc (by definition of the inner subgraph), hence each contains infinitely many walks. It follows from the previous paragraph that two walks and are never related by unless (because at least edge occurrences have to be removed and edge occurrences have to be added in order to transform into ). Hence, since and , the statement follows by partitioning into and .
We can now prove Proposition 3.2 similarly to the proof of [AM23, Theorem 3.9]:
Proof of Proposition 3.2. For the sake of contradiction, let us assume that there is an inner-disconnected graph that is eventually -orderable, yielding an integer and an (infinite) walk sequence that enumerates . Applying Lemma B.2, let and be two infinite sets of vertices in that are disconnected under . In particular, and are infinite as well. There are finitely many walks in , possibly none, hence there is a rank such that all walks with , have length at least . Now, let be the set of walks produced before rank . As is finite, there are two walks in and in that do not belong to . Hence, and for some ; without loss of generality we may assume that . We reach a contradiction because provides a chain connecting and , and this chain is in from our assumption that all walks enumerated after rank have length at least .
▶ Remark B.3. The proof of Lemma B.2 and thus of Proposition 3.2 relies on the number of edges which are different for walks in two different weakly connected components of the inner subgraphs. Hence, the position of these edges does not change the proof, which still works for the Levenshtein distance, which is a relaxed version of the Push-Pop distance. (We note that the same holds in [AM23], with [AM23, Theorem 3.9] applying also to the Levenshtein distance.) See Section 7 where the issue is discussed in more detail.
B.2 Walk Types
▶ Property 3.3. Let G be a graph.
a. Let be a walk such that and are nonempty. Then is of type L (resp. R) if and only if is of type L (resp. is of type R).
b. No walk contains both an edge of kind I and an edge of kind F.
c. Each walk in G is either of type L?I?R? or of type L?FR?
Proof. Property 3.3 is a consequence of the way walk concatenation combines with the properties in Equations (1a) and (1b). It may indeed be verified that, if denotes a walk and two edges such that is a walk, then we have the following two implications:
-
satisfies (1a) satisfies (1a)
-
satisfies (1b) e satisfies (1b)
Proof of Item a. We focus on the statement about type L, as the statement about type R is symmetric. The forward direction is immediate. For the converse direction, if is of type L, then the last edge of is of kind L, hence by definition it satisfies Equation (1b) but not Equation (1a). Implication 2 above implies that every edge of satisfies Equation (1b), and the contraposition of Implication 1 implies that no edge of satisfies Equation (1a), hence it is indeed the case that all edges in are of kind L.
Proof of Item b. A walk containing an l-edge and an F-edge is of the form or of the form . The former case contradicts Implication 1 and the latter case Implication 2.
Item c is a direct consequence of Items a and b.
Graphs with Bounded Push-Pop Walk Orderings
C Supplementary Material for Section 4 (Peripherality and Upper Bounds)
C.1 Orderability and Walk Graph Connectedness
▶ Proposition 4.1. Let be a graph and a positive integer. If the undirected graph is connected for every , then is 3k-orderable by increasing length.
To show Proposition 4.1, we first restate and show our auxiliary result:
▶ Proposition 4.3. Let be a possibly infinite undirected graph, and let be a partition of as non-empty finite vertex sets meeting the following conditions.
a. The subgraph of induced by is connected, for every .
b. There is a vertex sequence such that:
for all
for all .
Then, there exists an ordering of V meeting the following conditions.
c. For every , whenever we have and for some , then .
d. We have , for every .
Proof. For every , we define from , given by hypothesis b, as follows. If , that is if , we fix , otherwise we have and we fix as any vertex in such that and , which must exist as a consequence of hypothesis a. Note that in both cases .
For every , we now do one of two things depending on . The first case is when . In this case, we apply Theorem 4.2 to the subgraph induced by , with endpoint vertices . Theorem 4.2 yields, for each integer such that , an ordering of such that for each . The second case is when . In this case, we set and associate with the 1-element sequence . Note that, in both cases, we obtain an ordering of that starts at and ends at and where consecutive pairs are in .
We then concatenate the vertex sequences associated with each i by increasing i, yielding the following infinite sequence.
It is an ordering of since is a partition of and because is an ordering of , for each . Item c holds by construction. Finally, to show item d, we already know that the condition holds within the vertex sequences for each , and we must only show it between the last vertex of each sequence and the first vertex of the next sequence. In other words, we must show that for every there is a chain of length at most 3 linking to . This fact follows from the second item of hypothesis b ( and are at distance 2 or less) and the definition of (either or ).
We are now ready to show Proposition 4.1:
Proof of Proposition 4.1. Let be a graph and an integer such that the undirected graph is connected for every . We fix , for every .
We first treat the case where is cyclic, in which case there exists a walk sequence such that and , for each (e.g., following any cycle in any nontrivial scc). We apply Proposition 4.3 to the (infinite) undirected graph (Walks, PP), and sequences , . By construction, is a partition of Walks, and Item 4.3a holds by hypothesis. For every , we have by construction, hence also ; in other words Item 4.3b holds. Proposition 4.3 yields the 3k-bounded ordering of Walks since is equal to .
The case where is acyclic is similar. Let be the length of the longest walk in , . Hence in particular, . For every , let be the prefix of length of an arbitrary walk of length in . Apply Proposition 4.3 to the (finite) undirected graph (Walks, ), and sequences , .
▶ Property 4.5. a. For every walk w, .
b. For every cyclic graph , , where is the subset of Walks of those walks that encounter some nontrivial scc.
Proof. Item a is a direct consequence of Property 3.3c, so we focus on item b, that is on showing the following equality (where W is defined in the statement).
and are well defined) No walk in the graph can repeat a L-edge, R-edge nor an F-edge (a repeated edge is always of kind I). Hence the peripherality of a walk is at most where (resp. , resp ) is the set of L-edges (resp. R-edges, resp. F-edges) in the graph.
By definition, there exists a walk such that and . In particular, encounter a nontrivial scc hence , yielding .
Whenever a walk encounters a nontrivial scc and satisfy , then some vertex of a nontrivial scc must occur in . Thanks to the definition of a nontrivial scc, we can then obtain arbitrarily large walks from by inserting arbitrarily long l-walks from to itself. By item a, the resulting walks have the same peripherality, so indeed the peripherality of is reflected in hence satisfying .
▶ Lemma 4.6. We have: and .
Proof. We distinguish between walks of type L?FR? and of type L?I?R?.
For a walk of type , we show an upper bound of . Indeed, any walk of length must contain a repeated vertex, hence it must contain an l-edge. Thus, walks of type have length , and since we have , we conclude.
For a walk of type , we show an upper bound of . Write the -factorization of as . By Property 4.5a, we have . Hence, assume by contradiction that , then we have . In particular and collectively have vertex occurrences. By the pigeonhole principle, 3 of these occurrences must be part of nontrivial sccs, hence of kind I. Since a walk between l-vertices is of type I, then either or contains an l-edge.
The statement then follows by definition of (Equation (2) in Definition 4.4) and by Property 4.5b for using the fact that walks of type cannot encounter a non-trivial scc. This last point is because the only vertices in a non-trivial scc that could occur in such a walk would be at the end of the factor or at the beginning of the factor, but then this would contradict the fact that the middle edges are of type .
Graphs with Bounded Push-Pop Walk Orderings
C.2 Walks with Peripherality Zero
▶ Proposition 4.7. Let be an inner-connected graph and two walks in . If and have peripherality 0 and , then .
Proof. Let be the set of walks of that entirely belong to a single nontrivial scc; the scc is not fixed, so that whenever there is a nontrivial scc containing every edge of . The proof proceeds in two steps: every walk of peripherality 0 is related by to some walk in (Claim 4.8), and any two walks of of the same length are related by (Claim 4.9). Both steps rely on Claim C.1, which we prove first.
▷ Claim C.1. Let be two walks of the same length. If the source of is reachable in from the target of , then .
Proof of Claim C.1. We let denote the length of and . The hypotheses imply the existence of a walk such that is a walk of . Let be the length of . For every in we denote by the unique factorization of such that is of length and is of length . Note that and . Since a pop-left and a push-right transform into , we have , for every , hence the statement follows.
▷ Claim 4.8. For every nonempty walk of peripherality 0, there exists a walk such that .
Proof of Claim 4.8. A walk of peripherality 0 has type or . By symmetry we only focus on the case where is a (nonempty) -walk. Thus, by definition, satisfies Equation (1a). Hence there exists a walk such that starts in a nontrivial scc . Let be any walk of length that ends at and that entirely belongs to , as can be obtained following any cycle of the nontrivial scc . The claim follows by applying Claim C.1 to and .
▷ Claim 4.9. For any two walks of the same length, we have .
Proof of Claim 4.9. Let be the condensation of the inner subgraph of . Let be the relation on nontrivial sccs of defined by if there exists a path in from to or vice versa. Since is inner-connected, is weakly connected, hence holds for every sccs .
The claim is obtained by an induction on showing that implies that we have for every walk that entirely belongs to and that entirely belongs to and has the same length as .
The base case implies hence and both entirely belong to the same scc . We can then conclude using Claim C.1 because the source of and the target of are in the same scc .
For the inductive step, assume , for some scc . Let be a walk of length that entirely belongs to . The inductive hypothesis shows that . On the other hand, implies by definition that is reachable from in , or vice-versa. In the former case, the source of is reachable from the target of . In the latter case, the source of is reachable from the target of . In both cases, applying Claim C.1 yields . We conclude by the transitivity of .
Proposition 4.7 then follows directly from Claims 4.8 and 4.9.
C.3 Upper Bounds
▶ Proposition 4.10. Every inner-connected graph is 3-orderable.
Proof. If is acyclic then the undirected graph is finite. Moreover, features a chain from any walk to the empty walk using the prefixes of , hence is connected. A direct application of Theorem 4.2 to concludes the proof in this case.
We assume G to be cyclic in the remainder of the proof. For every nonnegative integer k, we define as follows.
We show the following claim using Proposition 4.7.
▷ Claim 4.11. For every nonnegative integer , is a connected graph.
Proof of Claim 4.11. Notice that is a bipartite graph. We first show the following:
(†) for and two walks in such that , we have that is connected to in .
Since , there is a (possibly empty) walk and two edges and such that and are of one of the following shapes ( is the edge that we remove and the one we add to go from to ):
In particular, . Note that and since , one can check that as well, so that we have . Hence and are indeed connected in , which concludes the proof of (†).
To finish the proof of Claim 4.11, let and now be arbitrary walks in . If , then since is of peripherality 0, for reasons similar to the proof of Claim 4.8 there exists an edge such that or is a walk of length and of peripherality 0 which satisfies . The same holds for . Therefore, to show Claim 4.11, it is enough to prove that for any two walks of , these walks are connected in . Proposition 4.7 yields that , hence there exist walks such that:
Applying (†) to each pair we obtain that is connected to in . It follows that is connected to in , concluding the proof of Claim 4.11.
Now, we write , for every . Notice that and . We then extend Claim 4.11 as follows.
▷ Claim 4.12. For every nonnegative integer , is a connected graph.
Proof of Claim 4.12. For every walk in with , there is an edge and a walk such that and either or . It may be verified that and . Inductively applying this reasoning shows that there is a walk that is connected to in . Now, since is connected by Claim 4.11, the proof of Claim 4.12 follows.
△
Graphs with Bounded Push-Pop Walk Orderings
We will now finish the proof of Proposition 4.10 by applying Proposition 4.3 as follows. We write and , for each . Since is a partition of , is also a partition. By Claim 4.12, is connected for every thus condition 4.3a holds. Since is cyclic, it contains an infinite walk that is of type 1, e.g., following any cycle in a nontrivial scc. For every , we write for the prefix of of length 2i. The sequence thus defined satisfies Condition 4.3b: we have and , for every . Proposition 4.3 thus yields an ordering of that is 3-bounded.
▶ Proposition 4.13. Every inner-connected graph G is 6k-orderable by increasing length, where .
Proof. Thanks to Proposition 4.1, it is sufficient to show the fact that the undirected graph is connected for every . If then Proposition 4.7 concludes, so let us assume that . If is acyclic, the size of all walks is bounded by the peripherality thus any two walks of the same size , satisfy and so is indeed connected for every . We are left with the case of cyclic graphs of positive peripherality. We show the following claim.
▷ Claim 4.14. If G is cyclic, then for every walk w in G with positive peripherality, there exists a walk in G such that the following two conditions hold.
Proof of Claim 4.14. Since w is of positive peripherality, it is either of type L?R or L?FR?
Case 1: can be -factorized as . We assume without loss of generality that because the other case is symmetric. The first vertex of is necessarily inner, because is nonempty and of type and continues with which is also nonempty and of type . Hence, there are arbitrarily long walks that start in a nontrivial scc and end at . All edges of such walks are inner, because they lie on a path from to which is inner and hence can reach a nontrivial scc. Take such a walk of length , and let be its suffix of length . The walk is of type so it has peripherality 0 and we clearly have . Moreover, the walks differ by changing a prefix of length so indeed and we have established (9).
Case 2: can be -factorized as . If both and are empty, then , hence any walk such that satisfies . Since is cyclic we can choose of peripherality 0, hence (9) holds.
Otherwise, either or is nonempty. We assume without loss of generality that , hence that is nonempty; the other case is symmetric. It follows that . Since is of type , its origin is reachable from a nontrivial scc, so there exist two walks of type , of type such that is a walk and . A simple verification then shows that satisfies (9).
Thus, any walk of positive peripherality is -related to one of the same length and of peripherality 0. By Proposition 4.7, the set of walk of peripherality 0 and length is connected for . This implies that is connected for every and concludes the proof.
▶
D Supplementary Material for Section 5 (Criticality and Lower Bounds)
D.1 Criticality and Critical Walks
▶ Property 5.2. Every walk or graph with peripherality p and criticality c satisfies . Every graph with eventual peripherality and eventual criticality satisfies .
Proof. We first show the claim about walks, and turn to the claims about graphs at the end of the proof. Let w be a walk. There are two cases.
First, if is a -walk, then by definition we have .
Second, if is a -walk, let us show that we have by induction over the criticality of (which cannot be < 0 according to Definition 5.1 because is of type ). If , then is of the form (or symmetrically of the form ) where either: contains only outer elements, in which case ; or consists of exactly one -edge, in which case . In particular, we indeed have . If , then we have and we factorize as for some walk and edges . Since , contains an -edge and by definition of criticality, we have . We apply the induction hypothesis which yields . On the other hand, it can be observed that either: (in the case where and both are -edges); or (in all other cases). Hence
which concludes the second case and establishes the result for walks.
The statement about graphs for peripherality and criticality follows immediately: if for every walk, then the same is true for the maxima across all walks. As for eventual peripherality and eventual criticality, the statement follows because the only relevant case is then that of , because sufficiently long walks do not feature any finitary edge.
▶ Lemma 5.4. Let be a critical walk with a positive criticality . Then every walk such that is equivalent to w.r.t. , hence critical.
Proof. Let be a walk with . This implies that the type of is either or . We distinguish both cases below.
Case where is of type . We -factorize as . Recall that and have the same length. Hence, implies there is such that -pop and push operations are sufficient to transform into . Since and are both greater than or equal to , it follows that , and can be factorized as:
where and are nonempty. As indicated above, since contains only edges of kind and is nonempty, it is of type , hence is also of type (Property 3.3a). Symmetrically, is of type
Since w is critical, it must be greater, equivalent or incomparable to the two walks given below w.r.t. . Note that their lengths might differ from the length of w.
Graphs with Bounded Push-Pop Walk Orderings
Both and encounter a nontrivial scc if and only if does, because vertices of nontrivial sccs can only occur in (or, in the case , the vertex might be part of a nontrivial scc). Indeed the walks and , respectively and , are of type , respectively of type , so it is not possible that a vertex of a nontrivial scc occurs strictly inside them, hence there cannot be vertices from nontrivial sccs in the parts of the walks that have changed. Hence, is comparable to and , and it is greater or equivalent to them w.r.t. . If , then and , hence by Item 2 of Definition 5.3, we would have , a contradiction. Hence, we have , and the same reasoning applied to yields that . Moreover, recall that , hence we have that which implies that and . In other words, we have
hence is equivalent to w, hence critical.
Case where is of type . There exist walks and an F-edge such that:
Equation (11) comes from the definition of and Equation (12) from the definition of criticality. We know that and cannot encounter a nontrivial scc by definition of the kinds , , and . Now, if were strictly longer than then we would have , a contradiction. Similarly cannot be strictly longer than . Therefore, (11) yields that and . It follows that the criticality of is at least , hence exactly as is the maximal criticality. Since moreover and contain no edge of kind , we have , hence is equivalent to w.r.t. , hence critical.
D.2 Lower Bounds
▶ Proposition 5.5. Let G be a cyclic graph.
a. If the criticality c of G is positive, then G is not -orderable by increasing length.
b. If the eventual criticality of G is positive, then G is not eventually -orderable by increasing length.
The proof of Proposition 5.5 hinges on kind of converse to Proposition 4.1, stated next.
▶ Lemma 5.6. Let be a graph and a positive integer. If is -orderable (resp. eventually -orderable) by increasing length, then the undirected graph is connected for every (resp. for almost every ).
Proof. For orderability by increasing length, let us consider a -bounded increasing ordering of Walks(G). For each , we can consider the contiguous subsequence of the walks of length and it forms a Hamiltonian path of , which thus is connected. The proof is similar for eventual orderability by increasing length.
Proof of Proposition 5.5. First, we use Lemma 5.4 to show that critical walks are disconnected from other walks in for relevant and .
▷ Claim 5.7. If , there exists an integer such that is disconnected.
Proof of Claim 5.7. There exists a critical walk in with criticality : as , is non-empty. We write with . Since is cyclic, it contains an l-walk such that ; in particular the peripherality of is equal to 0, hence its criticality is equal to -1 by Property 5.2, hence is not equivalent to w.r.t. because they do not have the same criticality (indeed has criticality ). Lemma 5.4 then yields that and are not related by , hence not by either since these two relations are equal.
▷ Claim 5.8. If , there exist infinitely many integers such that is disconnected.
Proof of Claim 5.8. There exists a critical walk that has criticality and encounters a nontrivial scc. Split such that the vertex belongs to nontrivial scc. Let be an arbitrary nonempty walk both starting and ending in : all edges of are of kind 1. It follows that is a walk for every . Further, and both visit some nontrivial scc (i.e., that of ), neither contains an F-edge so their criticality is their peripherality minus 1 and it is the same because that number only depends on the edges of kind L and R of and which are the same edges. It follows that all walks of the form are equivalent to w.r.t. for each , and since is critical, they are all critical. The remainder of the proof is similar to the one of Claim 5.7.
We conclude the proof of Proposition 5.5 by noticing that Item a follows from Claim 5.7 and Lemma 5.6 and Item b from Claim 5.8 and Lemma 5.6.
D.3 Lower Bound Tightness
▶ Proposition 5.9. a. There are arbitrarily large cyclic graphs that are 1-orderable.
b. There are arbitrarily large acyclic graphs that are 2-orderable by increasing length.
c. There are graphs with arbitrary large peripherality p that are -orderable by increasing length.
d. There are graphs with arbitrary large eventual peripherality that are eventually -orderable by increasing length.
Proof of Proposition 5.9a. Consider the simple cycle with vertices , and by abuse of notation we write for any , meaning . Hence the edges of are where ranges in . For every and we denote by the walk in that starts at and whose length is . For every we define the 1-bounded ordering of as follows.
Notice that starts with and ends with . Hence, we can start with the empty walk and then connect the layers of the form by going from to at distance 1. Thus, for every integer , the pp-rank of is 1.
Proof of Proposition 5.9b. Consider the graph , consisting of a single (directed) path of length . It contains vertices and edges , for . Note that
Graphs with Bounded Push-Pop Walk Orderings
has a criticality of and a peripherality of . For every we denote by the unique walk in starting in and ending in , hence . For every , is 2-orderable by increasing length thanks to the following ordering. For odd , the set is ordered , . For even , we use the inverse order. It yields:
We have now shown the desired claim. We also remark that, in fact, the pp-increasing rank of is exactly 2 for every , because for , the graph has two different walks of the same length hence it is not 1-orderable by increasing length.
Proof of Proposition 5.9c. We consider the graph family shown in Figure 3d and denote by the graph of this family with a peripherality of and a criticality of . Let us show that is -orderable by increasing length. Note that any two walks such that are of type and satisfy . Hence, it is quite straightforward to find an increasing ordering of that is -bounded, and that moreover can start by an arbitrary walk of length . Since all walks in are related by , it is trivial to build an increasing -bounded ordering of that ends with an arbitrary walk of length .
For every length such that , let us build an ordering of . We write:
It may be verified that each walk in is the factor of , of or of , and of exactly one of those since . We denote these factors as follows. For every , we denote by the unique walk such that there are , satisfying and and . The walks , with and , with are defined similarly. It may be verified that , given below, is -bounded.
(In the case where , we have , which can also be verified to be -bounded.)
If is even, we write , where we choose the last walk of to be the prefix of length of the first walk of and the first walk of to be . It follows that is -orderable by increasing length. If is odd, the reasoning is similar with for a suitable choice of .
Proof of Proposition 5.9d. We consider the graph family shown in Figure 3b and let denote the graph of this family with (eventual) peripherality . We first consider the case where is an even number. As shown in the figure, has vertices: . As we are discussing orderability, we will only consider the walks of length . Let us first consider the walks of length . Note that there is exactly one walk in , denoted by , that starts at each and ends at each . Note also that, for every and , we have where , hence also . It follows that is a -bounded ordering of for each in . Denoting the reverse ordering, let us consider the following ordering of .
Note that always ends by and never by since we assumed to be an even number. Since and , for each , the ordering is 2k-bounded. The last walk of is and the first walk of is , which satisfy . Symmetrically, the last walk of is and the first walk of is , which also satisfy . It follows that , given below, is a 2k-bounded ordering of .
In other words, the graph is eventually 2k-orderable by increasing length when is even.
In the case where is odd the ordering is defined in the same way. However, ends with hence with walk . Then starts with , which is related by (in fact even ) to , and ends with .
E Supplementary Material for Section 6 (Parameter Computation)
▶ Lemma 6.1. One may compute in linear time the kind of all objects in a graph.
Proof. We first compute the strongly connected components of G and the condensation in linear time using Tarjan's algorithm [Tar72]. From this information, one may determine for every object whether it satisfies Equations (1a) and (1b): for this we do one forward traversal of the graph starting from all nontrivial sccs, and one backward traversal of the graph starting from all nontrivial sccs. The information of which objects are reached by these traversals allows us to compute the kinds of all objects in linear time.
▶ Proposition 6.2. Let be a graph, and F the set of finitary vertices in G.
a. The eventual peripherality of G can be computed in time .
b. The peripherality of G can be computed in time .
Proof. We first compute the kind of every object in linear time using Lemma 6.1. Since every cycle entirely belongs to a nontrivial scc, the subgraph formed of the edges that are of kind L, R or F is acyclic. For every vertex v, we define two symmetric quantities:
, the maximal length of the L-factor of a walk of type ending at ;
, the maximal length of the R-factor of a walk of type starting at .
The values are computed in linear time in two phases: dynamic programming over the L-subgraph first yields, for every vertex , the maximal length of a walk of type ending at ; these values are then propagated, taking maxima, along a topological ordering of the
Graphs with Bounded Push-Pop Walk Orderings
condensation of the inner subgraph. This indeed computes , since the walks of type ending at are exactly the concatenations of a walk of type ending at some vertex with an inner walk from to , both possibly empty. The values are computed symmetrically.
We will first show how to compute the peripherality of walks of type in Claim E.1, and then treat the walks of type in Claim E.2. For walks of type we distinguish two cases depending on whether we want to study peripherality or eventual peripherality:
▷ Claim E.1. The following equalities hold.
a.
b. , where denotes the set of the vertices that belong to a nontrivial scc.
Proof of Claim E.1. We start with the (≤) direction of (a). Let be an -factorized walk. We show that is less than the right-hand-side of the claimed equality. If , then the claim holds, hence we assume in the following that and are nonempty. In particular, there is a factorization such that is of type and of type . If we fix , we have and , hence also . This immediately yields the (≤) inequality of (a). For the (≤) inequality of (b), notice that any walk that encounters a nontrivial scc is of type hence the prior reasoning applies, picking the vertex inside a nontrivial scc to be within the factor or at the interface between the and factors, so achieving the maximum in the right-hand-side of equality (b) because can be chosen to be which is indeed inside a nontrivial scc.
We now show the (≥) direction of (a). Let be any vertex. Concatenating a walk that realizes and a walk that realizes yields a walk of type whose factorization has an -part of length and an -part of length , hence of peripherality . This yields the (≥) inequality of (a). Moreover, if belongs to , then encounters a nontrivial scc, which yields the (≥) inequality of (b).
It remains to compute the maximal peripherality of -walks. For every vertex and integer , let
with if no such walk exists. Decomposing an F-walk at its last edge yields the recurrence
Since the F-subgraph is acyclic, for all , so it suffices to consider values and all values are computed in time .
▷ Claim E.2.
Proof of Claim E.2. ( ) Let be an -factorized walk, and let , and . Let us show that is less than the right-hand-side. Then and , and the following equation concludes the proof of ( ).
(≥) Let and be such that , realized by a vertex and an F-walk from to . Moreover, we let and be some walks that realize and . The walk cannot contain both an l-edge and an F-edge from Property 3.3b. Since contains an F-edge, it is necessarily of type and is its -factorization, hence:
which concludes the proof of ( ) hence of Claim E.2.
The eventual peripherality of is equal to the quantity in Item E.1b from Property 4.5b. Since and for all are computed in total time, Item a of Proposition 6.2 follows. The peripherality of is the maximum of the quantities in Items E.1a and E.2. Since all are computed for all and in total time, Item b of Proposition 6.2 follows.
▶ Proposition 6.3. Given a graph , the criticality and eventual criticality of G can be computed in time .
Proof. We first discuss criticality. From the definition (Definition 5.1), the criticality is the maximum between the criticality of walks of type and those of type . The maximal criticality of walks of type can be computed in linear time as in the proof of Proposition 6.2 using the result of Claim E.1a, because the maximal criticality over such walks is obtained as the maximal peripherality minus one. Now, the maximal criticality of walks of type can be computed as follows. Like in the beginning of the proof of Proposition 6.2, we first compute the kinds of all objects using Lemma 6.1, and we use the fact that the subgraph of edges of kind L, R and F is acyclic. This allows us to compute in linear time over this graph by dynamic programming the following quantities for every vertex v: the maximal length of a walk of type that ends at v, and the maximal length of a walk of type that starts at v. Once this is done, the maximal criticality of walks of type is obtained following Definition 5.1 by taking the maximum, over all edges of kind F, of the minimum of the first quantity for u and of the second quantity for v.
For eventual criticality, we use again that walks that encounter a nontrivial scc must be of type , so that we compute it from peripherality again simply using Claim E.1b. This concludes the proof.
▶ Proposition 6.4. Deciding whether a graph is 4-orderable by increasing length is NP-hard, even for acyclic graphs.
Proof. Recall that the line graph of an undirected graph G is the graph whose vertex set consists of the edges of G where we connect two edges of G in whenever they share a vertex in G. We reduce from the Edge Hamiltonian Path Problem [LW93] where we ask, given an undirected graph G as input, whether it admits an edge Hamiltonian path, which is simply a Hamiltonian path of the line graph of G. The Edge Hamiltonian Path Problem is NP-hard even when G is required to be a bipartite graph [LW93].
To describe the reduction, let be the bipartite graph that we are given as input. We construct the directed graph as follows:
There is an edge from s to each vertex in A;
There is an edge from each vertex in B to t;
■ For each , there is an edge such that and , (that is, we direct every edge of from to ).
Graphs with Bounded Push-Pop Walk Orderings
It is immediate that the construction of is in polynomial time in the input G.
Remark that every walk of length 3 in is of the form , with and . Thus, there is a bijection between the walks of length 3 of and the edges of .
Finally, remark that two walks of length 3 are related by if and only if they share their vertex in or their vertex in . Formally, let and . Then we have if and only if or , which yields or . This is precisely the condition under which two edges of are adjacent in the line graph of , i.e., the condition under which two edges of can occur consecutively in an edge Hamiltonian path. Thus there exists a 4-ordering of the walks of length 3 of if and only if admits an edge Hamiltonian path.
This concludes the proof. Indeed, walks of length 1 or 2 of are always 4-orderable. Thus is 4-orderable by increasing length if and only if G has an edge Hamiltonian path.