arXiv:2608.24776cs.DSAug 2026

Manuscript Offprint

arXiv:2608.24776

Dynamic Edge Orientation via Random Walks: From Trees to Outerplanar Graphs and Beyond

Gabriel Marques Domingues, Minh Hang Nguyen, Shay Solomon

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

Abstract

We study the fully dynamic edge orientation problem, focusing on worst-case time bounds. An undirected graph undergoes edge insertions and deletions, and the goal is to maintain an orientation with small maximum outdegree (hereafter, outdegree) and small worst-case update time. The outdegree of any orientation is at least α−1\alpha-1, where α\alpha is the graph's arboricity, i.e., the minimum number of forests into which its edge set can be partitioned. When α=O(1)\alpha = O(1), it is long known that both the outdegree and the worst-case update time can be bounded by O(log⁡n)O(\log n). Despite numerous follow-ups, no o(log⁡3n)o(\log^3 n) worst-case update time is known for maintaining constant outdegree, even for very basic graph families—with a notable exception, forests.

For forests, a simple folklore algorithm maintains outdegree 2 via random walks: When an insertion creates a vertex of outdegree 3, the algorithm repeatedly chooses a uniformly random outgoing edge until reaching a vertex of outdegree at most 1, and then flips the resulting directed path. As the underlying graph is cycle-free, the path length is easily shown to be O(log⁡n)O(\log n) in expectation, and also with high probability for polynomially long update sequences.

We prove that this simple random walk paradigm extends to outerplanar graphs. Our algorithm maintains constant outdegree with O(log⁡n)O(\log n) worst-case update time, where the time bound holds in expectation, and also with high probability for polynomially long update sequences. We give a tight analysis: outdegree 4 is achievable with O(log⁡n)O(\log n)-length paths, while outdegree 3 incurs poly(n)\text{poly}(n)-length paths. We also extend the argument to K2,tK_{2,t}-minor-free graphs, for any t⩾2t \geqslant 2, with the outdegree bound depending only on t and with the same update time guarantees. The locality of the random walk rule also yields an essentially lossless implementation in dynamic distributed networks, with the same asymptotic bounds on rounds and messages.

Finally, we establish a limitation of this paradigm. For every fixed Δ⩾3\Delta \geqslant 3, there are nn-vertex oriented series-parallel graphs (which have treewidth at most two and are in particular planar), in which a uniform directed random walk from a designated vertex requires nΩΔ(1)n^{\Omega_{\Delta}(1)} steps, both in expectation and with high probability, to reach a vertex of outdegree below Δ\Delta. Thus planarity and even treewidth 2 alone do not guarantee a short hitting time for the random walk paradigm.

*Tel Aviv University, gm@mail.tau.ac.il. Gabriel Marques Domingues is supported by the Israel Science Foundation, grant No. 1948/21.

†^{\dagger}Tel Aviv University, nguyenminhhang31198@gmail.com. Minh Hang Nguyen is funded by the European Union (ERC, DynOpt, 101043159).

†^{\dagger}Tel Aviv University, shayso@tauex.tau.ac.il. Shay Solomon is funded by the European Union (ERC, DynOpt, 101043159). Views and opinions expressed are however those of the author(s) only and do not necessarily reflect those of the European Union or the European Research Council. Neither the European Union nor the granting authority can be held responsible for them. Shay Solomon is also funded by a grant from the United States-Israel Binational Science Foundation (BSF), Jerusalem, Israel, and the United States National Science Foundation (NSF).

1 Introduction

Consider an orientation of an undirected graph G=(V,E)G = (V, E) whose maximum outdegree, hereafter simply outdegree, is Δ\Delta. If Δ\Delta is small, this gives a simple and memory-efficient graph representation: an adjacency query for two vertices uu and vv can be answered in O(Δ)O(\Delta) worst-case time by scanning their two out-neighbor lists. This motivated the pioneering work of Brodal and Fagerberg [BF99]: can such a basic representation be maintained efficiently as edges are inserted and deleted?

