Manuscript Offprint
arXiv:2610.17712Fully Dynamic Random-Walk Quantities on Undirected Expanders and -Uniform Directed Graphs
Fully Dynamic Random-Walk Quantities on Undirected Expanders and -Uniform Directed Graphs
Richard Peng
Carnegie Mellon University
Junzhao Yang
Carnegie Mellon University
Sushant Sachdeva
University of Toronto
Yibin Zhao
University of Toronto
Abstract
We study fully dynamic data structures for random-walk quantities on undirected expanders and fast-mixing directed graphs. For an unweighted graph whose normalized Laplacian has spectral gap at least , we give a effective-resistance data structure with expected update time and expected query time.
For directed graphs, somewhat surprisingly, the OMv conjecture precludes a fast data structure based on rapid mixing conditions alone. To address this, we introduce the notion of -uniform directed graphs, which requires the stationary distribution to -approximate the uniform distribution, and show that in this setting, random walk based data structures with update/query times are possible.
One significant barrier facing the expander paradigm of graph algorithm design is that the algorithm, or data structure, must work when the underlying graph is an expander. While this is often the case for static problems, and provided much of the motivation of these expander-based approaches, the status of such primitives for dynamic graph problems, especially fully dynamic graphs, is surprisingly unexplored. In particular, it is open whether one can maintain, in subpolynomial time, -approximate s-t min-cut or shortest path in fully dynamic undirected graphs that always remain expanders [GRST21, HLS24].
In this paper we study data structures for maintaining random walk related quantities on fully dynamic expanders. We give positive results on undirected graphs, as well as show the limitations of these methods on directed graphs. We build upon the static data structure by Li and Sachdeva [LS23], which showed that short random walks suffice to answer approximate effective resistance queries in essentially constant time. By maintaining dynamic versions of these walks on an unweighted spectral expander, we show that a data structure supporting approximate all-pairs effective resistance queries can be maintained in only update time, for a constant c. This gives a substantial improvement over what is known for general dynamic graphs, for which the best runtime is about .
The random walk interpretation of commute time and the positive result for undirected expanders naturally suggest that similarly efficient dynamic data structures might exist for directed graphs whose random walks also mix rapidly. Here however an obstacle appears: rapid mixing alone places little restriction on the stationary distribution of a directed random walk, which may be highly non-uniform. By leveraging this fact, we give a conditional lower bound based on the OMv conjecture [HKNS15] that no data structure can simultaneously have update and query (3/2-approx) time , even when the graph has mixing time , and all outdegrees are constant.
This hardness result in turn suggests a natural additional condition for rapidly mixing directed graphs: the stationary distribution is also close to uniform. We incorporate this by defining -uniform graphs in Definition 2.4, and show that this setting enables the rapid query of stationary distributions. This in turn allows random walk based approaches on the Eulerian graph obtained by rescaling, and thus efficient commute time queries. We believe this definition that combines both rapid mixing and uniformity of the stationary distribution provides a new setting for studying both dynamic as well as static graph algorithms.
1.1 Overview
For undirected expanders, our efficient dynamic data structure for computing effective resistance, and equivalently commute time, stems from the observation in the static graph case by Li and Sachdeva [LS23] that the hitting statistics computed by a collection of short, polylogarithmic-length random walks starting from each vertex suffice to generate a data structure for answering high-accuracy effective-resistance queries on expanders in time.
The core of our efficient dynamic data structure is a fully dynamic algorithm for maintaining such uniform short random walks under edge insertions and deletions in unweighted undirected graphs (not necessarily expanders). In particular, we observe that only roughly a fraction of the walks incident to an affected vertex need to be resampled. Crucially, we also discover that the congestion of each vertex (i.e., the number of visits to a vertex by all random walks) scales at most linearly with its degree . Given that the total number of random-walk steps is , we can guarantee an update time of only .
For directed graphs, we discover that the fast-mixing property alone cannot give a similarly efficient algorithm. Many Markov-chain quantities on directed graphs (e.g., hitting time and commute time) require high-accuracy estimates of the stationary distribution, which is a computationally challenging task for dynamic directed graphs, as we establish through a conditional hardness result based on OMv.
For the hardness result, we develop a reduction from an instance of matrix-vector multiplication of dimension to a fast-mixing directed graph of size . The main component of the graph is a standard construction that encodes each entry of the vector . In particular, within this component, the entry if and only if there is a directed path from a unique source to a vertex corresponding to the th entry. We show that the existence or absence of such a path is sufficient to create a difference in the stationary distribution at vertex , allowing us to distinguish the value of . The main component of the graph consists of two connection layers, one for and one for , where each edge in the layers maps one-to-one to an entry of or . Changing (or between instances) corresponds directly to changing these connections and, thus, the existence of paths from to the vertices .
To ensure that the graph is strongly connected and -mixing, we also include two auxiliary components. The first component gives compact forward connections from s to all vertices in the main component, ensuring reachability. However, this gives a connection from s to an that previously did not have a path. To ensure these connections do not interfere with the main paths, we give them a long chain of connections at the beginning, with many reset edges back to s distributed along it, so that all of these connections are assigned extremely low probabilities.
Finally, all other vertices also have such reset edges back to s, so that at each non-source vertex, the probability of returning to s is at least 1/4. This creates an extremely skewed stationary distribution in which s receives a large mass from everywhere else. Such a construction also gives fast mixing of the graph, which can be proved by a standard random walk coupling argument: two walks starting from different vertices can be coupled to meet at s with probability at least 1/4 at each step. Consequently, our graph is always -mixing for any possible M and v.
Each update of incurs only updates and stationary entry queries on the graph, for a total of updates and queries throughout the instance, on a graph of size . This gives a roughly square-root update- and query-time lower bound for this problem.
Finally, for our -uniform directed graphs, we use the uniformity of the stationary distributions to avoid the problem of such skewed resets. Efficient dynamic algorithms are once again possible for such graphs. For both stationary distribution and commute time approximation, we give observations analogous to those for undirected expanders: (1) there are data structures for efficiently querying these quantities that can be computed from short random walks; and (2) such short random walks incur only congestion at each vertex. Crucially, (2) is only true from the uniformity property; -mixing alone cannot guarantee it. These observations allow us to reuse the same dynamic short random walk algorithm from the undirected expander case with minimal changes and obtain efficient dynamic algorithms.
2 Preliminaries
Let be an unweighted, undirected (multi)graph with adjacency matrix and degree matrix . Its Laplacian matrix is and the normalized Laplacian is .
For a directed (multi)graph , we again use to denote its adjacency matrix while is the diagonal matrix of out-degrees. The lazy random walk transition matrix is defined by .
A connected undirected graph is a -spectral expander if its spectral gap is at least .
Definition 2.1 (Spectral expander). For , we call a -spectral expander if .
Expanders are naturally fast mixing.
Proposition 2.2 (Expanders are fast mixing). A -spectral expander is -mixing.
Proof. implies that each nontrivial eigenvalue of has absolute value at most . The convergence is with respect to the inverse degree. Since the maximum degree in an unweighted graph is at most , after a scaling, it suffices to take to make the entry-wise stationary approximation at most as required.
We formally define fast-mixing directed graphs.
Definition 2.3 ( -mixing). For , a directed graph is -mixing if it is strongly connected and, for the stationary distribution of ,
Common definitions of -mixing are equivalent up to logarithmic factors in the mixing time. We choose the exponent 10 for convenience.
For -uniform graphs, we additionally require the stationary distribution to be close to uniform.
Definition 2.4 ( -uniform). A -mixing directed graph is -uniform if its stationary distribution also satisfies
We define hitting vectors conceptually by for a vertex , which diverges. For distinct , we denote the difference of their hitting vectors by
which is typically well-defined.
We also define the truncated variants of these hitting vectors at length by , . Similarly, the exact length variants are , .
We denote by the hitting time of a random walk from to , i.e. the expected number of steps until a (non-lazy) random walk starting from first visits . The commute time is the expected time that a random walk starting from one of the vertices visits the other vertex and returns. In both undirected and directed cases, .
On undirected graphs, the commute time between a pair of vertices is equivalent to the effective resistance between them.
Fact 2.5 (Commute time and effective resistance). Let be a connected unweighted undirected graph with . Then, the commute time satisfies .
The hitting and commute times of random walks can be quantified using the hitting vectors and the stationary distribution of the random walks.
Fact 2.6.
For our conditional hardness result, we invoke the OMv conjecture. This is a standard assumption for fine-grained complexity questions on dynamic data structures.
Conjecture 2.7 (OMv conjecture [HKNS15]). For every constant , no randomized algorithm solves Online Boolean Matrix-Vector Multiplication (OMv) for a boolean matrix of size and vectors of size in total time with probability at least 2/3.
3 Fully Dynamic Effective Resistances on Expanders
Li and Sachdeva [LS23] demonstrated that for expanders, a sparse data structure can be efficiently computed from which one can query the effective resistance between any pair of vertices. Specifically, for a -spectral expander, Theorem 3.1 of [LS23] shows that it suffices to sample for each vertex random walks for each length to support a -approximate effective resistance query on a pair of vertices in expected time .
In Theorem 3.1, we show that for unweighted undirected expander, such result carries over to the dynamic setting.
Algorithm 1: Dynamic random walks
1 Procedure INITIALIZE() 2 for each vertex and each length-index pair do 3 Perform a length random walk starting from 4 Record the walk as incident to every vertex it visits and every edge it traverses only at non-lazy steps 5 Procedure INSERT() 6 for each endpoint from which can be traversed ( if directed, both endpoints if undirected) do 7 For each instance that a walk is incident with , sample this instance (walk and position) with probability 8 If a walk is sampled multiple times, keep the instance with the earliest position only for each remaining instance do 9 Take a step of edge from this position at 10 Resample the remaining lazy-walk suffix from the other vertex of 11 Update vertex and edge incidences 12 13 Procedure DELETE() 14 for each walk incident to (in either direction if undirected) do 15 Regenerate the portion of the walk from the first position where is traversed, with the first step non-lazy 16 Update vertex and edge incidences of the walk 17 Clear the incidence data structure for
Theorem 3.1 (Dynamic effective resistance in expanders). There is a data structure for a fully dynamic unweighted undirected -expander with expected time per update that supports -approximate effective resistance and commute time estimation for each pair of vertices in expected time. It succeeds with high probability and has preprocessing time and space usage of .
Our dynamic data structure is based on a fully dynamic algorithm for maintaining short random walks. For the remainder of the proof, we first show that for unweighted undirected graphs (not necessarily expanders), there is an efficient data structure for maintaining uniformly sampled short random walks starting from each vertex. We then apply this dynamic random walk data structure on expanders to prove Theorem 3.1.
3.1 Fully Dynamic Short Random Walks
We define random walks as follows: each vertex has uniform lazy random walks of length for all . We show that a uniform sample of such random walks can be maintained efficiently. Our main algorithm is presented in Algorithm 1. Note that this algorithm also applies for directed graphs.
Lemma 3.2 (Undirected fully dynamic -random walks). The data structure in Algorithm 1 maintains a set of uniform -random walks for a fully dynamic undirected graph in expected time and expected recourse per update. It has preprocessing time and space usage of .
For a vertex , its vertex congestion is defined to be the total number of times a random walk visits . Similarly, for an edge , its edge congestion is the total number of times a random walk traverses . Note that for undirected graphs, the traversal can happen in both directions.
These congestion measures on vertices and edges are crucial to the control on the update time. Intuitively, the less congestion, the fewer walks are affected by the insertion or deletion of an edge. We demonstrate below that for unweighted graphs, these measures are small.
Lemma 3.3 (Undirected vertex congestion). For -random walks on an undirected graph with vertices, in expectation, the congestion for a vertex is and for any edge is .
Proof. Let be the degree vector. Since and coordinatewise, the nonnegativity of implies that, for every ,
Therefore, the expected number of visits to a vertex v is
At any occurrence of before the last step, a lazy walk traverses any fixed incident edge with probability . Hence, for an undirected edge , summing over its two traversal directions gives expected edge congestion at most
We are ready to prove Lemma 3.2.
Proof of Lemma 3.2. For the data structure that maintains incident walks for vertices and edges, we use dynamic arrays and hash tables supporting entry insertion and deletion in expected time. It also supports, by a fast sampling algorithm (e.g. [Knu97, Dev06, BP17]), sampling each entry of the incident set independently with a fixed probability in time proportional to the sampled subset, which is in expectation for the incident set of size .
For initialization, the total number of sampled transitions is . Sampling a transition and recording its incidences take expected time, so storing all walks takes time and space. Reading and storing the initial graph takes an additional time and space.
Assume inductively that all maintained walks are mutually independent and distributed as fresh lazy random walks in the current graph. The next update is independent of the data structure's random choices.
Edge insertions. Let be inserted, and fix an endpoint . Let be its degree before the insertion. Conditional on a transition from being non-lazy, each old incident edge has probability . Our algorithm keeps the old edge with probability and otherwise uses . Every old edge and the new edge then have probability as required, while leaving the laziness coin unchanged.
We first sample all incidences to be repaired from the old walks before resampling any suffix. If a walk contains several selected incidences, its earliest one is the first position where the old and new walks disagree and it suffices to only resample after taking a step with edge e. By the vertex congestion bound in Lemma 3.3, the expected number of resamples is then at most
Resampling a suffix and updating its incidences take time, giving expected recourse and expected update time.
Edge deletions. Let be deleted. A walk is modified if and only if it traverses e, and only its earliest traversal needs to be retained. Suppose this traversal leaves a vertex a of degree before deletion. The first resampling step is non-lazy and chooses a remaining edge uniformly since the previous laziness coin is still valid. For every remaining edge, the resulting conditional probability is
Thus, keeping the prefix and independently resampling after the replacement again gives fresh, mutually independent walks in the updated graph.
By the edge congestion bound in Lemma 3.3 above, the expected number of resamples is . The suffix repair cost gives expected recourse and expected update time.
3.2 Proof of Theorem 3.1
The effective resistance between a pair of vertices can be computed exactly through the difference hitting vector .
Proposition 3.4.
Proof. Set . Since , converges and . Moreover,
Thus is a solution to . Every such solution differs from by a multiple of 1, which is orthogonal to . Therefore,
For a sampled set of random walks, we define to be the estimator of and set
where is the stationary vector.
Given as query a pair of vertices the algorithm of [LS23] simply returns
Since the stationary terms cancel in this expression, our implementation stores only the sparse hitting vectors and uses the stationary term only in the approximation analysis. The overall static construction is stated in Algorithm 2.
Algorithm 2: Static all-pairs effective resistances
1 Procedure INITIALIZE() 2 for do 3 4 for do 5 perform a length- random walk starting from , ending at vertex 6
Proof of Theorem 3.1. By [LS23], it suffices to choose and . By Lemma 3.2, the random walks can be initialized in time and space
For each vertex , store the sparse hitting vector . Whenever a maintained walk changes, subtract from its old terminating location and add to its new hitting location. Delete entries when they become zero. By the recourse bound in Lemma 3.2, this costs expected time per update and is dominated by the random-walk update time
The maintained walks remain uniform on the current graph. Thus, the static guarantee of [LS23] gives the claimed approximation at any fixed time with very high probability.
Each hitting vector is stored in a hash table. A query reads four coordinates in these vectors and two current degrees and therefore takes expected time. For commute time queries, return times the effective resistance estimate, where is maintained in time per update. The sampled hitting vectors use space, which is dominated by the space for the walks and their incidences.
4 Conditional Hardness for -Mixing Graphs
In this section, we state and formally prove our hardness result for approximate dynamic stationary distribution data structure under the assumption of the OMv conjecture.
Theorem 4.1 (Hardness for fast mixing directed graphs). Assume the OMv conjecture. For every constant , there is no randomized fully-dynamic data structure with polynomial preprocessing time that maintains an -vertex unweighted directed -mixing multigraph of maximum out-degree four, answers entry-wise approximate stationary queries, and has both amortized update time and query time with probability at least .
To prove the theorem above, we give a simple reduction from boolean matrix vector products to a fast mixing directed graph of roughly the same size. An entry of the product can be determined with good probability of success by checking if the stationary distribution of the corresponding vertex crosses a certain threshold.
reset edges to s: parallel edges at each (only one shown)