In the resulting fully dynamic edge orientation problem, we maintain an orientation under edge updates while keeping both its outdegree and update time small. Update time may be measured amortized over the entire sequence or in the worst case per update. We also measure the recourse, the number of edge flips per update, again either amortized or in the worst case. The natural benchmark for the outdegree is the graph's arboricity α(G)\alpha(G), defined as the minimum number of forests into which its edges can be partitioned. By the Nash–Williams theorem [NW64], α(G)=max⁡U⊆V,∣U∣≥2⌈∣E(G[U])∣∣U∣−1⌉\alpha(G) = \max_{U \subseteq V, |U| \geq 2} \left\lceil \frac{|E(G[U])|}{|U|-1} \right\rceil. Thus arboricity measures the graph's uniform sparsity. Forests, outerplanar graphs, and planar graphs have arboricity at most 1, 2, and 3, respectively, while every family excluding a fixed minor has bounded arboricity. Every graph admits an orientation of outdegree at most α(G)\alpha(G), whereas no orientation can have outdegree below α(G)−1\alpha(G) - 1. Thus, up to one unit, arboricity determines the smallest outdegree one can hope to maintain. Throughout, α\alpha denotes a fixed upper bound on the arboricity over the entire update sequence.

The algorithm of Brodal and Fagerberg [BF99], hereafter the BF algorithm, maintains outdegree O(α)O(\alpha) with O(log⁡n)O(\log n) amortized update time. Its update time is linear in the number of flips, so it has O(log⁡n)O(\log n) amortized recourse. The algorithm itself is very simple. Whenever a vertex exceeds an outdegree threshold Δ=O(α)\Delta = O(\alpha), the algorithm resets it by flipping all its outgoing edges. Any vertex whose outdegree now exceeds Δ\Delta is placed in a global queue and reset in turn.

It was shown in [Kow07], and later in [HTZ14], that the BF algorithm yields a general tradeoff between outdegree and amortized update time. For constant arboricity, it provides outdegree O(Δ)O(\Delta) with amortized update time O(log⁡n/Δ)O(\log n/\Delta). Whether this tradeoff can be improved at any point of the tradeoff curve has remained an outstanding open question since [BF99], even for forests.

1.1 Worst-case update time. The BF tradeoff gives worst-case adjacency-query time, but only amortized update time: a single update may trigger a long cascade of resets. BF explicitly asked whether comparable bounds can be obtained with worst-case update time [BF99].

A positive resolution would have implications well beyond adjacency queries: dynamic low-outdegree orientations are a basic primitive for dynamic distance oracles [KK03], k-clique counting [CN85, Epp94, DLSY20], maximal matching [NS13, HTZ14, KKPS14, CCH +^{+}24], maximal independent set [OSSW18], and graph coloring [SW18, HNW20, CR22, CNR23], to name a few notable examples; see Section 1.4 for further related work. Since constant-arboricity graph families are the focus of this paper, we next state the central question in that regime.

Question 1.1. Can one maintain constant outdegree in fully dynamic graphs of constant arboricity using O(log⁡n)O(\log n) worst-case update time?

If the entire update sequence is known in advance, often referred to as the offline setting, then the analogous worst-case recourse question is already settled. Brodal and Fagerberg [BF99] showed that, for every update sequence of arboricity at most α\alpha and every Δ>α\Delta > \alpha, there exists a sequence of Δ\Delta-orientations in which each update flips at most ⌈log⁡Δ/αn⌉\lceil \log_{\Delta/\alpha} n \rceil edges. Thus, for constant α\alpha and Δ=α+1\Delta = \alpha + 1, O(log⁡n)O(\log n) worst-case recourse is always achievable offline. This existential guarantee, however, does not yield a fast update procedure without knowledge of future updates.

The first nontrivial worst-case update time bounds were obtained in [KKPS14]. For constant arboricity, their algorithm uses a simple local invariant to maintain outdegree O(log⁡n)O(\log n) with O(log⁡n)O(\log n) worst-case update time. Thus it matches the BF algorithm's logarithmic time bound, but loses a logarithmic factor in the outdegree.

A simple greedy algorithm [BB20] refined the tradeoff: for constant arboricity, it achieves outdegree O(log⁡n)O(\log n) with O(log⁡n)O(\sqrt{\log n}) worst-case update time. Subsequent work pushed the outdegree much closer to optimal. Outdegree (1+ϵ)α+2(1+\epsilon)\alpha+2 with O(ϵ−6α2log⁡3n)O(\epsilon^{-6}\alpha^2\log^3 n) worst-case update time was achieved in [CR22], and the dependence on α\alpha in the update time was later improved to O(ϵ−6log⁡3nlog⁡α)O(\epsilon^{-6}\log^3 n\log\alpha) in [CCH +^{+}24]. For constant α\alpha and fixed ϵ>0\epsilon > 0, both bounds are O(log⁡3n)O(\log^3 n). Thus, for constant outdegree, the best known worst-case update time is O(log⁡3n)O(\log^3 n), and Question 1.1 remains open.

There is, however, one clean exception beyond the trivial case of bounded-degree graphs: forests. A simple folklore random walk algorithm maintains outdegree 2 with O(log⁡n)O(\log n) expected update time, and with O(log⁡n)O(\log n) update time throughout every polynomial-length update sequence w.h.p. This suggests a particularly simple approach to Question 1.1, and is the starting point of our work.

1.2 The random walk paradigm in forests. The simple folklore algorithm maintains out-degree 2 as follows. Orient each inserted edge arbitrarily. If the insertion raises its tail's outdegree to 3, start a uniform directed random walk there, stop at the first vertex of outdegree ⩽1\leqslant 1, and flip the resulting directed path. The starting vertex loses one outgoing edge, the terminal vertex gains one, and every internal outdegree is unchanged, restoring outdegree 2. Deletions require no repair.

The analysis is immediate since a forest contains no cycle, so the walk is a simple path. Until it stops, every visited vertex has at least two outgoing edges; hence any fixed k-edge path is followed with probability at most 2−k2^{-k}. Since there is at most one simple path from the starting vertex to each possible endpoint, if τ\tau denotes the walk length then Pr⁡(τ>k)⩽min⁡{1,n2−k}\Pr(\tau > k) \leqslant \min\{1, n2^{-k}\}, and hence E[τ]=O(log⁡n)\mathbb{E}[\tau] = O(\log n). Traversing and flipping the path take O(τ+1)O(\tau + 1) time and exactly τ\tau flips, so every update has O(log⁡n)O(\log n) expected update time and recourse. Importantly, this bound holds even after conditioning on the complete preceding history, and hence against an adaptive adversary. A union bound then gives O(log⁡n)O(\log n) update time and recourse for every update simultaneously throughout any polynomial-length execution w.h.p. We stress that there always (with probability 1) exists an O(log⁡n)O(\log n)-length path on a forest that reaches a vertex of outdegree less than 2. The randomization is only needed to efficiently find such a path, which is done via a random walk.

Several known algorithms are themselves notably simple [BF99, KKPS14, BB20]. The main advantage of the random walk paradigm over previous algorithms is that it is essentially structure-free: it only samples outgoing edges, records the resulting path, and flips it, using no global data structures or auxiliary invariants. This feature of the algorithm yields an essentially lossless implementation in the dynamic distributed setting; see Corollary 1.1.

Random walks were used in incremental forests to obtain outdegree 3 with O(log⁡log⁡n)O(\log \log n) flips per insertion and O(log⁡nlog⁡log⁡n)O(\log n \log \log n) worst-case insertion time w.h.p. [BKK +^{+}21]. Their Dancing-Walk algorithm is more involved and exploits the absence of deletions. Although their paper does not state the adversary model explicitly, their analysis fixes the insertion sequence and hence establishes the guarantee against an oblivious adversary. By contrast, the conditional tail bound above applies against an adaptive adversary that observes the current orientation and all past random choices; our O(log⁡n)O(\log n) bounds hold simultaneously over any polynomial-length execution w.h.p.

We ask if this simple approach already resolves Question 1.1 for a basic graph family beyond forests. Outerplanar graphs are a natural first test: they are the graphs with no K4K_{4} or K2,3K_{2,3} minor, equivalently, the graphs admitting a planar drawing in which every vertex lies on the outer face. They have arboricity at most 2, but unlike forests they may contain many cycles.

Question 1.2. Can the uniform random walk paradigm maintain constant outdegree in fully dynamic outerplanar graphs, against an adaptive adversary, with O(log⁡n)O(\log n) expected update time per update and O(log⁡n)O(\log n) update time throughout every polynomial-length update sequence w.h.p.?

1.3 Our contributions. We answer Question 1.2 affirmatively. Fix a threshold Δ\Delta. Orient each inserted edge arbitrarily; if its tail now has outdegree Δ+1\Delta + 1, start a uniform directed random walk there and stop at the first vertex of outdegree below Δ\Delta. In contrast to forests, now the walk may repeat vertices, so we erase its closed detours and flip the resulting simple directed path. As in a forest, this decreases the outdegree of the starting vertex by one, increases that of the final vertex by one, and leaves all internal outdegrees unchanged. Deletions require no repair.