Figure 1: Schematic of the product graph . Triangles in the main component denote complete binary trees of the indicated depth. Blue edges are the vector edges , present iff ; they are the only edges updated by the dynamic algorithm. Red edges are the matrix edges , present iff . A path through a vector edge exists iff . The auxiliary gadget at the bottom makes the graph strongly connected: reaches through a long path, and every product vertex has a copy at a leaf of the tree rooted at , with an edge from each copy to its original vertex. Each vertex other than has reset edges back to , signified by the grey dashed arc. These edges give the rapid mixing property.
4.1 From Matrix Vector Product to Fast Mixing Graphs
Let be a power of two. For and , we define the directed multigraph as follows (see Figure 1 for a schematic).
For the main component of the graph, we define for each a path for the product . Its vertex set consists of a source , a sink , and a collection of product vertices:
• column vertices for , and row vertices for ;
• matrix vertices for ;
- the internal vertices of four families of complete binary trees, all of depth exactly : an out-directed tree rooted at with leaves ; an in-directed tree rooted at with leaves ; for each , an out-directed tree rooted at with leaves ; and for each , an in-directed tree rooted at with leaves .
The graph has the following directed forward edge connections:
• the vector edge for each with ;
• the matrix edge for each with .
The vector edges within are the only edges being updated after receiving a new query vector .
To ensure all vertices are reachable from s, the following additional forward connection vertices and edges are included:
• a second source , connected from s by a path of length ;
- an out-directed binary tree with leaves at depth or from to a leaf set consisting of exactly one new copy of each vertex in .
• each copied leaf has a directed edge to its corresponding vertex in .
Finally, for strong-connectivity and fast-mixing, we include the following backward reset edges directed to the source s:
• for each vertex , , if its forward out-degree is , include reset edges ;
• a single edge .
For any M, v, the graph has size roughly equal to the size of the matrix vector product instance and has maximum out-degree of at most 4.
Lemma 4.2. For any and , the graph has vertices with out-degree at most 4 for all vertices.
Proof. The source and sink, and the vertices in , contain vertices. A full binary tree rooted at with one new leaf for each vertex of has vertices. The path from to contains vertices. The total is therefore .
Every vertex has at most two non-reset outgoing edges. The only exception is that s has three. Reset edges at most double the out-degree of vertices with positive forward out-degree, and vertices with forward out-degree zero have one reset edge. The maximum out-degree is then 4.
The reset edges have two specific consequences. First, the reset edges force the graph to have a rather skewed stationary distribution. For the source vertex s, the stationary mass is at least ; we prove this formally in Lemma 4.4. Secondly, since a reset happens with probability at least , the random walk mixes very rapidly. Intuitively, for two starting points, a single random walk step would funnel them to the same location with constant probability. Therefore, the remaining difference in the stationary mass between the two starting distributions decreases by a constant factor after each step. We prove this observation formally in Lemma 4.3.
Lemma 4.3. The graph is -mixing.
Proof. The forward edges give connection from s to every other vertex in the graph, while the reset edges give direct connection from those vertices back to s. Therefore, the graph is strongly connected.
We show lazy random walks on mix quickly by showing that each step of the walk makes constant progress towards the stationary distribution using a standard random walk coupling argument. Since for each vertex other than s, at least half of the edges are reset edges, a lazy walk step visits s with probability at least . Also, a walk currently at s stays there with probability 1/2 by the lazy step. Hence the one-step random walk distributions from any two vertices have common mass at least at s.
We now couple a walk starting from an arbitrary vertex with a walk starting from each vertex with the stationary probability. At each step, conditional on not having coupled earlier, the probability that they have not coupled is at most . For steps, the coupling gives . Taking makes the error at most for every entry. Since , this gives -mixing, proving the lemma.
Within the main graph, a product entry is true if and only if there exists a path from the source to the corresponding vertex of entry . Due to the long path between and , where each step resets with probability at least , a random walk is much more likely to pick the main path from to as opposed to going through the path using the binary tree rooted at . Consequently, a higher stationary mass would be placed at compared to the case where no main path from to exists. A -approximation to the stationary probability would then suffice for distinguishing the value of . This is formalized in the following Lemma 4.4.
Lemma 4.4. Let be the stationary distribution of the graph . It satisfies that for any
Proof. Since the stationary distribution is not affected by the laziness of the random walks, we assume w.l.o.g. within this proof that the random walks are non-lazy.
Suppose and that there exists an index with witnessing this. Then, there is a main path from to through , , and , and the binary tree paths connecting them. The total length of the binary tree edges is . After the first step from , the path has out-tree edges with sampling probability each, and in-tree edges and two extra edges corresponding to matrix and vector bits with sampling probability each. Starting from , the chance of following this main path before a reset is then at least
where is the probability of taking the first edge of this path from . As random walks return to with probability at least , we can crudely bound , which gives .
Now suppose . A path from can reach only through the added forward tree. The chance of reaching from is . Given that the walk is at , the probability of reaching the leaf assigned to any fixed vertex of is at most . The in-tree for row contributes , one from each level. The matrix vertices for row contribute at most , and their column trees contribute at most . All other vertices contribute zero in the zero case. As has no self-loop, the expected return time to is at least 2. Thus, . We then have
where the last inequality holds for .
4.2 Proof of Theorem 4.1
Similar to OMv reductions standard in the literature [HKNS15, HPS22], we simulate an OMv instance by partitioning it into evenly sized blocks and applying OR over all products on the blocks. This construction allows us to bypass any large polynomial preprocessing time to argue on the update and query time alone.
Proof of Theorem 4.1. We assume w.l.o.g. that the dimension of the OMv instance is a power-of-two, padding the matrix and vectors with zeros if necessary. We take to be a power of two (rounding down if necessary) and set . We partition the matrix into blocks of size . To ensure the probability of success, for each block, we keep copies from which we take the median. We assume also there is a constant such that a dynamic -approximate stationary data structure preprocesses in time .
In every copy for a block, we use at most updates for each sub-vector of , and query its row vertices. We take the median estimate for each row vertex and test it against the threshold . By Lemma 4.4 and -approximate, this recovers , since it satisfies
To get the final product, we take an OR over all blocks for each row i.
There are copies of the dynamic approximate stationary data structures in total. With the parameter choice above, their total preprocessing time is . For , this is , which is strictly less than . Constructing the graphs themselves takes only additional time.
For each of the online vectors, every copy receives at most updates and queries. Hence the total numbers of updates and queries are both . Computing all medians takes time, and the entry-wise ORs take total time, which are both subsumed by the total number of updates and queries.
By Lemmas 4.2 and 4.3, each maintained graph has vertices, maximum out-degree four, and mixing time always.
By our choice of , a Chernoff bound and a union bound over at most medians give an overall success probability of at least as required.
We assume for contradiction that the update and query bounds are at most
It suffices to consider any . Consequently, the total online time is
Taking, for simplicity, , the overall processing and online computation take time. This contradicts the OMv conjecture (Conjecture 2.7) and proves the theorem.
5 Fully Dynamic Algorithms for -Uniform Graphs
Under the additional requirement that an unweighted directed -mixing graph has almost uniform distribution, the hard instance for designing efficient dynamic data structures can be avoided. We show that for such -uniform graphs, one can design efficient algorithms for both computing entry-wise approximate stationary distribution (see Theorem 5.1) and all-pairs commute time (see Theorem 5.2), again, using dynamic short random walks.
Theorem 5.1 (Dynamic stationary approximation for -uniform graphs). There is a data structure for a fully dynamic unweighted directed -uniform graph with expected time per update that supports a -approximate stationary entry query in expected time. It succeeds with high probability and has preprocessing time and space complexity of in expectation.
Theorem 5.2 (Dynamic commute time for -uniform graphs). For , there is a data structure for a fully dynamic unweighted directed -uniform graph G with expected time per update that supports -approximate commute time queries in expected time. It succeeds with high probability over an oblivious polynomial length sequence and has preprocessing time and space complexity of .
5.1 Dynamic Random Walks on -Uniform Graphs
On -uniform directed graphs, we show that Algorithm 1 suffices for maintaining -random walks, analogous to Lemma 3.2.
Lemma 5.3 (Directed -uniform fully dynamic -random walks). The data structure in Algorithm 1 maintains a set of uniform -random walks for a fully dynamic unweighted directed -uniform graph in expected time and expected recourse per update. It has preprocessing time and space usage of .
The crux of the proof of Lemma 5.3 is then the following congestion guarantee, specialized for -uniform graphs.
Lemma 5.4 (Congestion bound for -uniform graphs). For -random walks on a -uniform graph with vertices, in expectation the congestion is for any vertex and edge.
Proof. For every vertex and , the -uniformity of the stationary distribution gives
Then, for a fixed walk length , the expected number of visits to at each step, summed over all starting vertices and all copies, is then at most . There are total walk steps over all lengths, which proves the vertex bound. A walk can cross an edge only after visiting its tail, so the same bound holds for every edge.
Proof sketch of Lemma 5.3. The correctness of the algorithm follows almost identically to that of Lemma 3.2.
It remains only to adjust the running time and space bounds. These are even more straightforward here: taking the bound from Lemma 5.4 suffices, giving expected recourse and expected update time. Initialization samples random walk steps in total, which gives the claimed preprocessing time and space.
5.2 Dynamic Stationary Approximation
In this section, we prove Theorem 5.1. We show first that with a small length, the distribution obtained from a uniform starting vertex converges entry-wise very closely to the stationary distribution.
Lemma 5.5 (Mixing length). For any -uniform graph and any , for any length for a sufficiently large constant , for all ,
Proof. Up to a scaling by a constant, we may assume divides . The -mixing assumption implies, for every with , that
Then, induction and averaging over all vertices give
where the second inequality follows from the lower bound on in the lemma statement for sufficiently large C, and the last follows from -uniformity.
Furthermore, we show that for such short random walks, one can obtain a high-accuracy estimation for the hitting vectors using only a small set of length walks starting from each vertex.
Lemma 5.6 (Hitting vector concentration). For a -uniform graph, assume that satisfies the bound in Lemma 5.5 and sample for each vertex walks of length . If for a sufficiently large constant , then, with high probability, for every vertex ,
Proof. For vertex , the expected number of random walks of length that terminate at is exactly , which, by Lemma 5.5 and -uniformity, is at least . After scaling by a factor of and observing again that by -uniformity, a Chernoff bound then gives
For a sufficiently large constant in the bound on s, a union bound ensures that the inequality holds over all vertices with high probability.
We now prove the main theorem.
Proof of Theorem 5.1. Our dynamic data structure uses the dynamic -random walks algorithm (Algorithm 1) with
with constants large enough such that Lemmas 5.5 and 5.6 each hold at length with error . Then with high probability, the sampled hitting vector for length walks gives approximation for the stationary distribution.
Lemma 5.3 then gives the desired running time and space bounds. We maintain the normalized sum of hitting vectors over all starting vertices in a dense vector. Updating this vector takes constant time per resampled walk. Since a query reads one counter, the query time is .
We use the black-box dynamic data structure for ease of exposition.
5.3 Dynamic Commute Time Estimations
In this section, we prove the dynamic commute time result in Theorem 5.2.
To better quantify the commute time and the necessary accuracy, we give a lower bound in Lemma 5.8 using the following Kac's return time identity for random walks.
Lemma 5.7 (Kac's return time [LP17], Lemma 21.12). For a finite irreducible random walk with stationary distribution and a vertex , define its first positive return time by . Then, for every ,
Lemma 5.8 (Commute time lower bound). For any -uniform graph G with stationary , for any distinct vertices ,
Proof. Consider a non-lazy random walk that starts from , visits and traverse back to . This whole event must happen at least as late as the first return to , which gives by (4). Swapping the order gives . The final lower bound of follows by -uniformity.
We show below, again, that short random walks suffice for getting high-accuracy estimations of commute time.
Lemma 5.9 (Truncation length). For any -uniform graph and any , for any truncation length , where is a constant, the commute time satisfies for all distinct vertices that
Proof. Since , Lemma 5.8 shows that it suffices to prove . Using the same argument from Lemma 5.5, we get for every ,
By grouping the tail from into blocks of steps, we get
Our choice of , suffices given a sufficiently large constant .
Similarly, we show that it also suffices to sample for each vertex a small set of random walks for getting a good estimation for the hitting vectors.
Lemma 5.10 (Hitting vector concentration). For any -uniform graph , sample a set of -random walks and let be the sampled estimator of . If , where is a constant, with high probability, for all pairs of distinct vertices ,
Proof. We use a similar argument as in the proof of Lemma 5.6. For vertices , is the sum over all lengths of the averages of independent terminating vertex indicators at . It has expectation exactly . Each sample has absolute value at most and the total variance is at most . A Bernstein bound then gives
For a sufficiently large constant in the bound on , a union bound ensures that the inequality holds for all pairs of vertices with high probability. Applying it with error to and and using the triangle inequality proves the lemma.
We have all the ingredients to prove Theorem 5.2.
Proof of Theorem 5.2. Our dynamic data structure again uses the dynamic -random walks algorithm (Algorithm 1) with parameters set to
The bound for is taken such that Lemma 5.9 bounds the truncation error by for all entries. This value of also meets the sample requirement in Lemma 5.10 used to estimate the hitting vector differences, giving error . By Lemma 5.8, a -approximate stationary distribution would then suffice to give a -approximate error for all-pairs commute time. For such a stationary approximation, we invoke a separate copy of the algorithm from Theorem 5.1.
Lemma 5.3 gives the running time and space bounds for the algorithm. Note that the time and space bounds in Theorem 5.2 are dominated by the current dynamic random walks algorithm. The query reads 4 counters from the estimated hitting vectors and 2 queries from the approximate stationary, giving time.
Acknowledgement
AI Disclosure: We used ChatGPT (GPT-5.6 Sol and GPT-6 Astra) to assist with the generation and refinement of mathematical proofs, a harness written by Junzhao Yang for initial ideas generation, as well as the Devin.AI harness for verifications. The tools materially affected Sections 2, 3, 4, and 5. The authors verified the correctness and originality of all content, including all mathematical arguments and references.
More details on each of the results and their timelines:
-
The undirected data structure in Section 3 was figured out in discussions together with Lawrence Li in Fall 2025, and has not structurally changed since. Lawrence was offered authorship but declined, we thank him for the discussions.
-
The hardness result in Section 4 was initially sketched by the authors, but influenced by a different construction generated by GPT 5.6. The final simplified construction took components from both ideas, but benefited from bug fixings found using the Devin harness.
-
The directed data structure in Section 5 was initially envisioned to be closer to the static algorithms based on Eulerian graphs, but significantly simplified via GPT 5.6.
References
[BP17] Karl Bringmann and Konstantinos Panagiotou. Efficient sampling methods for discrete distributions. volume 79, pages 484–508. Springer, 2017.
[BPS20] Aaron Bernstein, Maximilian Probst Gutenberg, and Thatchaphol Saranurak. Deterministic incremental reachability, scc, and shortest paths via directed expanders and congestion balancing. In 2020 IEEE 61st Annual Symposium on Foundations of Computer Science (FOCS), pages 1123–1134, 2020.
[CGH 20] Li Chen, Gramoz Goranci, Monika Henzinger, Richard Peng, and Thatchaphol Saranurak. Fast dynamic cuts, distances and effective resistances via vertex sparsifiers. In 2020 IEEE 61st Annual Symposium on Foundations of Computer Science (FOCS), pages 1135–1146, 2020.
[Chu14] Julia Chuzoy. Flows, cuts and integral routing in graphs—an approximation algorithmist's perspective. In Proc. of the International Congress of Mathematicians, pages 585–607, 2014.
[CKL 24] Li Chen, Rasmus Kyng, Yang P. Liu, Simon Meierhans, and Maximilian Probst Gutenberg. Almost-linear time algorithms for incremental graphs: Cycle detection, sccs, s-t shortest path, and minimum-cost flow. In Proceedings of the 56th Annual ACM Symposium on Theory of Computing, STOC 2024, page 1165–1173, New York, NY, USA, 2024. Association for Computing Machinery.
[Dev06] Luc Devroye. Chapter 4 nonuniform random variate generation. In Shane G. Henderson and Barry L. Nelson, editors, Simulation, volume 13 of Handbooks in Operations Research and Management Science, pages 83–121. Elsevier, 2006.
[EHHL25] Antoine El-Hayek, Monika Henzinger, and Jason Li. Fully dynamic approximate minimum cut in subpolynomial time per operation. In Proceedings of the 2025 Annual ACM-SIAM Symposium on Discrete Algorithms (SODA), pages 750–784. SIAM, 2025.
[EHHL26] Antoine El-Hayek, Monika Henzinger, and Jason Li. Deterministic and exact fully-dynamic minimum cut of superpolylogarithmic size in subpolynomial time. In Proceedings of the 2026 Annual ACM-SIAM Symposium on Discrete Algorithms (SODA), pages 613–663. SIAM, 2026.
[GRST21] Gramoz Goranci, Harald Räcke, Thatchaphol Saranurak, and Zihan Tan. The expander hierarchy and its applications to dynamic graph algorithms. In Proceedings of the 2021 ACM-SIAM Symposium on Discrete Algorithms (SODA), pages 2212–2228. SIAM, 2021.
[HKNS15] Monika Henzinger, Sebastian Krinninger, Danupon Nanongkai, and Thatchaphol Saranurak. Unifying and strengthening hardness for dynamic problems via the online matrix-vector multiplication conjecture. In Proceedings of the Forty-Seventh Annual ACM Symposium on Theory of Computing, STOC '15, page 21–30, New York, NY, USA, 2015. Association for Computing Machinery.
[HLS24] Bernhard Haeupler, Yaowei Long, and Thatchaphol Saranurak. Dynamic deterministic constant-approximate distance oracles with worst-case update time. In 2024 IEEE 65th Annual Symposium on Foundations of Computer Science (FOCS), pages 2033–2044, 2024.
[HPS22] Monika Henzinger, Ami Paz, and A. R. Sricharan. Fine-Grained Complexity Lower Bounds for Families of Dynamic Graphs. In Shiri Chechik, Gonzalo Navarro, Eva Rotenberg, and Grzegorz Herman, editors, 30th Annual European Symposium on Algorithms (ESA 2022), volume 244 of Leibniz International Proceedings in Informatics (LIPIcs), pages 65:1–65:14, Dagstuhl, Germany, 2022. Schloss Dagstuhl – Leibniz-Zentrum für Informatik.
[Knu97] Donald E Knuth. The art of computer programming: Seminumerical algorithms, volume 2. Addison-Wesley Professional, 1997.
[LP17] David A Levin and Yuval Peres. Markov chains and mixing times. American Mathematical Society, 2017.
[LS23] Lawrence Li and Sushant Sachdeva. A new approach to estimating effective resistances and counting spanning trees in expander graphs. In Proceedings of the 2023 Annual ACM-SIAM Symposium on Discrete Algorithms (SODA), pages 2728–2745. SIAM, 2023.
[Räc02] Harald Räcke. Minimizing congestion in general networks. In The 43rd Annual IEEE Symposium on Foundations of Computer Science, 2002. Proceedings., pages 43–52, 2002.
[ST04] Daniel A. Spielman and Shang-Hua Teng. Nearly-linear time algorithms for graph partitioning, graph sparsification, and solving linear systems. In Proceedings of the Thirty-Sixth Annual ACM Symposium on Theory of Computing, STOC '04, page 81–90, New York, NY, USA, 2004. Association for Computing Machinery.
[SW19] Thatchaphol Saranurak and Di Wang. Expander Decomposition and Pruning: Faster, Stronger, and Simpler, pages 2616–2635. SIAM, 2019.