The algorithm needs no auxiliary structure beyond the outgoing lists. For constant Δ\Delta, each step consists only of sampling from a constant-size list, and the total work is linear in the length of the sampled walk, repetitions included. All the difficulty is pushed into one combinatorial question: How long can the walk remain among vertices of outdegree at least Δ\Delta?

Our main result provides a tight answer to this question for outerplanar graphs, thus we resolve Question 1.1 for outerplanar graphs, albeit with randomized update times rather than deterministic guarantees. We note that, analogously to forests, there always (with probability 1) exists an O(log⁡n)O(\log n)-length path that reaches a low-outdegree vertex.

Theorem 1.1 (Dynamic outerplanar orientation). Starting from the empty graph, the algorithm above maintains maximum outdegree 4 under fully dynamic updates that preserve outerplanarity. Against an adaptive adversary, conditioned on the complete preceding history, every update has expected update time and expected recourse O(log⁡n)O(\log n). Moreover, throughout every polynomial-length execution, all update times and recourse bounds are O(log⁡n)O(\log n) simultaneously w.h.p.

The hitting-time statement underlying Theorem 1.1 is itself tight:

Theorem 1.2 (Tight outerplanar threshold). In every orientation of every n-vertex outerplanar graph, from every starting vertex, the uniform directed random walk reaches a vertex of outdegree below 4 after O(log⁡n)O(\log n) steps in expectation and after O(log⁡(n/δ))O(\log(n/\delta)) steps with probability at least 1−δ1-\delta.

Conversely, for threshold 3, there are n-vertex outerplanar orientations and starting vertices for which the walk requires nΩ(1)n^{\Omega(1)} steps in expectation and exceeds nΩ(1)n^{\Omega(1)} steps with high probability. For threshold 2, the hitting time can be 2Ω(n)2^{\Omega(n)} in expectation and can exceed 2Ω(n)2^{\Omega(n)} with probability 1−2−Ω(n)1 - 2^{-\Omega(n)}. Both lower bound behaviors can arise immediately after a single insertion.

Interestingly, the tight outdegree 4 threshold for this paradigm is also twice the largest possible arboricity of an outerplanar graph, paralleling outdegree 2 for forests. It also improves the outdegree bound of (1+ϵ)α+2(1 + \epsilon)\alpha + 2 of the slower algorithms in [CR22, CCH +^{+}24] (with worst-case update time O(ϵ−6log⁡3n)O(\epsilon^{-6}\log^3 n) for constant arboricity graphs). Indeed, for outerplanar graphs, (1+ϵ)α+2(1 + \epsilon)\alpha + 2 gives outdegree 5 rather than 4; however, our algorithm is randomized and not deterministic as [CR22, CCH +^{+}24], and it does not extend to arbitrary graphs of bounded arboricity.

Our upper bound analysis has two layers, both concerning the same repair rule. Layer I uses a simple path-counting argument to establish the desired logarithmic bounds with threshold 48, cleanly exposing why the walk is short. Layer II uses a more complex analysis to lower the threshold to the tight value 4. Thus only the analysis changes; the algorithm is identical in the two layers.

Beyond outerplanar graphs. Since every outerplanar graph is K2,3K_{2,3}-minor-free, the family of K2,3K_{2,3}-minor-free graphs is a strict superclass of the outerplanar graphs: the additional K4K_{4}-minor exclusion that characterizes outerplanarity is not needed for the Layer-I analysis (for outdegree 48). Indeed, Layer I of our upper-bound analysis uses outerplanarity only through a bound on the number of simple paths of a given length between two fixed vertices. By extending this bound to K2,tK_{2,t}-minor-free graphs, we obtain the following result.

Theorem 1.3 ( K2,tK_{2,t}-minor-free graphs). For every fixed t⩾2t \geqslant 2, fully dynamic K2,tK_{2,t}-minor-free graphs can be maintained with maximum outdegree 48(t−1)48(t-1). Against an adaptive adversary, conditioned on the complete preceding history, every update has expected update time and expected recourse O(log⁡n)O(\log n). Moreover, throughout every polynomial-length execution, all update times and recourse bounds are O(log⁡n)O(\log n) simultaneously w.h.p.

Remark. We did not try to optimize the dependence on t in the outdegree.

Dynamic distributed networks. The random walk repair procedure also admits an essentially lossless implementation in the local-wakeup CONGEST model [PPS16, CHK16, KS18, AOSS18, ALS22]. Here the communication graph starts with no edges and undergoes one edge update per step; only the two updated endpoints initially wake up, and they must restore the orientation using few synchronous rounds and few O(log⁡n)O(\log n)-bit messages. We give the formal model in Section 5.

The entire repair procedure is carried by one token. It follows the sampled walk, maintains its loop-erased path using local marks and predecessor pointers, and finally backtracks along this path while flipping its edges. A sampled walk of length L, including repetitions, therefore costs O(L)O(L) rounds and O(L)O(L) messages, without any global coordination.

Corollary 1.1 (Dynamic distributed orientation). Under fully dynamic edge updates that preserve outerplanarity, maximum outdegree 4 can be maintained in the local-wakeup CONGEST model so that, for every update and conditioned on the complete preceding history, the expected round and message complexities are O(log⁡n)O(\log n). Throughout every polynomial-length execution, all updates use O(log⁡n)O(\log n) rounds and messages simultaneously w.h.p. For every fixed t⩾2t \geqslant 2, the analogous result holds under updates that preserve K2,tK_{2,t}-minor-freeness, with maximum outdegree 48(t−1)48(t-1). These guarantees hold against an adaptive adversary.

This direct implementation is significant because many known centralized orientation algorithms coordinate nonlocal repairs through global data structures (e.g., a queue in the BF algorithm), so it is problematic to implement them efficiently in distributed networks. The relevant distributed orientation results [PPS16, KS18] focus primarily on amortized guarantees and provide no comparable non-amortized message bounds. Refer to Section 5 for more details.

Limitations. We show that the exponential hitting time of Theorem 1.2 for the threshold-2 walk stems from a more basic obstruction: even complete knowledge incurs Ω(n)\Omega(n) amortized recourse.

Theorem 1.4 (Outdegree 2 requires Ω(n)\Omega(n) recourse). For sufficiently large n, there is a sequence of Θ(n)\Theta(n) updates, starting with no edges and preserving outerplanarity, such that every sequence of orientations of outdegree 2 incurs Ω(n2)\Omega(n^2) flips. Thus, even offline, the amortized recourse is Ω(n)\Omega(n).

This complements the lower bound of [CHRT22], which shows that maintaining a 3-orientation in planar graphs requires Ω(n)\Omega(n) amortized flips even offline [CHRT22]; Brodal and Fagerberg had earlier proved an analogous obstruction without the planarity restriction [BF99]. Our construction lowers the outdegree to 2 while restricting the graphs further to outerplanar graphs.

Next, we show that the random walk paradigm does not extend well to all series-parallel graphs. These graphs are planar and have treewidth at most 2, but they can contain K2,mK_{2,m} as a minor for arbitrarily large m, creating many competing walks between the same two terminals.

Theorem 1.5 (Failure in series-parallel graphs). For every fixed Δ⩾3\Delta \geqslant 3, there are oriented n-vertex series-parallel graphs and starting vertices from which the uniform directed walk needs nΩΔ(1)n^{\Omega_{\Delta}(1)} steps, both in expectation and with high probability, to reach outdegree below Δ\Delta.

1.4 Further related work in a nutshell. Low-outdegree orientations and closely related structures, such as forest, pseudoforest, and core decompositions, have been studied extensively in the dynamic setting, as well as in various other settings and computational models, including the static sequential setting, the LOCAL and CONGEST models of distributed computing, the parallel and parallel batch-dynamic models; see [MB83, CN85, Kow06, BE08, PPS16, GS17, BHNT15, KS18, LSZ24, LSY +^{+}22, DLR +^{+}22, GK25, BBD +^{+}26], and the references therein.

Given the breadth of models in which edge orientation has been studied, the local, nearly structure-free nature of the random walk update rule is particularly appealing, as it seems amenable to extensions to additional computational models beyond the dynamic settings studied in this work.

Organization. Section 2 presents the random walk repair rule and proves the required bounds first at threshold 48. Section 3 sharpens the analysis to the tight threshold 4, completing the proof of Theorem 1.1. Section 4 extends Layer I to K2,tK_{2,t}-minor-free graphs, and Section 5 gives the dynamic distributed implementation. Sections 6.1 and 6.2 establish the threshold-3 and threshold-2 walk lower bounds and the series-parallel obstruction, while Section 6.3 proves the offline recourse lower bound for outdegree 2. We conclude with open questions in Section 7.

References (36)