text:
\subsection{Moving demands to the sparsifier}
\label{sec:Fsystem}

The goal of this section is to show that
if $C$ is a congestion reduction subset, then
any demand of the form
$\boldsymbol{\mathit{d}} = \boldsymbol{\mathit{B}}^\top \frac{\boldsymbol{\mathit{q}}}{\sqrt{\boldsymbol{\mathit{r}}}}$
for some $\boldsymbol{\mathit{q}}\in[-1,1]^m$
can be approximated by
$\boldsymbol{\mathit{\pi}}^C(\boldsymbol{\mathit{d}})$, i.e.
its demand projection
onto $C$ (Definition~\ref{def:demand_projection}).
This allows us to move all demands to the sublinear-sized $C$ and thus enables us to work
with the Schur complement of $G$ onto $C$.
\begin{lemma}\label{lem:non-projected-demand-contrib}
Consider a graph $G(V,E)$ with resistances $\boldsymbol{\mathit{r}}$ and Laplacian $\boldsymbol{\mathit{L}}$, a $\beta$-congestion reduction subset $C$,
and a demand $\boldsymbol{\mathit{d}} = \delta \boldsymbol{\mathit{B}}^\top \frac{\boldsymbol{\mathit{q}}}{\sqrt{\boldsymbol{\mathit{r}}}}$ for some $\delta > 0$ and
$\boldsymbol{\mathit{q}} \in[-1,1]^m$.
Then, the potential embedding defined as
\begin{align*}
\boldsymbol{\mathit{\phi}} = \boldsymbol{\mathit{L}}^+ \left(\boldsymbol{\mathit{d}} - \boldsymbol{\mathit{\pi}}^C\left(\boldsymbol{\mathit{d}}\right)\right)
\end{align*}
has congestion $\delta \cdot \tO{1/\beta^2}$, i.e. %
$\left\|\frac{\boldsymbol{\mathit{B}} \boldsymbol{\mathit{\phi}}}{\sqrt{\boldsymbol{\mathit{r}}}}\right\|_\infty \leq \delta \cdot \tO{1/\beta^2}$. %
\end{lemma}
We first prove a restricted version of the lemma where
$\boldsymbol{\mathit{d}}$ is an $s-t$ demand. Then, Lemma~\ref{lem:non-projected-demand-contrib} follows trivially
by applying (\ref{eq:cong_red}).
\begin{lemma}
Consider a graph $G(V,E)$ with resistances $\boldsymbol{\mathit{r}}$ and Laplacian $\boldsymbol{\mathit{L}}$, a $\beta$-congestion reduction subset $C$,
and a demand $\boldsymbol{\mathit{d}} = \delta \boldsymbol{\mathit{B}}^\top \frac{\mathbf{1}_{st}}{\sqrt{\boldsymbol{\mathit{r}}}}$ for some $\delta > 0$ and
$(s,t)\in E\backslash E(C)$.
Then, for the potential embedding defined as
\begin{align*}
\boldsymbol{\mathit{\phi}} = \boldsymbol{\mathit{L}}^+ \left(\boldsymbol{\mathit{d}} - \boldsymbol{\mathit{\pi}}^C\left(\boldsymbol{\mathit{d}}\right)\right)
\end{align*}
it follows that for any $e=(u,v)\in E$ we have
\begin{align*}
\left|\frac{(\boldsymbol{\mathit{B}} \boldsymbol{\mathit{\phi}})_e}{\sqrt{r_e}}\right| \leq
2 \delta \cdot
\left(p_u^{C\cup\{u\}}(s) + p_v^{C\cup\{v\}}(s) + p_u^{C\cup\{u\}}(t) + p_v^{C\cup\{v\}}(t)
\right)\,.
\end{align*}
\label{lem:F_system1}
\end{lemma}
The proof of Lemma~\ref{lem:F_system1} appears in Appendix~\ref{proof_lem_F_system1}.

\section{Maintaining the Schur Complement}
\label{sec:maintain_schur}

Following the scheme from~\cite{gao2021fully} we maintain a dynamic Schur complement of the graph onto a subset of terminals $C$. The approach follows rather directly from~\cite{gao2021fully} and leverages the recent work of~\cite{bernstein2020fully} to dynamically maintain an edge sparsifier of the Schur complement of the graph onto $C$. Compared to~\cite{gao2021fully} we do not require a parameter that depends on the adaptivity of the adversary.
In addition, when adding a vertex to $C$ we also return a $(1+\varepsilon)$-approximation of the effective resistance $R_{eff}(v,C)$, which gets returned by the function call.

\begin{lemma}[\textsc{DynamicSC} (Theorem 4, \cite{gao2021fully})]
There is a \textsc{DynamicSC} data structure supporting the following operations with the given runtimes
against oblivious adversaries, for constants $0 < \beta,\varepsilon < 1$:
\begin{itemize}
\item{\textsc{Initialize}$(G, C^{\text{(init)}}, \boldsymbol{\mathit{r}}, \varepsilon, \beta)$:
Initializes a graph $G$ with resistances $\boldsymbol{\mathit{r}}$ and a set of safe terminals $C^{\text{(safe)}}$.
Sets the terminal set $C = C^{\text{(safe)}} \cup C^{\text{(init)}}$.
Runtime: $\tO{m\beta^{-4} \varepsilon^{-4}}$.
}
\item{\textsc{AddTerminal}$(v\in V(G))$:
Returns ${\widetilde{R}}_{eff}(C,v) \approx_{2} R_{eff}(C,v)$ and adds $v$ as a terminal. Runtime: Amortized
$\tO{\beta^{-2} \varepsilon^{-2}}$.
}
\item{\textsc{TemporaryAddTerminals}$(\Delta C\subseteq V(G))$:
Adds all vertices in the set $\Delta C$ as (temporary) terminals.
Runtime: Worst case
$\tO{K^2 \beta^{-4} \varepsilon^{-4}}$, where $K$
is the total number of terminals
added by all of the $\textsc{TemporaryAddTerminals}$ operations that have not been rolled back
using $\textsc{Rollback}$. All $\textsc{TemporaryAddTerminals}$ operations should be rolled back
before the next call to $\textsc{AddTerminals}$.
}
\item{\textsc{Update}$(e, r)$: Under the guarantee that
both
endpoints of $e$ are terminals, updates $r_e = r$. Runtime: Worst case $\tO{1}$.
}
\item{$\widetilde{SC}()$: Returns a spectral
sparsifier $\widetilde{SC} \approx_{1+\varepsilon} SC(G,C)$ (with respect to resistances $\boldsymbol{\mathit{r}}$) with
$\tO{|C|\varepsilon^{-2}}$ edges.
Runtime: Worst case $\tO{\left(\beta m +
(K\beta^{-2}\varepsilon^{-2})^2\right)\varepsilon^{-2}}$ where $K$
is the total number of terminals
added by all of the $\textsc{TemporaryAddTerminals}$ operations that have not been rolled back.
}
\item{\textsc{Rollback}$()$: Rolls back the last $\textsc{Update}$,
$\textsc{AddTerminals}$, or \textsc{TemporaryAddTerminals} if it exists.
The runtime is the same as the original operation.
}
\end{itemize}
Finally, all calls return valid outputs with high probability. The size of $C$ should always be $O(\beta m)$.
\end{lemma}

This data structure is analyzed in detail in~\cite{gao2021fully}. Additionally, let us show that an approximation to $R_{eff}(v,C)$ can be efficiently computed along with the \textsc{AddTerminal} operation.
To get an estimate we simply inspect the neighbors of $v$ in the sparsified Schur complement of $C \cup \{v\}$ and compute the inverse of the sum of their inverses. This is indeed a $1+O(\epsilon)$-approximation, as effective resistances are preserved within a $1+O(\epsilon)$ factor in the sparsifier.

To show that this operation takes little amortized time, we note that by the proof appearing in~\cite[Lemma 6.2]{gao2021fully}, vertex $v$ appears in amortized $\tO{1}$ expanders maintained dynamically. As the dynamic sparsifier keeps $\tO{\epsilon^{-2}}$ neighbors of $v$ from each expander, the number of neighbors to inspect with each call is $\tO{\epsilon^{-2}}$, which also bounds the time necessary to approximate the resistance.

\section{Deferred Proofs from Section~\ref{sec:demand_projection}}
\subsection{Proof of Lemma~\ref{st_projection1}}
\label{proof_st_projection1}
\begin{proof}
Let $\mathcal{P}_v(u)$ be a random walk that starts from $u$ and stops when it hits $v$.
\begin{align*}
p_v^{C\cup\{v,w\}}(u)
& = \Pr\left[\mathcal{P}_v(u)\cap C = \emptyset \text{ and } w\notin \mathcal{P}_v(u)\right]\\
& =
\Pr\left[\mathcal{P}_v(u)\cap C = \emptyset\right] \cdot
\Pr\left[w\notin \mathcal{P}_v(u) \ |\ \mathcal{P}_v(u)\cap C = \emptyset \right]\\
& =
p_v^{C\cup\{v\}}(u)
\cdot
\Pr\left[w\notin \mathcal{P}_v(u) \ |\ \mathcal{P}_v(u)\cap C = \emptyset \right]
\end{align*}

Consider new resistances $\widehat{r}$, where $\widehat{r}_e = r_e$ for all $e\in E$ not incident to $C$ and $\widehat{r}_e = \infty$ for all $e\in E$ incident to $C$.
Also, let $\widehat{\mathit{p}}$ be the hitting probability function for these new resistances.
It is easy to see that
\[
\Pr\left[w\notin \mathcal{P}_v(u) \ |\ \mathcal{P}_v(u)\cap C = \emptyset \right] = \widehat{\mathit{p}}_v^{\{v,w\}}(u)\,.
\]
Therefore, we have
\begin{align*}
p_v^{C\cup\{v,w\}}(u)
& =
p_v^{C\cup\{v\}}(u)
\cdot
\widehat{\mathit{p}}_v^{\{v,w\}}(u)\,.
\end{align*}

Now we will bound $\widehat{\mathit{p}}_v^{\{v,w\}}(u)$.
Let $\psi$ be electrical potentials for pushing $1$ unit of flow from $v$ to $w$ with resistances $\widehat{r}$ and let $f$ be
the associated electrical flow.
We have that
\begin{align}
\left|\psi_u - \psi_w\right| = |f_e| \widehat{r}_e \leq \widehat{r}_e = r_e \label{1}
\end{align}
(because $|f_e| \leq 1$ and $e$ is not incident to $C$)
and
\begin{align}
 \left|\psi_v - \psi_w\right| = \widehat{R}_{eff}(v,w) \geq R_{eff}(v,w) \label{2} %
\end{align}

Additionally, by well known facts that connect electrical potential embeddings with random walks, we have that
\[ \psi_u = \psi_w + \widehat{\mathit{p}}_v^{\{v,w\}}(u) (\psi_v - \psi_w)\,, \]
or equivalently
\[
\widehat{\mathit{p}}_v^{\{v,w\}}(u)
= \frac{\psi_u - \psi_w}{\psi_v - \psi_w}
\,. \]
Using (\ref{1}) and (\ref{2}), this immediately implies that
\begin{align*}
\widehat{\mathit{p}}_v^{\{v,w\}}(u) \leq \frac{r_e}{R_{eff}(v,w)}\,.
\end{align*}
So we have proved that
\begin{align*}
p_v^{C\cup\{v,w\}}(u) \leq p_v^{C\cup\{v\}}(u) \frac{r_e}{R_{eff}(v,w)}
\end{align*}
and symmetrically
\begin{align*}
p_v^{C\cup\{v,u\}}(w) \leq p_v^{C\cup\{v\}}(w) \frac{r_e}{R_{eff}(v,u)}\,.
\end{align*}

Now, let's look at $\pi_v^{C\cup\{v\}}(B^\top \mathbf{1}_e) = p_v^{C\cup\{v\}}(u) - p_v^{C\cup\{v\}}(w)$. Note that
\[ p_v^{C\cup\{v\}}(u) = p_v^{C\cup\{v,w\}}(u) + p_w^{C\cup\{v,w\}}(u) p_v^{C\cup\{v\}}(w) \]
which we re-write as
\[ p_v^{C\cup\{v\}}(u) - p_v^{C\cup\{v\}}(w) = p_v^{C\cup\{v,w\}}(u) - (1-p_w^{C\cup\{v,w\}}(u)) p_v^{C\cup\{v\}}(w)\leq p_v^{C\cup\{v,w\}}(u)\,. \]
Symmetrically,
\[ p_v^{C\cup\{v\}}(w) - p_v^{C\cup\{v\}}(u) \leq p_v^{C\cup\{v,u\}}(w)\,. \]
From these we conclude that
\begin{align*}
\left|\pi_v^{C\cup\{v\}}(B^\top \mathbf{1}_e)\right|
& = \left|p_v^{C\cup\{v\}}(u) - p_v^{C\cup\{v\}}(w)\right| \\
& \leq \max\left\{p_v^{C\cup\{v,w\}}(u), p_v^{C\cup\{v,u\}}(w)\right\}\\
& \leq \max\left\{p_v^{C\cup\{v\}}(u)\cdot \frac{r_e}{R_{eff}(v,w)}, p_v^{C\cup\{v\}}(w)\cdot\frac{r_e}{R_{eff}(v,u)}\right\}\\
& \leq (p_v^{C\cup\{v\}}(u) + p_v^{C\cup\{v\}}(w)) \cdot \max\left\{\frac{r_e}{R_{eff}(v,w)}, \frac{r_e}{R_{eff}(v,u)}\right\}\,,
\end{align*}
which, after dividing by $\sqrt{r_e}$ gives
\begin{align*}
\left|\pi_v^{C\cup\{v\}}(B^\top \mathbf{1}_e)\right|
& \leq (p_v^{C\cup\{v\}}(u) + p_v^{C\cup\{v\}}(w)) \cdot \max\left\{\frac{\sqrt{r_e}}{R_{eff}(v,w)}, \frac{\sqrt{r_e}}{R_{eff}(v,u)}\right\}\,.
\end{align*}
\end{proof}

\subsection{Proof of Lemma~\ref{estimate1}}
\label{proof_estimate1}
\begin{proof}
For each $u\in V \backslash C$
and $e\in S'$ with $u\in e$,
we generate
$Z$ random walks $P^1(u),\dots,P^Z(u)$ from $u$
to $C\cup\{v\}$.
We set
\begin{align*}
\widetilde{\mathit{\pi}}_v^{C\cup\{v\}}\left(\boldsymbol{\mathit{B}}^\top \frac{\boldsymbol{\mathit{q}}_{S'}}{\sqrt{\boldsymbol{\mathit{r}}}}\right)
&= \sum\limits_{e=(u,w)\in S'} \sum\limits_{z=1}^Z \frac{1}{Z} \frac{q_e}{\sqrt{r_e}} \left(1_{\{v \in P^z(u)\}}
- 1_{\{v\in P^z(w)\}}\right) \\
&= \sum\limits_{e=(u,w)\in S'} \sum\limits_{z=1}^Z (X_{e,u,z} - X_{e,w,z})
\,,
\end{align*}
where we have set
$X_{e,u,z} = \frac{1}{Z} \frac{q_e}{\sqrt{r_e}} 1_{\{v\in P^z(u)\}} $
and
$ X_{e,w,z} = -\frac{1}{Z} \frac{q_e}{\sqrt{r_e}} 1_{\{v\in P^z(w)\}}$.

Note that
$\underset{P^z(u)}{\mathbb{E}}[X_{e,u,z}] = \frac{1}{Z} \frac{q_e}{\sqrt{r_e}} p_v^{C\cup\{v\}}(u)$
and
$\underset{P^z(w)}{\mathbb{E}}[X_{e,w,z}] = -\frac{1}{Z} \frac{q_e}{\sqrt{r_e}} p_v^{C\cup\{v\}}(w)$.
This implies that our estimate is unbiased, as
\[ \mathbb{E}\left[\widetilde{\mathit{\pi}}_v^{C\cup\{v\}}\left(\boldsymbol{\mathit{B}}^\top \frac{\boldsymbol{\mathit{q}}_{S'}}{\sqrt{\boldsymbol{\mathit{r}}}}\right)\right] = \sum\limits_{e=(u,w)\in S'} \frac{q_e}{\sqrt{r_e}} (p_v^{C\cup\{v\}}(u) - p_v^{C\cup\{v\}}(w)) = \pi_v^{C\cup\{v\}}\left(\boldsymbol{\mathit{B}}^\top \frac{\boldsymbol{\mathit{q}}_{S'}}{\sqrt{\boldsymbol{\mathit{r}}}}\right) \,.\]
We now need to show that our estimate is concentrated around the mean.
To apply the concentration bound in Lemma~\ref{conc1}, we need the following bounds:
\[ \sum\limits_{e=(u,w)\in S'}
\sum\limits_{z=1}^Z \left(|\mathbb{E}[X_{e,u,z}]| + |\mathbb{E}[X_{e,w,z}]|\right)
= \sum\limits_{e=(u,w)\in S'} \frac{|q_e|}{\sqrt{r_e}} (p_v^{C\cup\{v\}}(u) + p_v^{C\cup\{v\}}(w)) := E\]
\[ \underset{\substack{e=(u,w)\in S'\\ z\in[Z]}}{\max} \max\{|X_{e,u,z}|, |X_{e,w,z}|\} \leq
\max_{e\in S'} \frac{1}{Z\sqrt{r_e}} := M \,.\]
So now for any $t\in [0,E]$ we have
\begin{align*}
& \Pr\left[\left|\widetilde{\mathit{\pi}}_v^{C\cup\{v\}}\left(\boldsymbol{\mathit{B}}^\top\frac{\boldsymbol{\mathit{q}}_{S'}}{\sqrt{\boldsymbol{\mathit{r}}}}\right) - \pi_v^{C\cup\{v\}}(\boldsymbol{\mathit{B}}^\top \frac{\boldsymbol{\mathit{q}}_{S'}}{\sqrt{\boldsymbol{\mathit{r}}}})\right| > t\right] \\
& \leq 2 \exp\left(-\frac{t^2}{6EM}\right)\\
& = 2 \exp\left(-\frac{Z t^2}{6\sum\limits_{e=(u,w)\in S'} \frac{|q_e|}{\sqrt{r_e}} (p_v^{C\cup\{v\}}(u) + p_v^{C\cup\{v\}}(w))\max_{e\in S'} \frac{1}{\sqrt{r_e}} }\right)\\
& \leq 2 \exp\left(-\frac{Z t^2}{6\sum\limits_{e=(u,w)\in S'} (p_v^{C\cup\{v\}}(u) + p_v^{C\cup\{v\}}(w)) \max_{e\in S'} \frac{1}{r_e} }\right)\\
& \leq 2 \exp\left(-\frac{Z t^2 c^2 R_{eff}(C,v)}{6 \sum\limits_{e=(u,w)\in S'} (p_v^{C\cup\{v\}}(u) + p_v^{C\cup\{v\}}(w)) }\right)\\
& \leq 2 \exp\left(-Z t^2 c^2 R_{eff}(C,v) / \tO{\beta^{-2}}\right)\\
& \leq \frac{1}{n^{100}}\,,
\end{align*}
where the last inequality follows
by setting $Z = \tO{\frac{\log n \log \frac{1}{\beta}}{\delta_1'^2}}$ and
$t = \frac{\delta_1'}{\beta c \sqrt{R_{eff}(C,v)}}$. Note that we have used the fact that
$R_{eff}(C,v) \leq r_e / c^2$ for all $e\in S'$, as well as the congestion reduction property
(Definition~\ref{def:cong_red})
\[ \sum\limits_{e=(u,w)\in E\backslash E(C)} (p_v^{C\cup\{v\}}(u) + p_v^{C\cup\{v\}}(w)) \leq \tO{1/\beta^2} \,.\]
\end{proof}

\subsection{Proof of Lemma~\ref{estimate1_final}}
\label{proof_estimate1_final}
\begin{proof}
In order to compute
$\widetilde{\mathit{\pi}}_v^{C\cup\{v\}}(\boldsymbol{\mathit{B}}^\top \frac{\boldsymbol{\mathit{q}}_{S}}{\sqrt{\boldsymbol{\mathit{r}}}})$
we use Lemma~\ref{estimate1}
with demand $\boldsymbol{\mathit{B}}^\top \frac{\boldsymbol{\mathit{q}}_{S'}}{\sqrt{\boldsymbol{\mathit{r}}}}$ and error parameter
$\delta_1' > 0$,
where
\[ \{e\in S\ |\ R_{eff}(C,v) \leq r_e / (2c^2) \} \subseteq
S' \subseteq \{e\in S\ |\ R_{eff}(C,v) \leq r_e / c^2 \}\,, \]
and $c > 0$ will be defined later.
Note that
such a set $S'$ can be trivially computed
given our effective resistance estimate
${\widetilde{R}}_{eff}(C,v) \approx_{2} R_{eff}(C,v)$.
However, algorithmically we do not directly compute $S'$, but instead find
its intersection with the edges from which a sampled random walk
ends up at $v$. (Using the congestion reduction property of $C$, this can be done in $\tO{\delta_1'^{-2} \beta^{-2} \log n\log\frac{1}{\beta}}$ time
just by going through all random walks that contain $v$.)

Now, Lemma~\ref{estimate1} guarantees that
\begin{align*}
\left|
\widetilde{\mathit{\pi}}_v^{C\cup\{v\}}\left(\boldsymbol{\mathit{B}}^\top \frac{\boldsymbol{\mathit{q}}_{S'}}{\sqrt{\boldsymbol{\mathit{r}}}}\right)
- \pi_v^{C\cup\{v\}}\left(\boldsymbol{\mathit{B}}^\top \frac{\boldsymbol{\mathit{q}}_{S'}}{\sqrt{\boldsymbol{\mathit{r}}}}\right)
\right| \leq \frac{\delta_1'}{\beta c\sqrt{R_{eff}(C,v)}}
\end{align*}
given access to $O(\delta'^{-2} \log n \log \frac{1}{\beta})$ random walks
for each $u\in V\backslash C$, $e\in S'$ with $u\in e$.

Then, we set $\widetilde{\mathit{\pi}}_v^{C\cup\{v\}}(\boldsymbol{\mathit{B}}^\top \frac{\boldsymbol{\mathit{q}}_S}{\sqrt{\boldsymbol{\mathit{r}}}}) := \widetilde{\mathit{\pi}}_v^{C\cup\{v\}}(\boldsymbol{\mathit{B}}^\top \frac{\boldsymbol{\mathit{q}}_{S'}}{\sqrt{\boldsymbol{\mathit{r}}}})$, and we have that
\begin{equation}
\begin{aligned}
& \left|
\widetilde{\mathit{\pi}}_v^{C\cup\{v\}}\left(\boldsymbol{\mathit{B}}^\top \frac{\boldsymbol{\mathit{q}}_S}{\sqrt{\boldsymbol{\mathit{r}}}}\right)
- \pi_v^{C\cup\{v\}}\left(\boldsymbol{\mathit{B}}^\top \frac{\boldsymbol{\mathit{q}}_S}{\sqrt{\boldsymbol{\mathit{r}}}}\right)
\right| \\
& \leq
\left|\widetilde{\mathit{\pi}}_v^{C\cup\{v\}}\left(\boldsymbol{\mathit{B}}^\top \frac{\boldsymbol{\mathit{q}}_{S'}}{\sqrt{\boldsymbol{\mathit{r}}}}\right) - \pi_v^{C\cup\{v\}}\left(\boldsymbol{\mathit{B}}^\top \frac{\boldsymbol{\mathit{q}}_{S'}}{\sqrt{\boldsymbol{\mathit{r}}}}\right)\right|
+ \left|\pi_v^{C\cup\{v\}}\left(\boldsymbol{\mathit{B}}^\top \frac{\boldsymbol{\mathit{q}}_S - \boldsymbol{\mathit{q}}_{S'}}{\sqrt{\boldsymbol{\mathit{r}}}}\right)
\right| \\
& \leq \frac{\delta_1'}{\beta c \sqrt{R_{eff}(C,v)}}
+ \left|\pi_v^{C\cup\{v\}}\left(\boldsymbol{\mathit{B}}^\top \frac{\boldsymbol{\mathit{q}}_S - \boldsymbol{\mathit{q}}_{S'}}{\sqrt{\boldsymbol{\mathit{r}}}}\right)\right|\,.
\end{aligned}
\label{approx1}
\end{equation}
Now, to bound the second term, we use Lemma~\ref{st_projection1}, which gives
\begin{align*}
\left|\pi_v^{C\cup\{v\}}\left(\boldsymbol{\mathit{B}}^\top \frac{\boldsymbol{\mathit{q}}_S - \boldsymbol{\mathit{q}}_{S'}}{\sqrt{\boldsymbol{\mathit{r}}}}\right)\right|
& \leq \sum\limits_{e=(u,w)\in S\backslash S'} \left(p_v^{C\cup\{v\}}(u) + p_v^{C\cup\{v\}}(w)\right)
\frac{\sqrt{r_e}}{R_{eff}(v,e)}\,.
\end{align*}
Now, note that for each $e\in S\backslash S'$, $e$ is close to $C$, but $v$ is far from $C$, so
$R_{eff}(v,e)$ should be large. Specifically,
by Lemma~\ref{lem:multi_effective_resistance}
we have $R_{eff}(v,e) \geq \frac{1}{2} \min\left\{R_{eff}(v,u), R_{eff}(v,w)\right\}$,
and by the triangle inequality
\[ \min\{R_{eff}(v,u), R_{eff}(v,w) \}
\geq R_{eff}(C,v) - \max\{R_{eff}(C,u), R_{eff}(C,w)\}
\geq R_{eff}(C,v) - 2 R_{eff}(C,e) \,. \]
By the fact that $e$ is $\gamma$-important
and that
\[ e \notin S' \supseteq \{e\in S\ |\ R_{eff}(C,v) \leq r_e / (2c^2) \}\,, \]
we have $R_{eff}(C,e) \leq r_e / \gamma^2 \leq 2 c^2 R_{eff}(C,v) / \gamma^2$,
so
\begin{align*}
\frac{\sqrt{r_e}}{R_{eff}(v,e)}
& \leq \frac{1}{1/2 - 2c^2 / \gamma^2} \frac{\sqrt{r_e}}{R_{eff}(C,v)}\\
& \leq \frac{c}{1/2 - 2c^2 / \gamma^2} \frac{1}{\sqrt{R_{eff}(C,v)}}\,.
\end{align*}
By using the congestion reduction property (Definition~\ref{def:cong_red}), we obtain
\begin{align}
\left|\pi_v^{C\cup\{v\}}\left(\boldsymbol{\mathit{B}}^\top \frac{\boldsymbol{\mathit{q}}_S - \boldsymbol{\mathit{q}}_{S'}}{\sqrt{\boldsymbol{\mathit{r}}}}\right)\right|
& \leq
\frac{c}{1/2 - 2c^2 / \gamma^2}
	\frac{1}{\sqrt{R_{eff}(C,v)}} \tO{\frac{1}{\beta^2}} \,.
\label{eq:far_edges_projection}
\end{align}
Setting $c = \min\{\delta_1 / \tO{\beta^{-2}}, \gamma / 4\}$
and $\delta_1' = \beta c \cdot \delta_1 / 2$,
(\ref{approx1}) becomes
\begin{align*}
& \left|
\widetilde{\mathit{\pi}}_v^{C\cup\{v\}}\left(\boldsymbol{\mathit{B}}^\top \frac{\boldsymbol{\mathit{q}}_S}{\sqrt{\boldsymbol{\mathit{r}}}}\right)
- \pi_v^{C\cup\{v\}}\left(\boldsymbol{\mathit{B}}^\top \frac{\boldsymbol{\mathit{q}}_S}{\sqrt{\boldsymbol{\mathit{r}}}}\right)
\right|
 \leq \frac{\delta_1}{\sqrt{R_{eff}(C,v)}} \,.
\end{align*}
Also, the number of random walks needed for each valid pair $(u,e)$
is
\[ \tO{\delta_1'^{-2} \log n \log \frac{1}{\beta}} =
\tO{\delta_1^{-2} \beta^{-2} c^{-2} \log n \log \frac{1}{\beta}} =
\tO{\left(\delta_1^{-4} \beta^{-6} + \delta_1^{-2} \beta^{-2} \gamma^{-2}\right) \log n \log \frac{1}{\beta}}\]\,.

For the last part of the lemma, we let
$S'' = \{e\in S\ |\ R_{eff}(C,v) \leq r_e / \left(\gamma/4\right)^2\}$
and write
\begin{align*}
& \left| \pi_v^{C\cup\{v\}}\left(\boldsymbol{\mathit{B}}^\top \frac{\boldsymbol{\mathit{q}}_S}{\sqrt{\boldsymbol{\mathit{r}}}}\right)\right| \\
& \leq
\left|\pi_v^{C\cup\{v\}}\left(\boldsymbol{\mathit{B}}^\top \frac{\boldsymbol{\mathit{q}}_{S''}}{\sqrt{\boldsymbol{\mathit{r}}}}\right)\right|
+ \left|\pi_v^{C\cup\{v\}}\left(\boldsymbol{\mathit{B}}^\top \frac{\boldsymbol{\mathit{q}}_S - \boldsymbol{\mathit{q}}_{S''}}{\sqrt{\boldsymbol{\mathit{r}}}}\right)
\right| \,.
\end{align*}
For the first term,
\begin{align*}
\left|\pi_v^{C\cup\{v\}}\left(\boldsymbol{\mathit{B}}^\top \frac{\boldsymbol{\mathit{q}}_{S''}}{\sqrt{\boldsymbol{\mathit{r}}}}\right)\right|
& \leq \sum\limits_{e=(u,w)\in S''} \left(p_v^{C\cup\{v\}}(u) + p_v^{C\cup\{v\}}(w)\right) \frac{1}{\sqrt{r_e}}\\
& \leq \frac{1}{(\gamma/4) \sqrt{R_{eff}(C,v)}} \tO{\frac{1}{\beta^2}}\,,
\end{align*}
and for the second term we have already proved in (\ref{eq:far_edges_projection})
(after replacing $c$ by $\gamma/4$) that
\begin{align*}
\left|\pi_v^{C\cup\{v\}}\left(\boldsymbol{\mathit{B}}^\top \frac{\boldsymbol{\mathit{q}}_S - \boldsymbol{\mathit{q}}_{S''}}{\sqrt{\boldsymbol{\mathit{r}}}}\right)\right|
& \leq \frac{\gamma/4}{\sqrt{R_{eff}(C,v)}} \tO{\frac{1}{\beta^2}}\,.
\end{align*}
Putting these together,
we conclude that
\begin{align*}
\left| \pi_v^{C\cup\{v\}}\left(\boldsymbol{\mathit{B}}^\top \frac{\boldsymbol{\mathit{q}}_S}{\sqrt{\boldsymbol{\mathit{r}}}}\right)\right|
\leq \frac{1}{\gamma \sqrt{R_{eff}(C,v)}}\cdot \tO{\frac{1}{\beta^2}} \,.
\end{align*}
\end{proof}

\subsection{Proof of Lemma~\ref{conc2}}
\label{proof_conc2}
\begin{proof}
For any $I\subseteq \mathbb{R}$, we define
$F_I = \{i\in[n]\ |\ |\bar{\phi}_i| \in I\}$.
For some $0 < a < b$ to be defined later, we partition $[n]$ as
\[ [n] = F_{I_0} \cup F_{I_1}\cup \dots\cup F_{I_K}\cup F_{I_{K+1}} \,,\]
where $I_0 = [0,a)$, $I_{K+1} = [b,\infty)$, and
$I_1,\dots,I_K$ is a partition of $[a,b)$ into $K = O(\log \frac{b}{a})$ intervals
such that for all $k\in[K]$
we have $\Phi_k := \underset{i\in F_k}{\max}\, |\bar{\phi}_i| \leq 2\cdot \underset{i\in F_k}{\min}\, |\bar{\phi}_i|$.

A union bound gives
\begin{align*}
 \Pr\left[\left|\langle \widetilde{\boldsymbol{\mathit{\pi}}} - \boldsymbol{\mathit{\pi}}, \boldsymbol{\mathit{\bar{\phi}}} \rangle\right| > t\right]
 \leq \sum\limits_{k=0}^{K+1} \Pr\left[\left|\sum\limits_{i\in I_k} (\widetilde{\mathit{\pi}}_i - \pi_i) \bar{\phi}_i\right| > t / (K+2)\right]\,.
\end{align*}
We first examine $I_0$ and $I_{K+1}$ separately. Note that
\begin{align*}
\left|\sum\limits_{i\in F_{I_0}} (\widetilde{\mathit{\pi}}_i - \pi_i) \bar{\phi}_i\right| \leq \|\widetilde{\boldsymbol{\mathit{\pi}}} - \boldsymbol{\mathit{\pi}}\|_1 a \leq 2 a
\end{align*}
and
\begin{align*}
\left|\sum\limits_{i\in F_{I_{K+1}}} (\widetilde{\mathit{\pi}}_i - \pi_i) \bar{\phi}_i\right|
\leq \sum\limits_{i\in F_{I_{K+1}}} \widetilde{\mathit{\pi}}_i\left|\bar{\phi}_i\right| +
\sum\limits_{i\in F_{I_{K+1}}} \pi_i \left|\bar{\phi}_i\right|
\leq
\frac{1}{b} \sum\limits_{i\in F_{I_{K+1}}} |\widetilde{\mathit{\pi}}_i - \pi_i| \bar{\phi}_i^2
\leq \frac{1}{b}\sum\limits_{i\in F_{I_{K+1}}} \widetilde{\mathit{\pi}}_i |\bar{\phi}_i| + \frac{\left\|\bar{\phi}\right\|_{\boldsymbol{\mathit{\pi}},2}^2}{b}
\end{align*}
But note that by picking
$b \geq \max\left\{\frac{(K+2) Var_{\boldsymbol{\mathit{\pi}}}(\boldsymbol{\mathit{\bar{\phi}}})}{t}, \sqrt{Var_{\boldsymbol{\mathit{\pi}}}(\boldsymbol{\mathit{\bar{\phi}}}) \cdot n^{101}}\right\}$,
we have $\frac{Var_{\boldsymbol{\mathit{\pi}}}(\bar{\phi})}{b} \leq t / (K+2)$
and also for any $i\in F_{K+1}$ we have
$\pi_i \leq \frac{Var_{\boldsymbol{\mathit{\pi}}}(\boldsymbol{\mathit{\bar{\phi}}})}{b^2} \leq \frac{1}{n^{101}}$.
This means that $\Pr[\widetilde{\mathit{\pi}}_i \neq 0] \leq \frac{1}{n^{101}}$, and so by union bound
\[ \Pr\left[\sum\limits_{i\in F_{I_{K+1}}} \widetilde{\mathit{\pi}}_i |\bar{\phi}_i| \neq 0\right] \leq \frac{1}{n^{100}}\,.\]

Now, we proceed to $F_1,\dots,F_K$. We draw $Z$ samples $x_1,\dots,x_Z$ from $\boldsymbol{\mathit{\pi}}$.
Then, we also define the following random variables for $z\in [Z]$ and $i\in[n]$:
\[ X_{z,i} = \begin{cases}1 & \text{ if $x_z = i$} \\ 0 & \text{ otherwise }\end{cases}\] for $i\in[n]$
and
\[ Y_{z,k} = \frac{1}{Z} \sum\limits_{i\in F_k} X_{z,i} \bar{\phi}_i \]
This allows us to write $\sum\limits_{i\in F_k} \widetilde{\mathit{\pi}}_i \bar{\phi}_i = \sum\limits_{z=1}^Z Y_{z,k}$.

Fix $k\in[K]$.
We will apply Lemma~\ref{conc1} on the random variable $\sum\limits_{z=1}^Z Y_{z,k}$.
We first compute
\begin{align*}
\sum\limits_{z=1}^Z |\mathbb{E}[Y_{z,k}]| = \left|\sum\limits_{i\in F_k} \pi_i \bar{\phi}_i\right| \leq \sum\limits_{i\in F_k} \pi_i |\bar{\phi}_i|:= E_k
\end{align*}
and
\begin{align*}
\underset{z\in[Z]}{\max}\, |Y_{z,k}| \leq \frac{\Phi_k}{Z} := M_k\,.
\end{align*}
Therefore we immediately have $E_kM_k \leq \frac{2}{Z} \sum\limits_{i\in F_k} \pi_i \bar{\phi}_i^2 \leq \frac{2}{Z} \cdot Var_{\pi}(\bar{\phi}) $. By Lemma~\ref{conc1},
\begin{align*}
& \Pr\left[\left|\sum\limits_{z=1}^Z Y_{z,k} - \mathbb{E}\left[\sum\limits_{z=1}^Z Y_{z,k}\right]\right| > t / (K+2)\right] \\
& \leq 2 \exp\left(-\frac{t^2}{6E_kM_k (K+2)^2}\right)\\
& \leq 2 \exp\left(-\frac{Z t^2}{12\cdot Var_{\pi}(\bar{\phi}) (K+2)^2}\right)\,.\\
\end{align*}
Summarizing, and using the fact that $K = \tO{\log (n\cdot Var_{\boldsymbol{\mathit{\pi}}}(\boldsymbol{\mathit{\bar{\phi}}}) / t^2)}$, we get
\[\Pr\left[\left|\langle \widetilde{\boldsymbol{\mathit{\pi}}} - \boldsymbol{\mathit{\pi}}, \boldsymbol{\mathit{\bar{\phi}}}\rangle\right| > t\right] \leq \tO{\frac{1}{n^{100}}} + 2\tO{\log \left(n \cdot Var_{\boldsymbol{\mathit{\pi}}}(\boldsymbol{\mathit{\bar{\phi}}}) / t^2\right)}\exp\left(- \frac{Z t^2}{12 \cdot\tO{Var_{\boldsymbol{\mathit{\pi}}}(\boldsymbol{\mathit{\bar{\phi}}}) \log^2 n}} \right)\,.\]
\end{proof}

\subsection{Proof of Lemma~\ref{lem:variance}}
\label{proof_lem_variance}
\begin{proof}
Let $S_0 = \emptyset$ and
and for each $k\in\mathbb{N}$ let \[S_k = \{i\in[n]\backslash S_{k-1}\ :\ \phi_i^2 \leq 2^{k+1} R_{eff}(C,v)\}\,.\]
Fix some $k \geq 2$. Note that
$\phi_i^2 > 2^k R_{eff}(C,v)$ for all $i\in S_k$,
implying
$\frac{2^{k} R_{eff}(C,v)}{R_{eff}(S_k,v)} <
E_{\boldsymbol{\mathit{r}}}(\boldsymbol{\mathit{\phi}}) \leq
1$, and so $R_{eff}(S_k,v) > 2^k R_{eff}(C,v) \geq 4 R_{eff}(C,v)$.
As
\[ R_{eff}(C,v) \geq \frac{1}{4} \min\{R_{eff}(S_k,v), R_{eff}(C\backslash S_k,v)\} > \min\{R_{eff}(C,v), \frac{1}{4} R_{eff}(C\backslash S_k,v)\} \,,\]
we have
$R_{eff}(C\backslash S_k, v) < 4 R_{eff}(C,v)$.
This implies that $\left\|\pi_{S_k}^C(\mathbf{1}_v)\right\|_1 \leq \frac{R_{eff}(C\backslash S_k, v)}{R_{eff}(S_k, v)} < \frac{1}{2^{k-2}}$.

So we conclude that $Var_{\boldsymbol{\mathit{\pi}}}(\boldsymbol{\mathit{\phi}}) = \sum\limits_{i\in S_k} \pi_i \phi_i^2 \leq \frac{1}{2^{k-2}} \cdot 2^{k+1} R_{eff}(C,v) = 8 R_{eff}(C,v)$.
\end{proof}

\subsection{Proof of Lemma~\ref{lem:insert1}}
\label{proof_lem_insert1}

\begin{proof}
The first part of the statement is given by
applying Lemma~\ref{estimate1_final}, and we see that it requires
$\tO{\delta_1^{-4} \beta^{-6} + \delta_1^{-2} \beta^{-2} \gamma^{-2}}$
random walks for each $u\in V\backslash C$ and $e\in E\backslash E(C)$ with $u\in e$.

For the second part we use the fact that the change in the demand projection after inserting $v$ into $C$ is given by
\[
\boldsymbol{\mathit{\pi}}^{C\cup \{v\}}\left(\boldsymbol{\mathit{B}}^\top \frac{\boldsymbol{\mathit{q}}_S}{\sqrt{\boldsymbol{\mathit{r}}}}\right)
-
\boldsymbol{\mathit{\pi}}^{C}\left(\boldsymbol{\mathit{B}}^\top \frac{\boldsymbol{\mathit{q}}_S}{\sqrt{\boldsymbol{\mathit{r}}}}\right)
=
\pi_v^{C\cup \{v\}}\left(\boldsymbol{\mathit{B}}^\top \frac{\boldsymbol{\mathit{q}}_S}{\sqrt{\boldsymbol{\mathit{r}}}}\right)\cdot (\mathbf{1}_v - \boldsymbol{\mathit{\pi}}^C(\mathbf{1}_v))\,,
\]
and therefore we can estimate this update via
\[
\widetilde{\mathit{\pi}}_v^{C\cup \{v\}}\left(\boldsymbol{\mathit{B}}^\top \frac{\boldsymbol{\mathit{q}}_S}{\sqrt{\boldsymbol{\mathit{r}}}}\right)\cdot (\mathbf{1}_v - \widetilde{\boldsymbol{\mathit{\pi}}}^C(\mathbf{1}_v))\,.
\]
where $\widetilde{\mathit{\pi}}_v^{C\cup \{v\}}\left(\boldsymbol{\mathit{B}}^\top \frac{\boldsymbol{\mathit{q}}_S}{\sqrt{\boldsymbol{\mathit{r}}}}\right)$
is the estimate we computed using Lemma~\ref{estimate1_final}
and $\widetilde{\boldsymbol{\mathit{\pi}}}^C(\mathbf{1}_v)$ is obtained by applying Lemma~\ref{estimate2}.

Let us show that this estimation indeed introduces only a small amount of error.
For any $\boldsymbol{\mathit{\phi}}$, such that $E_r(\boldsymbol{\mathit{\phi}}) \leq 1$, we can write
\begin{align*}
&\left| \left\langle
\widetilde{\mathit{\pi}}_v^{C\cup \{v\}}\left(\boldsymbol{\mathit{B}}^\top \frac{\boldsymbol{\mathit{q}}_S}{\sqrt{\boldsymbol{\mathit{r}}}}\right)\cdot (\mathbf{1}_v - \widetilde{\boldsymbol{\mathit{\pi}}}^C(\mathbf{1}_v))
-
\pi_v^{C\cup \{v\}}\left(\boldsymbol{\mathit{B}}^\top \frac{\boldsymbol{\mathit{q}}_S}{\sqrt{\boldsymbol{\mathit{r}}}}\right)\cdot (\mathbf{1}_v - \boldsymbol{\mathit{\pi}}^C(\mathbf{1}_v))
,
\boldsymbol{\mathit{\phi}}
 \right\rangle \right|
 \\
 &\leq
 \left| \left\langle
\pi_v^{C\cup \{v\}}\left(\boldsymbol{\mathit{B}}^\top \frac{\boldsymbol{\mathit{q}}_S}{\sqrt{\boldsymbol{\mathit{r}}}}\right)\cdot (\boldsymbol{\mathit{\pi}}^C(\mathbf{1}_v) - \widetilde{\boldsymbol{\mathit{\pi}}}^C(\mathbf{1}_v))
,
\boldsymbol{\mathit{\phi}}  \right\rangle \right|\\
 &+
 \left| \left\langle
\left( \widetilde{\mathit{\pi}}_v^{C\cup \{v\}}\left(\boldsymbol{\mathit{B}}^\top \frac{\boldsymbol{\mathit{q}}_S}{\sqrt{\boldsymbol{\mathit{r}}}}\right)
-
\pi_v^{C\cup \{v\}}\left(\boldsymbol{\mathit{B}}^\top \frac{\boldsymbol{\mathit{q}}_S}{\sqrt{\boldsymbol{\mathit{r}}}}\right)\right)\cdot (\mathbf{1}_v - \boldsymbol{\mathit{\pi}}^C(\mathbf{1}_v))
,
\boldsymbol{\mathit{\phi}}  \right\rangle \right|\\
&+
 \left| \left\langle
\left(\widetilde{\mathit{\pi}}_v^{C\cup \{v\}}\left(\boldsymbol{\mathit{B}}^\top \frac{\boldsymbol{\mathit{q}}_S}{\sqrt{\boldsymbol{\mathit{r}}}}\right)-  \pi_v^{C\cup \{v\}}\left(\boldsymbol{\mathit{B}}^\top \frac{\boldsymbol{\mathit{q}}_S}{\sqrt{\boldsymbol{\mathit{r}}}}\right) \right)\cdot (\boldsymbol{\mathit{\pi}}^C(\mathbf{1}_v) - \widetilde{\boldsymbol{\mathit{\pi}}}^C(\mathbf{1}_v))
,
\boldsymbol{\mathit{\phi}}  \right\rangle \right|\,.
\end{align*}
At this point we can bound these quantities using Lemmas~\ref{estimate1_final} and~\ref{estimate2}. It is important to notice that they require that $S$ is a set of $\gamma$-important edges, for some parameter $\gamma$.
Our congestion reduction subset $C$ keeps increasing due to vertex insertions. This, however, means that effective resistances between any vertex in $V\setminus C$ and $C$ can only decrease, and therefore the set of important edges can only increase. Thus we are still in a valid position to apply these lemmas.

Using $E_{\boldsymbol{\mathit{r}}}(\boldsymbol{\mathit{\phi}})\leq 1$, which allows us to write:
\[
\langle \mathbf{1}_v - \boldsymbol{\mathit{\pi}}^C(\mathbf{1}_v)), \boldsymbol{\mathit{\phi}} \rangle \leq \mathcal{E}_{\boldsymbol{\mathit{r}}}\left( \mathbf{1}_v - \boldsymbol{\mathit{\pi}}^C(\mathbf{1}_v) \right) = R_{eff}(v,C)\,,
\]
we can continue to upper bound the error by:
\begin{align*}
&\frac{\tO{\gamma^{-1} \beta^{-2}}}{\sqrt{R_{eff}(C,v)}}\cdot \delta_2 \sqrt{R_{eff}(C,v)}
	+ \frac{\delta_1}{\sqrt{R_{eff}(C,v)}} \cdot \sqrt{R_{eff}(C,v)}
	+ \frac{\delta_1}{\sqrt{R_{eff}(C,v)}} \cdot \delta_2 \sqrt{R_{eff}(C,v)}\\
&= \delta_2 \cdot \tO{\gamma^{-1} \beta^{-2}} + \delta_1 + \delta_1\delta_2 \,.
\end{align*}
Setting $\delta_1 = \widehat{\eps} / 2$ and $\delta_2 = {\widehat{\eps} \beta^2 \gamma}/\tO{1}$, we conclude that w.h.p. each operation introduces at most $\widehat{\eps}$ additive error in the maintained estimate for $\left\langle \widetilde{\boldsymbol{\mathit{\pi}}}^C(\boldsymbol{\mathit{B}}^\top \frac{\boldsymbol{\mathit{q}}_S}{\sqrt{\boldsymbol{\mathit{r}}}}),\boldsymbol{\mathit{\phi}} \right\rangle$.

Per Lemma~\ref{estimate1_final}, estimating one coordinate of the demand projection requires
\[
\tO{\delta_1^{-4} \beta^{-6} + \delta_1^{-2} \beta^{-2} \gamma^{-2}}
 = \tO{\widehat{\eps}^{-4} \beta^{-6} + \widehat{\eps}^{-2} \beta^{-2} \gamma^{-2}}\
\]
  random walks,
and estimating $\widetilde{\boldsymbol{\mathit{\pi}}}^C(\boldsymbol{\mathit{B}}^\top \frac{\boldsymbol{\mathit{q}}_S}{\sqrt{\boldsymbol{\mathit{r}}}})$, per Lemma~\ref{estimate2}, requires
\[
 \tO{\delta_2^{-2} } = \tO{\widehat{\eps}^{-2} \beta^{-4} \gamma^{-2}}
\]
random walks. This concludes the proof.

\end{proof}

\section{Deferred Proofs from Section~\ref{sec:locator}}

\subsection{Proof of Lemma~\ref{lem:F_system1}}
We first provide a helper lemma for upper bounding escape probabilities in terms of the underlying graph's resistances.

\begin{lemma}[Bounding escape probabilities]
\label{lem:escape_prob}
Let a graph with resistances $\boldsymbol{\mathit{r}}$, and consider a random walk which at each step moves from the current vertex $u$ to an adjacent vertex $v$ sampled with probability proportional to $1/{r_{uv}}$.
Let $p_u^{\{u,t\}}(s)$ represent the probability that a walk starting at $s$ hits $u$ before $t$. Then
\[
p_u^{\{u,t\}}(s) = \frac{R_{eff}(s,t)}{R_{eff}(u,t)} \cdot p_s^{\{s,t\}}(u) \leq \frac{R_{eff}(s,t)}{R_{eff}(u,t)} \leq \frac{r_{st}}{R_{eff}(u,t)}\,.
\]
\end{lemma}
\begin{proof}
Using standard arguments we can prove that if $\boldsymbol{\mathit{L}}$ is the Laplacian associated with the underlying graph, then
\[
p_u^{\{u,t\}}(s) = \frac{(\mathbf{1}_s - \mathbf{1}_t)^\top \boldsymbol{\mathit{L}}^+ (\mathbf{1}_u - \mathbf{1}_t)}{R_{eff}(u,t)}\,.
\]
This immediately yields the claim as we can further write it as
\[
p_u^{\{u,t\}}(s) = \frac{R_{eff}(s,t)}{R_{eff}(u,t)} \cdot \frac{(\mathbf{1}_u - \mathbf{1}_t)^\top \boldsymbol{\mathit{L}}^+ (\mathbf{1}_s - \mathbf{1}_t)}{R_{eff}(s,t)}
= \frac{R_{eff}(s,t)}{R_{eff}(u,t)} \cdot p_s^{\{s,t\}}(u) \leq \frac{R_{eff}(s,t)}{R_{eff}(u,t)}\,,
\]
where we crucially used the symmetry of $\boldsymbol{\mathit{L}}$. The final inequality is due to the fact that $R_{eff}(s,t) \leq r_{st}$.

Now let us prove the claimed identity for escape probabilities. Let $\boldsymbol{\mathit{\psi}}$ be the vector defined by $\psi_i = p_u^{\{u,t\}}(i)$ for all $i \in V$, which clearly satisfies $\psi_u = 1$ and $\psi_t = 0$. Furthermore, for all $i \notin\{u,t\}$ we have
\[
\psi_i = \sum_{j \sim i} \frac{  r_{ij}^{-1}  }{ \sum_{k\sim i}r_{ik}^{-1}  } \psi_j\,,
\]
which can be written in short as
\[
(\boldsymbol{\mathit{L}} \boldsymbol{\mathit{\psi}})_i = 0\,\quad \textnormal{for all } i\notin\{s,t\}\,.
\]
Now we solve the corresponding linear system. We interpret $\boldsymbol{\mathit{\psi}}$ as electrical potentials corresponding to routing $1/R_{eff}(u,t)$ units of electrical flow from $u$ to $t$. Indeed, by Ohm's law, this corresponds to a potential difference $\psi_u  - \psi_t = 1$. Furthermore, this shows that
\[
\psi_s - \psi_t = (\mathbf{1}_s - \mathbf{1}_t)^\top  \boldsymbol{\mathit{L}}^+ (\mathbf{1}_u - \mathbf{1}_t) \cdot \frac{1}{R_{eff}(u,t)}\,,
\]
which concludes the proof.

\end{proof}

Now we are ready to prove the main statement.
\begin{proof}[Proof of Lemma~\ref{lem:F_system1}]\label{proof_lem_F_system1}
Note that the demand can be decomposed as
$\boldsymbol{\mathit{d}} - \boldsymbol{\mathit{\pi}}^C(\boldsymbol{\mathit{d}}) = \boldsymbol{\mathit{d}}^1 - \boldsymbol{\mathit{d}}^2$,
where $\boldsymbol{\mathit{d}}^1 = \frac{\mathbf{1}_s}{\sqrt{r_{st}}} - \boldsymbol{\mathit{\pi}}^C(\frac{\mathbf{1}_s}{\sqrt{r_{st}}})$
and
$\boldsymbol{\mathit{d}}^2 = \frac{\mathbf{1}_t}{\sqrt{r_{st}}} - \boldsymbol{\mathit{\pi}}^C(\frac{\mathbf{1}_t}{\sqrt{r_{st}}})$.
Now let $p^1$ be the probability distribution of $s-C$ random walks
obtained via a random walk from $s$ with transition probabilities proportional to inverse resistances.
Similarly, let $p^2$ be the probability distribution of $t-C$ random walks obtained by running the same process starting from $t$.

Now, it is well known that an electrical flow is the sum of these random walks, i.e.
\[ \boldsymbol{\mathit{R}}^{-1} \boldsymbol{\mathit{B}} \boldsymbol{\mathit{L}}^+ \boldsymbol{\mathit{d}}^1 = \frac{1}{\sqrt{r_{st}}} \cdot \mathbb{E}_{P\sim p^1} \left[net(P)\right] \]
and similarly for $\boldsymbol{\mathit{d}}^2$
\[ \boldsymbol{\mathit{R}}^{-1} \boldsymbol{\mathit{B}} \boldsymbol{\mathit{L}}^+ \boldsymbol{\mathit{d}}^2 = \frac{1}{\sqrt{r_{st}}} \cdot \mathbb{E}_{P\sim p^2} \left[net(P)\right] \,, \]
where $net(P)\in\mathbb{R}^m$ is a flow vector whose $e$-th entry is the net number of times the edge $e=(u,v)$ is used by $P$.
Therefore we can write:
\begin{align*}
 \left|\frac{\phi_u - \phi_v}{\sqrt{r_{uv}}}\right|
 & = \sqrt{r_{uv}} \left|\boldsymbol{\mathit{R}}^{-1} \boldsymbol{\mathit{B}} \boldsymbol{\mathit{L}}^+ \boldsymbol{\mathit{d}}\right|_{uv}\\
& = \sqrt{\frac{r_{uv}}{r_{st}}} \left|
 \mathbb{E}_{P^1\sim p^1}\left[net_e(P^1)\right]  - \mathbb{E}_{P^2\sim p^2}\left[net_e(P^2)\right]
\right|\,.
\end{align*}
Let us also subdivide $e$ by inserting an additional vertex $w$ in the middle (i.e. $r_{uw} = r_{wv} = r_{uv} / 2$). This has no effect in the random walks,
but will be slightly more convenient in terms of notation.
The first expectation term can be expressed as
\begin{align*}
\mathbb{E}_{P^1\sim p^1}\left[net_e(P^1)\right]
& = \Pr_{P^1\sim p^1}\left[P^1 \text{ visits $t$ before $C\cup\{w\}$}\right] \cdot \mathbb{E}_{P^1\sim p^1}\left[net_e(P^1)\ |\ P^1 \text{ visits $t$ before $C\cup\{w\}$}\right]\\
& + \Pr_{P^1\sim p^1}\left[P^1 \text{ visits $w$ before $C\cup\{t\}$}\right] \cdot \mathbb{E}_{P^1\sim p^1}\left[net_e(P^1)\ |\ P^1 \text{ visits $t$ before $C\cup\{t\}$}\right]\,.
\end{align*}
Now, note that
\[ \mathbb{E}_{P^1\sim p^1}\left[net_e(P^1)\ |\ P^1 \text{ visits $t$ before $C\cup\{w\}$}\right] = \mathbb{E}_{P^2\sim p^2}\left[net_e(P^2)\right] \,.\]
Additionally,
\begin{align*}
& \Pr_{P^1\sim p^1}\left[P^1 \text{ visits $w$ before $C\cup\{t\}$}\right] \\
& = \Pr_{P^1\sim p^1}\left[P^1 \text{ visits $w$ before $C$}\right] \cdot
\Pr_{P^1\sim p^1}\left[P^1 \text{ visits $w$ before $t$}\ |\ P^1 \text{ visits $w$ before $C$} \right]
\end{align*}
The first term of the product is $p_w^{C\cup\{w\}}(s)$. For the second term, we define a new graph $\widehat{G}$
by deleting $C$, and denote the hitting probabilities in $\widehat{G}$ by $\widehat{\mathit{p}}$. Then, the second term is equal to
$\widehat{\mathit{p}}_w^{\{t,w\}}(s)$.

We have concluded that
\begin{align*}
\mathbb{E}_{P^1\sim p^1}\left[net_e(P^1)\right]
& \leq
\mathbb{E}_{P^2\sim p^2}\left[net_e(P^2)\right] + p_w^{C\cup\{w\}}(s) \cdot \widehat{\mathit{p}}_w^{\{t,w\}}(s)\,.
\end{align*}
Combining this with the symmetric argument for $p^2$ shows that
\begin{align*}
\left|\mathbb{E}_{P^1\sim p^1}\left[net_e(P^1)\right]
- \mathbb{E}_{P^2\sim p^2}\left[net_e(P^2)\right]\right|
\leq p_w^{C\cup\{w\}}(s) \cdot \widehat{\mathit{p}}_w^{\{t,w\}}(s) + p_w^{C\cup\{w\}}(t) \cdot \widehat{\mathit{p}}_w^{\{s,w\}}(t)\,.
\end{align*}

Using Lemma~\ref{lem:escape_prob} and the fact that ${\widehat{R}}_{eff}(w, t) \geq r_{uv} / 4$ (${\widehat{R}}_{eff}$ are the effective resistances in $\widehat{G}$), we can bound
 \[
 \widehat{p}_{w}^{\{t,w\}}(s) \leq \min\{1,\frac{r_{st}}{{\widehat{R}}_{eff}(w, t)}\} \leq \min\{1,4 \frac{r_{st}}{r_{uv}}\}\,,
\]
and the same upper bound holds for $\widehat{\mathit{p}}_w^{\{s,w\}}(t)$. Therefore,
\begin{align*}
& \left|\mathbb{E}_{P^1\sim p^1}\left[net_e(P^1)\right]
- \mathbb{E}_{P^2\sim p^2}\left[net_e(P^2)\right]\right|\\
& \leq \min\{1,4 \frac{r_{st}}{r_{uv}}\} \left(p_w^{C\cup\{w\}}(s) + p_w^{C\cup\{w\}}(t)\right)\\
& \leq 2 \sqrt{\frac{r_{st}}{r_{uv}}} \left(p_w^{C\cup\{w\}}(s) + p_w^{C\cup\{w\}}(t)\right)\\
& \leq 2 \sqrt{\frac{r_{st}}{r_{uv}}}
\left(
p_u^{C\cup\{u\}}(s)
+ p_v^{C\cup\{v\}}(s)
+ p_u^{C\cup\{u\}}(t)
+ p_v^{C\cup\{v\}}(t)
\right)\,.
\end{align*}

Putting everything together, we have that
\begin{align*}
& \left|\frac{\phi_u - \phi_v}{\sqrt{r_{uv}}}\right|
\leq
2 \left(
p_u^{C\cup\{u\}}(s)
+ p_v^{C\cup\{v\}}(s)
+ p_u^{C\cup\{u\}}(t)
+ p_v^{C\cup\{v\}}(t)
\right)\,.
\end{align*}
\end{proof}

\subsection{Proof of Lemma~\ref{st_projection1_energy}}
\label{proof_st_projection1_energy}

\begin{proof}
Let $\boldsymbol{\mathit{d}} = \boldsymbol{\mathit{B}}^\top \frac{\mathbf{1}_e}{\sqrt{\boldsymbol{\mathit{r}}}}$ and $e = (u,w)$.
Note that $\mathcal{E}_r\left(\boldsymbol{\mathit{d}}\right) \leq r_e \cdot (\frac{1}{\sqrt{r_e}})^2 = 1$, therefore
the case that remains is
\begin{align}
R_{eff}(C,e) \geq 36 \cdot r_e\,.
\label{eq:st_projection1_condition}
\end{align}
For each $v\in C$
by Lemma~\ref{st_projection1} we have that
\begin{align*}
\left|\pi_v^{C}(\boldsymbol{\mathit{d}})\right| \leq (p_v^{C}(u) + p_v^{C}(w)) \cdot \frac{\sqrt{r_e}}{R_{eff}(v,e)} \,.
\end{align*}
Now, we would like to bound the energy of routing $\boldsymbol{\mathit{\pi}}^C(\boldsymbol{\mathit{d}})$ by the
energy to route it via $w$.
For each $v\in C$ we let $\boldsymbol{\mathit{d}}^v$ be the following demand:
\[\boldsymbol{\mathit{d}}^v = %
\pi_v^C(\boldsymbol{\mathit{d}}) \cdot (\mathbf{1}_v - \mathbf{1}_w )\,. \]%
Note that $\boldsymbol{\mathit{\pi}}^C(\boldsymbol{\mathit{d}}) = \sum\limits_{v\in C} \boldsymbol{\mathit{d}}^v$.
We have,
\begin{align*}
\sqrt{\mathcal{E}_{\boldsymbol{\mathit{r}}}(\pi^C(\boldsymbol{\mathit{d}}))}
& = \sqrt{\mathcal{E}_{\boldsymbol{\mathit{r}}}\left(\pi^C\left(\sum\limits_{v\in C} \boldsymbol{\mathit{d}}^v\right)\right)}\\
& \leq \sum\limits_{v\in C} \sqrt{\mathcal{E}_{\boldsymbol{\mathit{r}}}\left(\pi^C\left(\boldsymbol{\mathit{d}}^v\right)\right)}\\
& \leq \sum\limits_{v\in C} (R_{eff}(v,w))^{1/2} \left|\pi_v^C(\boldsymbol{\mathit{d}})\right|\\
& \leq \sum\limits_{v\in C} (R_{eff}(v,w))^{1/2} \cdot (p_v^{C}(u) + p_v^{C}(w)) \cdot \frac{\sqrt{r_e}}{R_{eff}(v,e)}\,.
\end{align*}
Now, note that, because $R_{eff}$ is a metric,
\begin{align*}
R_{eff}(v,u)
& \geq
R_{eff}(v,w) - |R_{eff}(v,w) - R_{eff}(v,u)|\\
& \geq
R_{eff}(v,w) - r_e\\
& \geq
R_{eff}(v,w) - \frac{1}{36} R_{eff}(C,e)\\
& \geq
\frac{35}{36} R_{eff}(v,w)\,,
\end{align*}
where we used
the triangle inequality twice,
(\ref{eq:st_projection1_condition}),
and also the fact that $R_{eff}(v,w) \geq R_{eff}(C,e)$ because $v\in C$ and $w\in e$.
Now, note also that
\[ R_{eff}(v,e) \geq \frac{1}{2} \min\{R_{eff}(v,w),R_{eff}(v,u) \geq \frac{1}{2}\cdot \frac{35}{36} R_{eff}(v,w)\}\,,\]
so
\begin{align*}
& 2 \sum\limits_v (R_{eff}(v,w))^{1/2} \cdot (p_v^{C}(u) + p_v^{C}(w)) \cdot \frac{\sqrt{r_e}}{R_{eff}(v,e)}\\
& \leq 2\sqrt{2\cdot\frac{36}{35}} \sum\limits_v (p_v^{C}(u) + p_v^{C}(w)) \cdot \sqrt{\frac{r_e}{R_{eff}(v,e)}}\\
& \leq 6\cdot \sqrt{\frac{r_e}{R_{eff}(C,e)}}\,,
\end{align*}
where we used the fact that
$\sum\limits_{v\in C} (p_v^{C}(u) + p_v^{C}(w)) = 2$ and $R_{eff}(v,e) \geq R_{eff}(C,e)$ because $v\in C$.
\end{proof}

\subsection{Proof of Lemma~\ref{lem:important_edges}}
\label{proof_lem_important_edges}
\begin{proof}
By definition of the fact that $e$ is not $\varepsilon$-important, we have
\[ R_{eff}(C,e) > r_e / \varepsilon^2 \,.\]
Using the fact that the demand $\boldsymbol{\mathit{\pi}}^C\left(\boldsymbol{\mathit{B}}^\top \frac{\boldsymbol{\mathit{p}}}{\sqrt{\boldsymbol{\mathit{r}}}}\right)$
is supported on $C$ and Lemma~\ref{st_projection1_energy}, we get
\begin{align*}
 \left|\left\langle \mathbf{1}_e, \boldsymbol{\mathit{R}}^{-1/2} \boldsymbol{\mathit{B}} \boldsymbol{\mathit{\phi}}^*\right\rangle\right|
 &= \left|\left\langle \boldsymbol{\mathit{\pi}}^C\left(\boldsymbol{\mathit{B}}^\top \frac{\mathbf{1}_e}{\sqrt{\boldsymbol{\mathit{r}}}}\right),
 \boldsymbol{\mathit{\phi}}_C^*\right\rangle\right| \\
 & \leq \sqrt{\mathcal{E}_{\boldsymbol{\mathit{r}}}\left(\boldsymbol{\mathit{\pi}}^C\left(\boldsymbol{\mathit{B}}^\top \frac{\mathbf{1}_e}{\sqrt{\boldsymbol{\mathit{r}}}}\right)\right)}
 \cdot \sqrt{E_{\boldsymbol{\mathit{r}}}(\boldsymbol{\mathit{\phi}}^*)}\\
 & = \sqrt{\mathcal{E}_{\boldsymbol{\mathit{r}}}\left(\boldsymbol{\mathit{\pi}}^C\left(\boldsymbol{\mathit{B}}^\top \frac{\mathbf{1}_e}{\sqrt{\boldsymbol{\mathit{r}}}}\right)\right)}
 \cdot \delta \sqrt{\mathcal{E}_{\boldsymbol{\mathit{r}}}\left(\boldsymbol{\mathit{\pi}}^C\left(\boldsymbol{\mathit{B}}^\top \frac{\boldsymbol{\mathit{p}}}{\sqrt{\boldsymbol{\mathit{r}}}}\right)\right)}\\
 & \leq 6 \sqrt{\frac{r_e}{R_{eff}(C,e)}} \cdot \delta \sqrt{m}\\
 & \leq 6\varepsilon\,.
\end{align*}
\end{proof}

\subsection{Proof of Lemma~\ref{lem:projection_change_energy}}
\label{proof_lem_projection_change_energy}
\begin{proof}
We note that
\begin{align*}
& \sqrt{\mathcal{E}_{\boldsymbol{\mathit{r}}}\left(
\boldsymbol{\mathit{\pi}}^{C\cup\{v\}}(\boldsymbol{\mathit{B}}^\top \frac{\boldsymbol{\mathit{q}}}{\sqrt{\boldsymbol{\mathit{r}}}})
-  \boldsymbol{\mathit{\pi}}^{C}(\boldsymbol{\mathit{B}}^\top \frac{\boldsymbol{\mathit{q}}}{\sqrt{\boldsymbol{\mathit{r}}}})\right)}\\
& = \left|\pi_v^{C\cup\{v\}}(\boldsymbol{\mathit{B}}^\top \frac{\boldsymbol{\mathit{q}}}{\sqrt{\boldsymbol{\mathit{r}}}})\right| \sqrt{R_{eff}(C,v)} \\
& \leq \sum\limits_{e=(u,w)\in E}
\left|\pi_v^{C\cup\{v\}}(\boldsymbol{\mathit{B}}^\top \frac{q_e}{\sqrt{r_e}} \mathbf{1}_e)\right| \sqrt{R_{eff}(C,v)} \\
& \leq \sum\limits_{e=(u,w)\in E}
(p_v^{C\cup\{v\}}(u) + p_v^{C\cup\{v\}}(w)) \cdot
\min\left\{\sqrt{\frac{R_{eff}(C,v)}{r_e}},
\frac{\sqrt{r_e R_{eff}(C,v)}}{R_{eff}(e,v)}\right\}
\,,
\end{align*}
where we used Lemma~\ref{st_projection1}.
For some sufficiently large $c$ to be defined later, we
partition $E$ into $X$ and $Y$, where
$X = \{e\in E\ |\ R_{eff}(C,v) \leq c^2 \cdot r_e \text{ or } r_e R_{eff}(C,v) \leq c^2 \cdot (R_{eff}(e,v))^2 \}$
and $Y = E\backslash X$. We first note that
\begin{align*}
&  \sum\limits_{e=(u,w)\in X}
(p_v^{C\cup\{v\}}(u) + p_v^{C\cup\{v\}}(w)) \cdot
\min\left\{\sqrt{\frac{R_{eff}(C,v)}{r_e}},
\frac{\sqrt{r_e R_{eff}(C,v)}}{R_{eff}(e,v)}\right\}\\
& \leq c \cdot  \sum\limits_{e=(u,w)\in X}
(p_v^{C\cup\{v\}}(u) + p_v^{C\cup\{v\}}(w))\\
& \leq c\cdot \tO{\beta^{-2}}\,,
\end{align*}
where the last inequality follows by the congestion reduction property.

Now, let $e=(u,w)\in Y$. We will prove that both $u$ and $w$ are much closer to $v$ than $C$.
This, in turn, will imply that their hitting probabilities on $v$ are roughly the same,
and so they mostly cancel out in the projection.

First of all, we let
$R_{eff}(C,v) = c_1^2 \cdot r_e$
and
$r_e R_{eff}(C,v) = c_2^2 \cdot (R_{eff}(e,v))^2$,
for some $c_1,c_2 > 0$, where by definition $c_1,c_2\geq c$.
Now, we assume without loss of generality that $R_{eff}(u,v) \leq R_{eff}(w,v)$, and so
\begin{align*}
R_{eff}(u,v) \leq 2 R_{eff}(e,v) = \frac{2}{c_2} \sqrt{r_e R_{eff}(C,v)}
= \frac{2}{c_1c_2} R_{eff}(C,v)
\leq
 \frac{2}{c_1c_2} \left(R_{eff}(C,u) + R_{eff}(u,v)\right)
\,,
\end{align*}
so
\begin{equation}
\begin{aligned}
R_{eff}(u,v)
\leq
 \frac{\frac{2}{c_1c_2}}{1 - \frac{2}{c_1c_2}} R_{eff}(C,u)
 = \frac{2}{c_1c_2 - 2} R_{eff}(C,u)
 \leq \frac{3}{c_1c_2} R_{eff}(C,u)
\,.
\end{aligned}
\label{eq:energy_Reff_1}
\end{equation}
Futhermore, note that
\[ R_{eff}(w,v) \leq R_{eff}(u,v) + r_e \leq
\left(\frac{2}{c_1c_2} + \frac{1}{c_1^2}\right) R_{eff}(C,v)
\leq \left(\frac{2}{c_1c_2} + \frac{1}{c_1^2}\right) (R_{eff}(C,w) + R_{eff}(w,v))
\,, \]
and so we have
\begin{equation}
\begin{aligned}
 R_{eff}(w,v)
\leq \frac{\frac{2}{c_1c_2} + \frac{1}{c_1^2}}{
	1 - \frac{2}{c_1c_2} - \frac{1}{c_1^2}
	} R_{eff}(C,w)
\leq 3\left(\frac{1}{c_1c_2} + \frac{1}{c_1^2}\right)
 R_{eff}(C,w)
\,.
\end{aligned}
\label{eq:energy_Reff_2}
\end{equation}
Now, by Lemma~\ref{lem:escape_prob} together with
(\ref{eq:energy_Reff_1}) we have
\[ p_v^{C\cup\{v\}}(u) \geq 1 - \frac{3}{c_1c_2} \]
and
with (\ref{eq:energy_Reff_2}) we have
\[ p_v^{C\cup\{v\}}(w) \geq 1 - 3 \left(\frac{1}{c_1c_2} + \frac{1}{c_1^2}\right)\,, \]
therefore
\[ \left|p_v^{C\cup\{v\}}(u) - p_v^{C\cup\{v\}}(w)\right| \leq 6\left(\frac{1}{c_1c_2} + \frac{1}{c_1^2}\right)\,. \]
So,
\begin{align*}
 \left|\pi_v^{C\cup\{v\}}(\boldsymbol{\mathit{B}}^\top \frac{q_e}{\sqrt{r_e}} \mathbf{1}_e)\right| \sqrt{R_{eff}(C,v)}
& =
\left|
p_v^{C\cup\{v\}}(u)
- p_v^{C\cup\{v\}}(w)
\right| \sqrt{\frac{R_{eff}(C,v)}{r_e}}\\
& \leq 6 \left(\frac{1}{c_1c_2} + \frac{1}{c_1^2}\right) \cdot c_1\\
& = 6 \left(\frac{1}{c_2} + \frac{1}{c_1}\right)\\
& = O\left(\frac{1}{c}\right)\,.
\end{align*}

Now, we will apply Lemma~\ref{lem:small-neighborhood2}
to prove that with high probability
$|Y| \leq \tO{\beta^{-1}}$. The reason we can apply the lemma
is that for any $e=(u,w)\in Y$,
we have
\[ R_{eff}(e,v) = \frac{1}{c_1c_2}R_{eff}(C,v) \leq \frac{1}{2} R_{eff}(C,v)\,,\]
and so $Y\subseteq N_E(v,R_{eff}(C,v) / 2)$.
Therefore, we get that
\begin{align*}
\sum\limits_{e=(u,w)\in Y}
\left|\pi_v^{C\cup\{v\}}(\boldsymbol{\mathit{B}}^\top \frac{q_e}{\sqrt{r_e}} \mathbf{1}_e)\right|
\sqrt{R_{eff}(C,v)}
\leq c^{-1} \cdot \tO{\beta^{-1}}\,.
\end{align*}
Overall, we conclude that
\[ \sqrt{\mathcal{E}_{\boldsymbol{\mathit{r}}}\left(
\boldsymbol{\mathit{\pi}}^{C\cup\{v\}}(\boldsymbol{\mathit{B}}^\top \frac{\boldsymbol{\mathit{q}}}{\sqrt{\boldsymbol{\mathit{r}}}})
-  \boldsymbol{\mathit{\pi}}^{C}(\boldsymbol{\mathit{B}}^\top \frac{\boldsymbol{\mathit{q}}}{\sqrt{\boldsymbol{\mathit{r}}}})\right)}
\leq (c + c^{-1}) \tO{\beta^{-2}}
= \tO{\beta^{-2}}\,,
\]
by setting $c$ to be a large enough constant.
\end{proof}

\subsection{Proof of Lemma~\ref{lem:old_projection_approximate}}
\label{sec:proof_old_projection_approximate}
\begin{proof}

We write
\begin{align*}
&  \boldsymbol{\mathit{\pi}}^{C^T,\boldsymbol{\mathit{r}}^T}\left(\boldsymbol{\mathit{B}}^\top\frac{\boldsymbol{\mathit{q}}^T}{\sqrt{\boldsymbol{\mathit{r}}^T}}\right) - \boldsymbol{\mathit{\pi}}^{C^0,\boldsymbol{\mathit{r}}^0}\left(\boldsymbol{\mathit{B}}^\top\frac{\boldsymbol{\mathit{q}}^0}{\sqrt{\boldsymbol{\mathit{r}}^0}}\right) \\
& =
\underbrace{\sum\limits_{\text{$i$ is an \textsc{AddTerminal}}}
\pi_{v^i}^{C^{i+1},\boldsymbol{\mathit{r}}^i}\left(\boldsymbol{\mathit{B}}^\top \frac{\boldsymbol{\mathit{q}}^{i}}{\sqrt{\boldsymbol{\mathit{r}}^{i}}}\right) \cdot \left(\mathbf{1}_{v^i} - \boldsymbol{\mathit{\pi}}^{C^i,\boldsymbol{\mathit{r}}^i}\left(\mathbf{1}_{v^i}\right)\right)}_{\boldsymbol{\mathit{d}}_{Add}}\\
& + \underbrace{\sum\limits_{i \text{ is an \textsc{Update}}} \boldsymbol{\mathit{\pi}}^{C^i,\boldsymbol{\mathit{r}}^i}\left(\boldsymbol{\mathit{B}}^\top \left(\frac{\boldsymbol{\mathit{q}}^{i+1}}{\sqrt{\boldsymbol{\mathit{r}}^{i+1}}} - \frac{\boldsymbol{\mathit{q}}^i}{\sqrt{\boldsymbol{\mathit{r}}^i}} \right) \mathbf{1}_{e^i}\right)}_{\boldsymbol{\mathit{d}}_{Upd}}\,,
\end{align*}
which implies that
\begin{align*}
\sqrt{\mathcal{E}_{\boldsymbol{\mathit{r}}^T} \left(
 \boldsymbol{\mathit{\pi}}^{C^T,\boldsymbol{\mathit{r}}^T}\left(\boldsymbol{\mathit{B}}^\top\frac{\boldsymbol{\mathit{q}}^T}{\sqrt{\boldsymbol{\mathit{r}}^T}}\right) - \boldsymbol{\mathit{\pi}}^{C^0,\boldsymbol{\mathit{r}}^0}\left(\boldsymbol{\mathit{B}}^\top\frac{\boldsymbol{\mathit{q}}^0}{\sqrt{\boldsymbol{\mathit{r}}^0}}\right)
\right)} \leq \sqrt{\mathcal{E}_{\boldsymbol{\mathit{r}}^T}(\boldsymbol{\mathit{d}}_{Add})}
 + \sqrt{\mathcal{E}_{\boldsymbol{\mathit{r}}^T}(\boldsymbol{\mathit{d}}_{Upd})}\,.
\end{align*}
We bound each of these terms separately.
For the second one, we have that
\begin{align*}
& \sqrt{\mathcal{E}_{\boldsymbol{\mathit{r}}^T}\left(\boldsymbol{\mathit{d}}_{Upd}\right)} \\
& \leq
	\sum\limits_{i \text{ is an \textsc{Update}}}
	\sqrt{\mathcal{E}_{\boldsymbol{\mathit{r}}^T}\left(\boldsymbol{\mathit{\pi}}^{C^i,\boldsymbol{\mathit{r}}^i}\left(\boldsymbol{\mathit{B}}^\top \left(\frac{\boldsymbol{\mathit{q}}^{i+1}}{\sqrt{\boldsymbol{\mathit{r}}^{i+1}}} - \frac{\boldsymbol{\mathit{q}}^{i}}{\sqrt{\boldsymbol{\mathit{r}}^{i}}}\right) \mathbf{1}_{e^i}\right)\right)}\\
& =
	\sum\limits_{i \text{ is an \textsc{Update}}}
	\sqrt{\mathcal{E}_{\boldsymbol{\mathit{r}}^T}\left(\boldsymbol{\mathit{B}}^\top \left(\frac{\boldsymbol{\mathit{q}}^{i+1}}{\sqrt{\boldsymbol{\mathit{r}}^{i+1}}} - \frac{\boldsymbol{\mathit{q}}^{i}}{\sqrt{\boldsymbol{\mathit{r}}^{i}}}\right) \mathbf{1}_{e^i}\right)}\\
& \leq
	\sum\limits_{i \text{ is an \textsc{Update}}}
	\left(\sqrt{\mathcal{E}_{\boldsymbol{\mathit{r}}^T}\left(\boldsymbol{\mathit{B}}^\top \frac{\boldsymbol{\mathit{q}}^{i+1}}{\sqrt{\boldsymbol{\mathit{r}}^{i+1}}} \mathbf{1}_{e^i}\right)}
	+
	\sqrt{\mathcal{E}_{\boldsymbol{\mathit{r}}^T}\left(\boldsymbol{\mathit{B}}^\top \frac{\boldsymbol{\mathit{q}}^{i}}{\sqrt{\boldsymbol{\mathit{r}}^{i}}} \mathbf{1}_{e^i}\right)}\right)\\
& \leq
	\max_i \left\|\frac{\boldsymbol{\mathit{r}}^T}{\boldsymbol{\mathit{r}}^i}\right\|_\infty^{1/2}
	\sum\limits_{i \text{ is an \textsc{Update}}}
	\left(\sqrt{\mathcal{E}_{\boldsymbol{\mathit{r}}^{i+1}}\left(\boldsymbol{\mathit{B}}^\top \frac{\boldsymbol{\mathit{q}}^{i+1}}{\sqrt{\boldsymbol{\mathit{r}}^{i+1}}} \mathbf{1}_{e^i}\right)}
	+
	\sqrt{\mathcal{E}_{\boldsymbol{\mathit{r}}^i}\left(\boldsymbol{\mathit{B}}^\top \frac{\boldsymbol{\mathit{q}}^{i}}{\sqrt{\boldsymbol{\mathit{r}}^{i}}} \mathbf{1}_{e^i}\right)}\right)\\
& \leq
	2 \max_i \left\|\frac{\boldsymbol{\mathit{r}}^T}{\boldsymbol{\mathit{r}}^i}\right\|_\infty^{1/2} T\,.
\end{align*}
For the first one, we have
\begin{align*}
& \sqrt{\mathcal{E}_{\boldsymbol{\mathit{r}}^T}\left(\boldsymbol{\mathit{d}}_{Add}\right)} \\
& \leq
\sum\limits_{\text{$i$ is an \textsc{AddTerminal}}}
\left|\pi_{v^i}^{C^{i+1},\boldsymbol{\mathit{r}}^i}\left(\boldsymbol{\mathit{B}}^\top \frac{\boldsymbol{\mathit{q}}^{i}}{\sqrt{\boldsymbol{\mathit{r}}^{i}}}\right)\right| \cdot \sqrt{\mathcal{E}_{\boldsymbol{\mathit{r}}^T}\left(\mathbf{1}_{v^i} - \boldsymbol{\mathit{\pi}}^{C^i,\boldsymbol{\mathit{r}}^i}\left(\mathbf{1}_{v^i}\right)\right)}\\
& \leq
\left\|\frac{\boldsymbol{\mathit{r}}^T}{\boldsymbol{\mathit{r}}^i}\right\|_{\infty}^{1/2}
\sum\limits_{\text{$i$ is an \textsc{AddTerminal}}}
\left|\pi_{v^i}^{C^{i+1},\boldsymbol{\mathit{r}}^i}\left(\boldsymbol{\mathit{B}}^\top \frac{\boldsymbol{\mathit{q}}^{i}}{\sqrt{\boldsymbol{\mathit{r}}^{i}}}\right)\right| \cdot \sqrt{\mathcal{E}_{\boldsymbol{\mathit{r}}^i}\left(\mathbf{1}_{v^i} - \boldsymbol{\mathit{\pi}}^{C^i,\boldsymbol{\mathit{r}}^i}\left(\mathbf{1}_{v^i}\right)\right)}\\
& \leq
\tO{\max_i \left\|\frac{\boldsymbol{\mathit{r}}^T}{\boldsymbol{\mathit{r}}^i}\right\|_{\infty}^{1/2}\beta^{-2}} \cdot T\,,
\end{align*}
where in the last inequality we used Lemma~\ref{lem:projection_change_energy}.
The desired statement now follows immediately.

\end{proof}

\subsection{Proof of Lemma~\ref{lem:locator}}
\label{sec:full_proof_lem_locator}

\begin{proof}
\noindent {\bf $\textsc{Initialize}(\boldsymbol{\mathit{f}})$}:
We set $\ss^+ = \boldsymbol{\mathit{u}} - \boldsymbol{\mathit{f}}$, $\ss^- = \boldsymbol{\mathit{f}}$, $\boldsymbol{\mathit{r}}^0 = \boldsymbol{\mathit{r}} = \frac{1}{(\ss^+)^2} + \frac{1}{(\ss^-)^2}$.

We first initialize a $\beta$-congestion reduction
subset $C$ based on Lemma~\ref{lem:cong_red}, which takes time
$\tO{m \beta^{-2}}$,
and a data structure $\textsc{DynamicSC}$ for maintaining the sparsified Schur Complement onto $C$,
as described in Appendix~\ref{sec:maintain_schur}, which
takes time $\tO{m \beta^{-4} \varepsilon^{-4}}$. We also set $C^0 = C$.

Then, we generate an $\tO{\varepsilon^{-2}}\times m$
sketching matrix $\boldsymbol{\mathit{Q}}$ as in~(Lemma 5.1, \cite{gao2021fully} v2),
which takes time $\tO{m \varepsilon^{-2}}$, and let its rows be $\boldsymbol{\mathit{q}}^i$
for $i\in[\tO{\varepsilon^{-2}}]$.

In order to compute the set of important edges, we use
Lemma~\ref{lem:approx_effective_res}
after contracting $C$, which shows that we can compute all resistances
of the form $R_{eff}(C,u)$ for $u\in V\backslash C$ up to a factor of $2$ in $\tO{m}$.
From these, we can get $4$-approximate estimates of $R_{eff}(C,e)$ for
$e\in E\backslash E(C)$, using the fact that
\[ \min\{R_{eff}(C,u),R_{eff}(C,w)\} \approx_{2} R_{eff}(C,e) \,.\]

Then, in $O(m)$ time, we can easily compute a set of edges $S$
such that
\begin{align*}
\{e\ |\ e \text{ is $\frac{\varepsilon\beta}{\alpha}$-important } \}
\subseteq S\subseteq \{e\ |\ e \text{ is $\frac{\varepsilon \beta}{4\alpha}$-important}\}
\end{align*}

We also need to sample the random walks that will be used inside the demand projection
data structures. We use (Lemma 5.15,~\cite{gao2021fully} v2) to sample
$h = \tO{\widehat{\eps}^{-4} \beta^{-6} + \widehat{\eps}^{-2} \beta^{-2} \gamma^{-2}}$
random walks for each $u\in V\backslash C$ and $e\in E\backslash E(C)$ with $u\in e$,
where we set $\gamma = \frac{\varepsilon}{4\alpha}$ so that $S$ is a
subset of $\gamma$-important edges. Note that, by Definition~\ref{def:locator},
a $\gamma$-important edge will always remain $\gamma$-important until
the \textsc{Locator} is re-initialized, as any edge's resistive
distance to $C$ can only decrease, and its own resistance is constant. Therefore
$S$ can be assumed to always be a subset of $\gamma$-important edges.

The runtime to sample the set $\mathcal{P}$ of these random walks is
\[ \tO{m h \beta^{-2}}
= \tO{m (\widehat{\eps}^{-4} \beta^{-8} + \widehat{\eps}^{-2} \beta^{-4} \gamma^{-2})}
= \tO{m (\widehat{\eps}^{-4} \beta^{-8} + \widehat{\eps}^{-2} \varepsilon^{-2}\alpha^2 \beta^{-4} )}\,.
\]

In order to be able to detect congested edges, we will initialize $\tO{\varepsilon^{-2}}$
demand projection data structures, with the guarantees from Lemma~\ref{lem:ds}.
We will maintain
an approximation to $\boldsymbol{\mathit{\pi}}^C(\boldsymbol{\mathit{B}}^\top \frac{\boldsymbol{\mathit{q}}_S^i}{\sqrt{\boldsymbol{\mathit{r}}}})$ for all $i\in\tO{\varepsilon^{-2}}$,
where $\boldsymbol{\mathit{q}}^i$ are the rows of the sketching matrix that we have generated,
as well as
$\boldsymbol{\mathit{\pi}}^{old} := \boldsymbol{\mathit{\pi}}^{C^0,\boldsymbol{\mathit{r}}^0}\left(\boldsymbol{\mathit{B}}^\top \frac{\boldsymbol{\mathit{p}}^0}{\sqrt{\boldsymbol{\mathit{r}}^0}}\right)$, where
$\boldsymbol{\mathit{p}}^0 = \sqrt{\boldsymbol{\mathit{r}}^0} g(\ss^0) = \frac{\frac{1}{\ss^{+,0}} - \frac{1}{\ss^{-,0}}}{\sqrt{\boldsymbol{\mathit{r}}^0}}$.

Specifically, we call
\[ \textsc{DP}^i.\textsc{Initialize}(C, \boldsymbol{\mathit{r}}, \boldsymbol{\mathit{q}}^i, S, \mathcal{P}) \]
for all $i\in[\tO{\varepsilon^{-2}}]$, and also exactly
compute $\boldsymbol{\mathit{\pi}}^{old}$, which can be done by calling
\[ \textsc{DemandProjector}.\textsc{Initialize}(C, \boldsymbol{\mathit{r}}, \boldsymbol{\mathit{p}}, [m], \mathcal{P})\,. \]

The total runtime for this operation is dominated by the random walk generation, and is
\[\tO{m (\widehat{\eps}^{-4} \beta^{-8} + \widehat{\eps}^{-2} \varepsilon^{-2}\alpha^2 \beta^{-4} )}\,.\]

\noindent {\bf $\textsc{Update}(e,\boldsymbol{\mathit{f}})$}:
We set $s_e^+ = u_e - f_e$, $s_e^- = f_e$, and $r_e = \frac{1}{(s_e^+)^2} + \frac{1}{(s_e^-)^2}$.
Then, we also set $p_e = \frac{\frac{1}{s_e^+} - \frac{1}{s_e^-}}{\sqrt{r_e}}$.

We distinguish two cases:
\begin{itemize}
\item{$e\in E(C)$:

In this case, we can simply call
\[ \textsc{DynamicSC}.\textsc{Update}(e, r_e) \]
and
\[ \textsc{DP}^i.\textsc{Update}(e, \boldsymbol{\mathit{r}}, \boldsymbol{\mathit{q}}) \]
for all $i\in[\tO{\varepsilon^{-2}}]$.
Note that we can do this as
$\textsc{DP}^i$ was initialized with resistances $\boldsymbol{\mathit{r}}^0$
and $\boldsymbol{\mathit{r}}^0 \approx_{\alpha} \boldsymbol{\mathit{r}}$.
}
\item{$e\in E\backslash E(C)$:

We let $e = (u,w)$. We want to insert $u$ and $w$ into $C$, but for doing that
$\textsc{DP}^i$'s require constant factor estimates of the resistances
$R_{eff}(C,u)$ and $R_{eff}(C\cup\{u\},w)$. In order to get these estimates,
we will use $\textsc{DynamicSC}$.

We first call
\[ \textsc{DynamicSC}.\textsc{AddTerminal}(u)\,, \]
which takes time $\tO{\beta^{-2} \varepsilon^{-2}}$ and returns
${\widetilde{R}}_{eff}(C,u) \approx_2 R_{eff}(C,u)$. Given this estimate,
we can call
\[ \textsc{DP}^i.\textsc{AddTerminal}(u, {\widetilde{R}}_{eff}(C,u))\,, \]
for all $i\in[\tO{\varepsilon^{-2}}]$, each
of which takes time
\[ \tO{\widehat{\eps}^{-4} \beta^{-8} + \widehat{\eps}^{-2} \beta^{-6} \gamma^{-2}}
= \tO{\widehat{\eps}^{-4} \beta^{-8} + \widehat{\eps}^{-2} \varepsilon^{-2} \alpha^2 \beta^{-6}} \,.\]

Now, we can set $C = C\cup\{u\}$ and repeat the same process
for $w$.

Finally, to update the resistance, note that we now have
$e\in E(C)$, so we apply the procedure from the first case.

}
\end{itemize}

Finally, if the total number of calls to
$\textsc{DP}^i.\textsc{AddTerminal}$ for some fixed $i$
since the last call to $\mathcal{L}.\textsc{BatchUpdate}(\emptyset)$
exceeds $\frac{\varepsilon}{\widehat{\eps} \alpha^{1/2}}$ (note that
the
number of calls is actually the same for all $i$),
we call $\mathcal{L}.\textsc{BatchUpdate}(\emptyset)$ in order to
re-initialize the demand projections.

We conclude that the total runtime is
\[ \tO{m \frac{\widehat{\eps} \alpha^{1/2}}{\varepsilon^{3}}
+ \widehat{\eps}^{-4} \varepsilon^{-2} \beta^{-8} +
\widehat{\eps}^{-2} \varepsilon^{-4} \alpha^2 \beta^{-6}} \,,\]
where the first term comes from amortizing the calls
to $\mathcal{L}.\textsc{BatchUpdate}(\emptyset)$, each of which,
as we will see, takes $\tO{m \varepsilon^{-2}}$.

\noindent {\bf $\textsc{BatchUpdate}(Z,\boldsymbol{\mathit{f}})$}:
First, for each $e\in Z$, we set
$s_e^+ = u_e - f_e$, $s_e^- = f_e$,
$r_e^0 = r_e = \frac{1}{(s_e^+)^2} + \frac{1}{(s_e^-)^2}$,
and $p_e^0 = p_e = \frac{\frac{1}{s_e^+} - \frac{1}{s_e^-}}{\sqrt{r_e}}$.

For each $e=(u,w)\in Z$, we call
\[ \textsc{DynamicSC}.\textsc{AddTerminal}(u)\]
and
\[ \textsc{DynamicSC}.\textsc{AddTerminal}(w)\]
(if $u$ and $w$ are not already in $C$), and then
we call
\[ \textsc{DynamicSC}.\textsc{Update}(e, r_e) \,. \]
Then, we set $C^0 = C = C\cup (\cup_{(u,w)\in Z}\{u,w\})$.
Additionally, we re-compute $\boldsymbol{\mathit{\pi}}^{old}$ based on the new
values of $C^0, \boldsymbol{\mathit{r}}^0, \boldsymbol{\mathit{p}}^0$.
All of this takes time $\tO{m + |Z| \beta^{-2} \varepsilon^{-2}}$.

Now, to pass these updates to the $\textsc{DemandProjector}$s, we first
have to re-compute the set of important edges $S$
(with the newly updated resistances)
as any set such that
\begin{align*}
\{e\ |\ e \text{ is $\frac{\varepsilon}{\alpha}$-important } \}
\subseteq S\subseteq \{e\ |\ e \text{ is $\frac{\varepsilon}{4\alpha}$-important}\}\,.
\end{align*}
As we have already argued, this takes $\tO{m}$.

Now, finally, we re-initialize all the $\textsc{DemandProjector}$s by calling
\[ \textsc{DP}^i.\textsc{Initialize}(C, \boldsymbol{\mathit{r}}, \boldsymbol{\mathit{q}}, S, \mathcal{P})\,. \]
for all $i\in[\tO{\varepsilon^{-2}}]$, where each call takes $\tO{m}$.

We conclude with a total runtime of
\[ \tO{m\varepsilon^{-2} + |Z| \beta^{-2} \varepsilon^{-2}} \,. \]

\noindent {\bf $\textsc{Solve}()$}: This operation performs
the main task of the locator,  which is to detect congested edges. We will do that by using
the approximate demand projections that we have been maintaining.

We remind that the congestion vector we are trying to approximate to
$O(\epsilon)$ additive accuracy is
\begin{align*}
\boldsymbol{\mathit{\rho}}^* = \delta \sqrt{\boldsymbol{\mathit{r}}}g(\ss) - \delta \boldsymbol{\mathit{R}}^{-1/2} \boldsymbol{\mathit{B}}\boldsymbol{\mathit{L}}^+ \boldsymbol{\mathit{B}}^\top g(\ss)\,.
\end{align*}
We will first reduce the problem of finding the entries of
$\boldsymbol{\mathit{\rho}}^*$ with magnitude $\geq \Omega(\varepsilon)$, to the problem of computing an
$O(\varepsilon)$-additive approximation to
\[ v_i^* = \delta \cdot \left\langle \boldsymbol{\mathit{\pi}}^C\left(\boldsymbol{\mathit{B}}^\top \frac{\boldsymbol{\mathit{q}}_S^i}{\sqrt{\boldsymbol{\mathit{r}}}}\right), \widetilde{SC}^+
\boldsymbol{\mathit{\pi}}^{C^0,\boldsymbol{\mathit{r}}^0}\left(\boldsymbol{\mathit{B}}^\top \frac{\boldsymbol{\mathit{p}}^0}{\sqrt{\boldsymbol{\mathit{r}}^0}}\right)\right\rangle \]
for all $i\in[\tO{\varepsilon^{-2}}]$,
where $\widetilde{SC}$ is the approximate Schur complement maintained in $\textsc{DynamicSC}$.
Then, we will see how to approximate $v_i^*$ to additive accuracy
$O(\varepsilon)$ using the demand projection data structures.

First of all, note that, by definition of $g(\ss) = \frac{\frac{1}{\ss^+} - \frac{1}{\ss^-}}{\boldsymbol{\mathit{r}}}$,
\[ \left\|\delta \sqrt{\boldsymbol{\mathit{r}}} g(\ss)\right\|_\infty \leq \delta \leq \varepsilon\,, \]
so this term can be ignored.

Using Lemma~\ref{lem:non-projected-demand-contrib}, we get that
\[ \delta \left\|\boldsymbol{\mathit{R}}^{-1/2} \boldsymbol{\mathit{B}} \boldsymbol{\mathit{L}}^+
(\boldsymbol{\mathit{B}}^\top g(\ss) - \boldsymbol{\mathit{\pi}}^{C}(\boldsymbol{\mathit{B}}^\top g(\ss)))\right\|_\infty
\leq \delta \cdot \tO{\beta^{-2}} \leq \varepsilon / 2 \,. \]
This means that the entries of the vector
\[ \delta \boldsymbol{\mathit{R}}^{-1/2} \boldsymbol{\mathit{B}} \boldsymbol{\mathit{L}}^+
\boldsymbol{\mathit{\pi}}^{C}(\boldsymbol{\mathit{B}}^\top g(\ss)) \]
that have magnitude $\leq \varepsilon$ do not correspond to
the $\Omega(\varepsilon)$-congested edges that we are looking for.

Now, we set $T = |C \backslash C^0|$, where
$C^0$ was the congestion reduction subset during the last call to $\textsc{BatchUpdate}$,
and apply Lemma~\ref{lem:old_projection_approximate}. This shows that
\[ \sqrt{\mathcal{E}_{\boldsymbol{\mathit{r}}}\left(\boldsymbol{\mathit{\pi}}^{old} - \boldsymbol{\mathit{\pi}}^{C}\left(\boldsymbol{\mathit{B}}^\top g(\ss)\right)\right)
} \leq \tO{\alpha^{1/2}\beta^{-2}} \cdot T \,.\]
Therefore, if we define
\[ \boldsymbol{\mathit{\rho}} = -\delta\boldsymbol{\mathit{R}}^{-1/2}\boldsymbol{\mathit{B}} \boldsymbol{\mathit{L}}^+ \boldsymbol{\mathit{\pi}}^{old}\,, \]
we conclude that
\[ \left\|\boldsymbol{\mathit{\rho}} - \boldsymbol{\mathit{\rho}}^*\right\|_\infty
\leq O(\varepsilon) +
\delta \left\|\boldsymbol{\mathit{R}}^{-1/2} \boldsymbol{\mathit{B}} \boldsymbol{\mathit{L}}^+
\left(\boldsymbol{\mathit{\pi}}^{old} - \boldsymbol{\mathit{\pi}}^{C}\left(\boldsymbol{\mathit{B}}^\top g(\ss)\right)\right) \right\|_\infty
\leq O(\varepsilon) + \delta T \cdot \tO{\alpha^{1/2} \beta^{-2}}
\leq O(\varepsilon)\,,
\]
where we used the fact that $T = \frac{\varepsilon}{\widehat{\eps} \alpha^{1/2}} \leq
\frac{\varepsilon}{\delta \beta^{-2} \alpha^{1/2}}$.
Therefore it suffices to estimate $\boldsymbol{\mathit{\rho}}$ up to $O(\varepsilon)$-additive accuracy.

Now, note that, by definition, no edge $e\in E\backslash S$ %
is $\varepsilon / \alpha$-important with respect to $\boldsymbol{\mathit{r}}^0$ and $C^0$.
By using Lemma~\ref{st_projection1_energy}, for each such edge we get
\begin{align*}
& \delta \left|\boldsymbol{\mathit{R}}^{-1/2} \boldsymbol{\mathit{B}} \boldsymbol{\mathit{L}}^+ \boldsymbol{\mathit{\pi}}^{old}\right|_e\\
& \leq \delta \sqrt{\mathcal{E}_{\boldsymbol{\mathit{r}}}\left(\boldsymbol{\mathit{\pi}}^{C^0}\left(\boldsymbol{\mathit{B}}^\top \frac{\mathbf{1}_e}{\sqrt{\boldsymbol{\mathit{r}}}}\right)\right)}\sqrt{\mathcal{E}_{\boldsymbol{\mathit{r}}}(\boldsymbol{\mathit{\pi}}^{old})}\\
& \leq \delta \alpha \sqrt{\mathcal{E}_{\boldsymbol{\mathit{r}}^0}\left(\boldsymbol{\mathit{\pi}}^{C^0}\left(\boldsymbol{\mathit{B}}^\top \frac{\mathbf{1}_e}{\sqrt{\boldsymbol{\mathit{r}}}}\right)\right)}\sqrt{\mathcal{E}_{\boldsymbol{\mathit{r}}^0}(\boldsymbol{\mathit{\pi}}^{old})}\\
& \leq \delta \alpha \cdot \frac{\varepsilon}{\alpha} \cdot O(\sqrt{m})\\
& = O(\varepsilon) \,,
\end{align*}
where we also used the fact that
$\mathcal{E}_{\boldsymbol{\mathit{r}}^0}(\boldsymbol{\mathit{\pi}}^{C^0,\boldsymbol{\mathit{r}}^0}(g(\ss^0)))
\leq O(\mathcal{E}_{\boldsymbol{\mathit{r}}^0}(g(\ss)))$.
Therefore it suffices to approximate
\[ \boldsymbol{\mathit{\rho}}' = \delta \boldsymbol{\mathit{I}}_S \boldsymbol{\mathit{R}}^{-1/2} \boldsymbol{\mathit{B}} \boldsymbol{\mathit{L}}^+ \boldsymbol{\mathit{\pi}}^{old} \,.\]

Note that here we can replace
$\boldsymbol{\mathit{L}}^+$ by
$\begin{pmatrix}-\boldsymbol{\mathit{L}}_{FF}^{-1} \boldsymbol{\mathit{L}}_{FC} \\ \boldsymbol{\mathit{I}}\end{pmatrix} \widetilde{SC}^+$
where $\widetilde{SC} \approx_{1+\varepsilon} SC$ and only lose another additive
$\varepsilon$ error, as
\begin{align*}
& \delta \left|\left\langle
\mathbf{1}_e, \boldsymbol{\mathit{R}}^{-1/2} \boldsymbol{\mathit{B}} \boldsymbol{\mathit{L}}^+ \boldsymbol{\mathit{\pi}}^{old}\right\rangle
- \delta \left\langle \mathbf{1}_e,
\boldsymbol{\mathit{R}}^{-1/2} \boldsymbol{\mathit{B}} \begin{pmatrix}-\boldsymbol{\mathit{L}}_{FF}^{-1} \boldsymbol{\mathit{L}}_{FC}\\ \boldsymbol{\mathit{I}} \end{pmatrix}\widetilde{SC}^+ \boldsymbol{\mathit{\pi}}^{old}\right\rangle\right|\\
&
= \delta \left|\left\langle \boldsymbol{\mathit{\pi}}^{C}\left(\boldsymbol{\mathit{B}}^\top \frac{\mathbf{1}_e}{\sqrt{\boldsymbol{\mathit{r}}}}\right),
\left(SC^+ - \widetilde{SC}^+\right) \boldsymbol{\mathit{\pi}}^{old}\right\rangle\right|\\
& \leq O(\delta \varepsilon \cdot \sqrt{m})\\
& \leq O(\varepsilon) \,,
\end{align*}
where we used the fact that
\[ (1-\varepsilon) SC \preceq \widetilde{SC} \preceq (1+\varepsilon) SC \Rightarrow
-O(\varepsilon) \widetilde{SC}^+ \preceq SC^+ - \widetilde{SC}^+\preceq O(\varepsilon) \widetilde{SC}^+ \,.\]
and that
\begin{align*}
\sqrt{\mathcal{E}_{\boldsymbol{\mathit{r}}}\left(\boldsymbol{\mathit{\pi}}^{old}\right)}
& \leq
\sqrt{\mathcal{E}_{\boldsymbol{\mathit{r}}}\left(\boldsymbol{\mathit{\pi}}^C\left(\boldsymbol{\mathit{B}}^\top g(\ss)\right)\right)}
+ \sqrt{\mathcal{E}_{\boldsymbol{\mathit{r}}}\left(\boldsymbol{\mathit{\pi}}^{old} - \boldsymbol{\mathit{\pi}}^C\left(\boldsymbol{\mathit{B}}^\top g(\ss)\right)\right)}\\
& \leq O(m) + \tO{\alpha^{1/2} \beta^{-2}} \cdot T\\
& \leq O(m)\,,
\end{align*}
where we used the fact that $T = \frac{\varepsilon}{\widehat{\eps} \alpha^{1/2}}
\leq \frac{\varepsilon}{\delta \beta^{-2}\alpha^{1/2}}
\leq \frac{\sqrt{m}}{\beta^{-2}\alpha^{1/2}}
$.

Now, we will use the sketching lemma (Lemma 5.1, \cite{gao2021fully} v2),
which shows that in order to find all entries of
\[ \boldsymbol{\mathit{I}}_S \boldsymbol{\mathit{R}}^{-1/2} \boldsymbol{\mathit{B}} \begin{pmatrix}
-\boldsymbol{\mathit{L}}_{FF} \boldsymbol{\mathit{L}}_{FC} \\ \boldsymbol{\mathit{I}}\end{pmatrix}\widetilde{SC}^+ \boldsymbol{\mathit{\pi}}^{old} \]
with magnitude $\Omega(\varepsilon)$, it suffices to compute the inner
products
\begin{align*}
& \delta \left\langle \boldsymbol{\mathit{B}}^\top \frac{\boldsymbol{\mathit{q}}_S^i}{\sqrt{\boldsymbol{\mathit{r}}}},
\begin{pmatrix}-\boldsymbol{\mathit{L}}_{FF}^{-1} \boldsymbol{\mathit{L}}_{FC} \\ \boldsymbol{\mathit{I}} \end{pmatrix}
\widetilde{SC}^+
\boldsymbol{\mathit{\pi}}^{old}\right\rangle \\
& = \delta \left\langle \boldsymbol{\mathit{\pi}}^C\left(\boldsymbol{\mathit{B}}^\top \frac{\boldsymbol{\mathit{q}}_S^i}{\sqrt{\boldsymbol{\mathit{r}}}}\right),
\widetilde{SC}^+
\boldsymbol{\mathit{\pi}}^{old} \right\rangle
\end{align*}
for $i\in[\tO{\varepsilon^{-2}}]$,
up to additive accuracy
\[ \varepsilon \cdot \left\|\delta \boldsymbol{\mathit{I}}_S \boldsymbol{\mathit{R}}^{-1/2} \boldsymbol{\mathit{B}}
\begin{pmatrix}-\boldsymbol{\mathit{L}}_{FF}^{-1} \boldsymbol{\mathit{L}}_{FC} \\ \boldsymbol{\mathit{I}} \end{pmatrix}
\widetilde{SC}^+ \boldsymbol{\mathit{\pi}}^{old} \right\|_2^{-1}
\geq \Omega(\varepsilon) \,,
\]
where we used the fact that
\begin{align*}
& \left\|\delta \boldsymbol{\mathit{I}}_S \boldsymbol{\mathit{R}}^{-1/2} \boldsymbol{\mathit{B}}  \begin{pmatrix}-\boldsymbol{\mathit{L}}_{FF}^{-1} \boldsymbol{\mathit{L}}_{FC} \\ \boldsymbol{\mathit{I}} \end{pmatrix}
\widetilde{SC}^+ \boldsymbol{\mathit{\pi}}^{old} \right\|_2^2\\
& = \delta^2
\langle
\widetilde{SC}^+
\boldsymbol{\mathit{\pi}}^{old},
\begin{pmatrix}-\boldsymbol{\mathit{L}}_{CF} \boldsymbol{\mathit{L}}_{FF}^{-1} & \boldsymbol{\mathit{I}} \end{pmatrix}
\boldsymbol{\mathit{L}}
\begin{pmatrix}-\boldsymbol{\mathit{L}}_{FF}^{-1} \boldsymbol{\mathit{L}}_{FC} \\ \boldsymbol{\mathit{I}} \end{pmatrix}
\widetilde{SC}^+ \boldsymbol{\mathit{\pi}}^{old} \rangle\\
& = \delta^2
\left\langle
\widetilde{SC}^+
\boldsymbol{\mathit{\pi}}^{old},
\begin{pmatrix}-\boldsymbol{\mathit{L}}_{CF} \boldsymbol{\mathit{L}}_{FF}^{-1} & \boldsymbol{\mathit{I}} \end{pmatrix}
\begin{pmatrix}\boldsymbol{\mathit{L}}_{FF} & \boldsymbol{\mathit{L}}_{FC} \\ \boldsymbol{\mathit{L}}_{CF} & \boldsymbol{\mathit{L}}_{CC}\end{pmatrix}
\begin{pmatrix}-\boldsymbol{\mathit{L}}_{FF}^{-1} \boldsymbol{\mathit{L}}_{FC} \\ \boldsymbol{\mathit{I}} \end{pmatrix}
\widetilde{SC}^+ \boldsymbol{\mathit{\pi}}^{old} \right\rangle\\
& = \delta^2
\left\langle
\widetilde{SC}^+
\boldsymbol{\mathit{\pi}}^{old},
SC
\widetilde{SC}^+ \boldsymbol{\mathit{\pi}}^{old} \right\rangle\\
& \leq 2
\delta^2
\left\langle
\boldsymbol{\mathit{\pi}}^{old},
\widetilde{SC}^+ \boldsymbol{\mathit{\pi}}^{old} \right\rangle\\
& \leq O(\delta^2 m)\\
& = O(1)\,.
\end{align*}

Now, for the second part of the proof, we would like to compute $\boldsymbol{\mathit{v}}$ such that
$\left\|\boldsymbol{\mathit{v}}-\boldsymbol{\mathit{v}}^*\right\|_\infty \leq O(\varepsilon)$, where we remind that
\[ \boldsymbol{\mathit{v}}^* = \left\langle \boldsymbol{\mathit{\pi}}^C\left(\boldsymbol{\mathit{B}}^\top \frac{\boldsymbol{\mathit{q}}_S^i}{\sqrt{\boldsymbol{\mathit{r}}}}\right), \widetilde{SC}^+ \boldsymbol{\mathit{\pi}}^{old}
\right\rangle \,. \]
Note that we already have estimates $\widetilde{\boldsymbol{\mathit{\pi}}}^C\left(\boldsymbol{\mathit{B}}^\top \frac{\boldsymbol{\mathit{q}}_S^i}{\sqrt{\boldsymbol{\mathit{r}}}}\right)$
given by $\textsc{DP}^i$ for all $i\in[\tO{\varepsilon^{-2}}]$. We obtain these estimates by calling
\[ \textsc{DP}^i.\textsc{Output}() \]
each of which takes time $O(\beta m)$.
By the guarantees of Definition~\ref{def:demand_projector}, with high probability we have
\begin{align*}
    & \delta \left|
     \left\langle \widetilde{\boldsymbol{\mathit{\pi}}}^C\left(\boldsymbol{\mathit{B}}^\top \frac{\boldsymbol{\mathit{q}}^i_S}{\sqrt{\boldsymbol{\mathit{r}}}}\right)
	 -\boldsymbol{\mathit{\pi}}^C\left(\boldsymbol{\mathit{B}}^\top \frac{\boldsymbol{\mathit{q}}^i_S}{\sqrt{\boldsymbol{\mathit{r}}}}\right),
    \widetilde{SC}^+
	\boldsymbol{\mathit{\pi}}^{old}
    \right\rangle
    \right| \leq \widehat{\eps} \sqrt{\alpha} T\,,
\end{align*}
where we used the fact that
\[ E_{\boldsymbol{\mathit{r}}}(\delta \cdot \widetilde{SC}^+ \boldsymbol{\mathit{\pi}}^{old}) \leq O(1)\,. \]
Now, since by definition $\textsc{BatchUpdate}$ is called
every $\frac{\varepsilon}{\widehat{\eps}\alpha^{1/2}}$ calls to $\textsc{Update}$,
We have $T \leq \frac{\varepsilon}{\widehat{\eps}\alpha^{1/2}}$ and so
\begin{align*}
    & \delta \left|
     \left\langle \widetilde{\boldsymbol{\mathit{\pi}}}^C\left(\boldsymbol{\mathit{B}}^\top \frac{\boldsymbol{\mathit{q}}^i_S}{\sqrt{\boldsymbol{\mathit{r}}}}\right)
	 -\boldsymbol{\mathit{\pi}}^C\left(\boldsymbol{\mathit{B}}^\top \frac{\boldsymbol{\mathit{q}}^i_S}{\sqrt{\boldsymbol{\mathit{r}}}}\right),
    \widetilde{SC}^+
	\boldsymbol{\mathit{\pi}}^{old}
    \right\rangle
    \right| \leq \varepsilon\,.
\end{align*}
This means that, running the algorithm from (Lemma 5.1, \cite{gao2021fully} v2),
we can obtain an edge set of size $\tO{\varepsilon^{-2}}$ that contains all edges
such that
$\left|\rho_e^*\right| \geq c \cdot \varepsilon$ for some constant $c > 0$.
By rescaling $\varepsilon$ to get the right constant, we obtain all edges
such that $\left|\rho_e^*\right| \geq \varepsilon / 2$ with high probability.
The runtime is dominated by the time to get $\widetilde{SC}$ and apply its inverse,
and is $\tO{\beta m \varepsilon^{-2}}$.

\paragraph{Success probability} We will argue that $\mathcal{L}$ uses $\textsc{DynamicSC}$ and the $\textsc{DP}^i$ as an oblivious
adversary. First of all, note that no randomness is injected into the inputs of
$\textsc{DynamicSC}$, as they are all coming form the inputs of $\mathcal{L}$.

Regarding $\textsc{DP}^i$, note that its only output is given by the call to
$\textsc{DP}^i.\textsc{Output}$. However, note that its output is only used
to estimate the inner product
\[ \left\langle \boldsymbol{\mathit{\pi}}^C\left(\boldsymbol{\mathit{B}}^\top \frac{\boldsymbol{\mathit{q}}_S^i}{\sqrt{\boldsymbol{\mathit{r}}}}\right), \widetilde{SC}^+ \boldsymbol{\mathit{\pi}}_{old} \right\rangle\,, \]
from which we obtain the set of congested edges and we directly return it
from $\mathcal{L}$. Thus, it does not influence the state of $\mathcal{L},\textsc{DynamicSC}$ or any future inputs.

\end{proof}

\section{Deferred Proofs from Section~\ref{sec:ipm}}
\subsection{Central path stability bounds}
\label{proof_stability_bounds}
\begin{lemma}[Central path energy stability]
Consider a minimum cost flow instance on a graph $G(V,E)$.
For any $\mu > 0$ and
$\mu' = \mu / (1+1/\sqrt{m})^k$ for some $k \in (0,\sqrt{m}/10)$, we have
\begin{align*}
\sum\limits_{e\in E} \left(\frac{1}{s_e(\mu)^+\cdot s_e(\mu')^+} + \frac{1}{s_e(\mu)^-\cdot s_e(\mu')^-}\right) \left(f_e(\mu') - f_e(\mu)\right)^2
\leq 2k^2
\end{align*}
\label{lem:energy_stability}
\end{lemma}

\begin{proof}[Proof of Lemma~\ref{lem:energy_stability}]
We let $\delta = 1/\sqrt{m}$,
$\boldsymbol{\mathit{f}} = \boldsymbol{\mathit{f}}(\mu)$, $\ss = \ss(\mu)$,
$\boldsymbol{\mathit{r}} = \boldsymbol{\mathit{r}}(\mu)$, $\boldsymbol{\mathit{f}}' = \boldsymbol{\mathit{f}}(\mu')$, $\ss'= \ss(\mu')$,
and
$\boldsymbol{\mathit{r}}' = \boldsymbol{\mathit{r}}(\mu')$.
We also set $\boldsymbol{\mathit{\widetilde{f}}} = \boldsymbol{\mathit{f}}' - \boldsymbol{\mathit{f}}$.
By definition of centrality we have
\begin{align*}
& \boldsymbol{\mathit{C}}^\top \left(\frac{1}{\ss^-} - \frac{1}{\ss^+}\right) = \boldsymbol{\mathit{C}}^\top \frac{\boldsymbol{\mathit{c}}}{\mu}\\
& \boldsymbol{\mathit{C}}^\top \left(\frac{1}{\ss^- + \boldsymbol{\mathit{\widetilde{f}}}} - \frac{1}{\ss^+ - \boldsymbol{\mathit{\widetilde{f}}}}\right) = \boldsymbol{\mathit{C}}^\top \frac{\boldsymbol{\mathit{c}}}{\mu'}\,,
\end{align*}
which, after subtracting, give
\begin{align*}
& \boldsymbol{\mathit{C}}^\top \left(\frac{1}{\ss^- + \boldsymbol{\mathit{\widetilde{f}}}} - \frac{1}{\ss^-} - \frac{1}{\ss^+ - \boldsymbol{\mathit{\widetilde{f}}}} + \frac{1}{\ss^+}\right) = \boldsymbol{\mathit{C}}^\top \left(\frac{\boldsymbol{\mathit{c}}}{\mu'} - \frac{\boldsymbol{\mathit{c}}}{\mu}\right)\\
& \Leftrightarrow \boldsymbol{\mathit{C}}^\top \left(\left(\frac{1}{\ss^-(\ss^- + \boldsymbol{\mathit{\widetilde{f}}})}  +\frac{1}{\ss^+(\ss^+ - \boldsymbol{\mathit{\widetilde{f}}})}\right)\boldsymbol{\mathit{\widetilde{f}}}\right)
= -\left((1 + \delta)^k - 1\right)\boldsymbol{\mathit{C}}^\top \frac{\boldsymbol{\mathit{c}}}{\mu}\,.
\end{align*}
As $\boldsymbol{\mathit{\widetilde{f}}} = \boldsymbol{\mathit{C}}\boldsymbol{\mathit{x}}$ for some $\boldsymbol{\mathit{x}}$, after taking the inner product of both sides with $\boldsymbol{\mathit{x}}$ we get
\begin{align}
& \left\langle \boldsymbol{\mathit{\widetilde{f}}}, \left(\frac{1}{\ss^-(\ss^- + \boldsymbol{\mathit{\widetilde{f}}})}  +\frac{1}{\ss^+(\ss^+ - \boldsymbol{\mathit{\widetilde{f}}})}\right)\boldsymbol{\mathit{\widetilde{f}}}\right\rangle = -\left((1+\delta)^k - 1\right) \left\langle\frac{\boldsymbol{\mathit{c}}}{\mu},\boldsymbol{\mathit{\widetilde{f}}}\right\rangle\,.
\label{eq:energy_stable_prelim}
\end{align}

We will now prove that $-\left\langle\frac{\boldsymbol{\mathit{c}}}{\mu},\boldsymbol{\mathit{\widetilde{f}}}\right\rangle \leq k \sqrt{m}$.
First of all, by differentiating the centrality condition
\[ \boldsymbol{\mathit{C}}^\top \left(\frac{\boldsymbol{\mathit{c}}}{\nu} + \frac{\mathbf{1}}{\ss(\nu)^+} - \frac{\mathbf{1}}{\ss(\nu)^-}\right) = \mathbf{0}\]
with respect to $\nu$ we get
\[ \boldsymbol{\mathit{C}}^\top \left(-\frac{\boldsymbol{\mathit{c}}}{\nu^2} +
\left(\frac{\mathbf{1}}{(\ss(\nu)^+)^2} + \frac{\mathbf{1}}{(\ss(\nu)^-)^2}\right) \frac{d\boldsymbol{\mathit{f}}(\nu)}{d\nu}
\right) = \mathbf{0} \,,\]
or equivalently
\[ \boldsymbol{\mathit{C}}^\top \left(\boldsymbol{\mathit{r}}(\nu) \frac{d\boldsymbol{\mathit{f}}(\nu)}{d\nu}\right) =
-\frac{1}{\nu} \boldsymbol{\mathit{C}}^\top \left(\frac{\mathbf{1}}{\ss(\nu)^+} - \frac{\mathbf{1}}{\ss(\nu)^-}\right) \,.\]
If we set $g(\ss) = \frac{\frac{\mathbf{1}}{\ss^+}-\frac{\mathbf{1}}{\ss^-}}{\boldsymbol{\mathit{r}}}$, this can also be equivalently
written as
\[ \frac{d\boldsymbol{\mathit{f}}(\nu)}{d\nu} =
-\frac{1}{\nu} \left(g(\ss(\nu)) - (\boldsymbol{\mathit{R}}(\nu))^{-1}\boldsymbol{\mathit{B}} (\boldsymbol{\mathit{B}}^\top (\boldsymbol{\mathit{R}}(\nu)^{-1})\boldsymbol{\mathit{B}})^+ \boldsymbol{\mathit{B}}^\top g(\ss(\nu))\right)\,.\]
We have
\begin{align*}
-\left\langle\frac{\boldsymbol{\mathit{c}}}{\mu},\boldsymbol{\mathit{\widetilde{f}}}\right\rangle
& = -\int_{\nu=\mu}^{\mu'}\left\langle\frac{\boldsymbol{\mathit{c}}}{\mu}, d\boldsymbol{\mathit{f}}(\nu) \right\rangle\\
& = \frac{1}{\mu}\int_{\nu=\mu}^{\mu'}\left\langle\frac{\nu}{\ss(\nu)^-} - \frac{\nu}{\ss(\nu)^+}, \frac{1}{\nu}
\left(g(\ss(\nu)) - (\boldsymbol{\mathit{R}}(\nu))^{-1}\boldsymbol{\mathit{B}}(\boldsymbol{\mathit{B}}^\top (\boldsymbol{\mathit{R}}(\nu))^{-1} \boldsymbol{\mathit{B}})^+ \boldsymbol{\mathit{B}}^\top g(\ss(\nu))\right) \right\rangle d\nu\\
& = -\frac{1}{\mu}\int_{\nu=\mu}^{\mu'}\left\langle \sqrt{\boldsymbol{\mathit{r}}(\nu)} g(\ss(\nu)),
\boldsymbol{\mathit{\Pi}}_{\mathrm{ker}(\boldsymbol{\mathit{B}}^\top (\boldsymbol{\mathit{R}}(\nu))^{-1/2})} \sqrt{\boldsymbol{\mathit{r}}(\nu)}g(\ss(\nu)) \right\rangle d\nu\\
& = \frac{1}{\mu}\int_{\nu=\mu'}^{\mu}\left\|\boldsymbol{\mathit{\Pi}}_{\mathrm{ker}(\boldsymbol{\mathit{B}}^\top (\boldsymbol{\mathit{R}}(\nu))^{-1/2})} \sqrt{\boldsymbol{\mathit{r}}(\nu)}g(\ss(\nu)) \right\|_2^2 d\nu\\
& \leq \frac{1}{\mu}\int_{\nu=\mu'}^{\mu}\left\|\sqrt{\boldsymbol{\mathit{r}}(\nu)}g(\ss(\nu)) \right\|_2^2 d\nu\\
& \leq \frac{1}{\mu}\int_{\nu=\mu'}^{\mu} m d\nu\\
& = m \frac{\mu - \mu'}{\mu}\\
& =  m(1 - (1+\delta)^{-k})\\
& \leq \delta k m\\
&  =  k \sqrt{m}\,,
\end{align*}
where $\boldsymbol{\mathit{\Pi}}_{\mathrm{ker}(\boldsymbol{\mathit{B}}^\top(\boldsymbol{\mathit{R}}(\nu))^{-1/2})}
 =\boldsymbol{\mathit{I}} -
(\boldsymbol{\mathit{R}}(\nu))^{-1/2}\boldsymbol{\mathit{B}}
 (\boldsymbol{\mathit{B}}^\top (\boldsymbol{\mathit{R}}(\nu))^{-1}\boldsymbol{\mathit{B}})^+\boldsymbol{\mathit{B}}^\top (\boldsymbol{\mathit{R}}(\nu))^{-1/2}$ is
the orthogonal projection onto the kernel of $\boldsymbol{\mathit{B}}^\top (\boldsymbol{\mathit{R}}(\nu))^{-1/2}$.

Plugging this into (\ref{eq:energy_stable_prelim}) and using the fact
that $(1+\delta)^k \leq 1+1.1\delta k = 1 + 1.1 k / \sqrt{m}$, we get
\begin{align*}
\sum\limits_{e\in E} \left(\frac{1}{s_e(\mu)^+\cdot s_e(\mu')^+} + \frac{1}{s_e(\mu)^-\cdot s_e(\mu')^-}\right) \left(f_e(\mu') - f_e(\mu)\right)^2
\leq 2k^2\,.
\end{align*}
\end{proof}

We give an auxiliary lemma which converts between different kinds of slack approximations.
\begin{lemma}
We consider flows $\boldsymbol{\mathit{f}},\boldsymbol{\mathit{f}}'$ with slacks $\ss,\ss'$ and resistances $\boldsymbol{\mathit{r}},\boldsymbol{\mathit{r}}'$.
Then,
\[ \max\left\{\left|\frac{s_e'^+-s_e^+}{s_e^+}\right|,\left|\frac{s_e'^--s_e^-}{s_e^-}\right|\right\}\leq \sqrt{r_e} \left|f_e' - f_e\right| \leq \sqrt{2}\max\left\{\left|\frac{s_e'^+-s_e^+}{s_e^+}\right|,\left|\frac{s_e'^--s_e^-}{s_e^-}\right|\right\}\]
and if $r_e\not\approx_{1+\gamma} r_e'$ for some $\gamma\in(0,1)$,
then $\sqrt{r_e}\left|f_e' - f_e\right| \geq \gamma/6$.
\label{lem:approx_conversion}
\end{lemma}
\begin{proof}
For the first one, note that
\begin{align*}
r_e = \frac{1}{(s_e^+)^2} + \frac{1}{(s_e^-)^2}
\in\left[\max\left\{\frac{1}{(s_e^+)^2} ,\frac{1}{(s_e^-)^2}\right\}, 2\max\left\{\frac{1}{(s_e^+)^2}, \frac{1}{(s_e^-)^2}\right\}\right]\,.
\end{align*}
Together with the fact that
$\left|f_e'-f_e\right| = \left|s_e'^+-s_e^+\right| = \left|s_e'^--s_e^-\right|$, it implies
the first statement.

For the second one,
without loss of generality let
$s_e^+ \leq s_e^-$, so by the previous statement
we have $\sqrt{r_e}\left|f_e' - f_e\right|
\geq \frac{\left|s_e'^+ - s_e^+\right|}{s_e^+}$.
If this is $<\gamma/6$ then
$(1-\gamma/6) s_e^+ \leq s_e'^+ \leq (1 + \gamma/6) s_e^+$,
so $s_e'^+ \approx_{1+\gamma/3} s_e^+$.
However, we also have that
$\frac{\left|s_e'^- - s_e^-\right|}{s_e^-} \leq
\frac{\left|s_e'^+ - s_e^+\right|}{s_e^+}
\leq \gamma /6$,
so $s_e'^- \approx_{1+\gamma/3} s_e^-$.
Therefore,
$r_e' = \frac{1}{(s_e'^+)^2} + \frac{1}{(s_e'^-)^2}
\approx_{1+\gamma}
\frac{1}{(s_e^+)^2} + \frac{1}{(s_e^-)^2}  =
r_e$, a contradiction.
\end{proof}
The following lemma is a fine-grained explanation of how resistances can change.
\begin{lemma}
Consider a minimum cost flow instance on a graph $G(V,E)$ and
parameters $\mu > 0$ and $\mu' \geq \mu / (1+1/\sqrt{m})^{k}$, where $k \in(0,\sqrt{m} / 10)$.
For any $e\in E$ and $\gamma\in(0,1)$
we let $\mathrm{change}(e,\gamma)$ be the largest integer $t(e)\geq 0$
such that there are real numbers
$\mu = \mu_{1}(e) >
\mu_{2}(e) >
\dots >
\mu_{t(e)+1}(e) = \mu'$
with
$\sqrt{r_e(\mu_i)} \left|f_e(\mu_{i+1}) - f_e(\mu_i)\right| \geq \gamma$
for all $i\in[t(e)]$.

Then,
$\sum\limits_{e\in E} \left(\mathrm{change}(e,\gamma)\right)^2 \leq O(k^2 / \gamma^2)$.

\label{lem:resistance_stability1}
\end{lemma}
\begin{proof}[Proof of Lemma~\ref{lem:resistance_stability1}]
First, we assume that without loss of generality,
$r_e(\mu_{i+1}(e)) \approx_{(1+6\gamma)^2} r_e(\mu_i(e))$
for all $e\in E$ and $i\in[t(e)]$.
If this is not true, then by continuity
there exists a $\nu\in(\mu_{i+1},\mu_i)$ such that
$r_e(\mu_{i+1}(e)) \not\approx_{1+6\gamma} r_e(\nu)$
and $r_e(\nu) \not\approx_{1+6\gamma} r_e(\mu_i(e))$.
By Lemma~\ref{lem:approx_conversion}, this implies that
$\sqrt{r_e(\mu_{i+1}(e))} \left|f_e(\nu) - f_e(\mu_{i+1}(e))\right| \geq \gamma$
and
$\sqrt{r_e(\nu)} \left|f_e(\mu_{i}(e)) - f_e(\nu)\right| \geq \gamma$.
Therefore we can break the interval $(\mu_{i+1},\mu_i)$ into
$(\mu_{i+1},\nu)$
and $(\nu,\mu_{i})$ and make the statement stronger.

Similarly, we also assume that
$r_e(\nu) \approx_{(1+6\gamma)^3} r_e(\mu_i(e))$
for all $e\in E$, $i\in[t(e)]$, and $\nu\in(\mu_{i+1},\mu_i)$. If this is
not the case, then by using the fact that
$r_e(\mu_{i+1}(e)) \approx_{(1+6\gamma)^2} r_e(\mu_i(e))$, we also get that
$r_e(\mu_{i+1}) \not \approx_{1+6\gamma} r_e(\nu)$,
and so we can again break the interval as before and obtain a stronger statement.

Now, we look at the following integral:
\[ \mathcal{E} := \int_{\nu=\mu}^{\mu'} \sum\limits_{e\in E} r_e(\nu)
\left(\frac{df_e(\nu)}{d\nu}\right)^2 \left|d\nu\right|\,, \]
where $df_e(\nu)$ is the differential of the flow $f_e(\nu)$ with respect to
the centrality parameter.
Similarly to Lemma~\ref{lem:energy_stability}, we use the following equation
that describes how the flow changes:
\[ \frac{d\boldsymbol{\mathit{f}}(\nu)}{d\nu} =
-\frac{1}{\nu} \left(g(\ss(\nu)) - (\boldsymbol{\mathit{R}}(\nu))^{-1}\boldsymbol{\mathit{B}} (\boldsymbol{\mathit{B}}^\top (\boldsymbol{\mathit{R}}(\nu)^{-1})\boldsymbol{\mathit{B}})^+ \boldsymbol{\mathit{B}}^\top g(\ss(\nu))\right)\,.\]
This implies that
\begin{align*}
\left\|\sqrt{\boldsymbol{\mathit{r}}(\nu)} \frac{d\boldsymbol{\mathit{f}}(\nu)}{d\nu}\right\|_2^2
& =
\frac{1}{\nu^2} \left\|\sqrt{\boldsymbol{\mathit{r}}(\nu)}g(\ss(\nu)) - (\boldsymbol{\mathit{R}}(\nu))^{-1/2}\boldsymbol{\mathit{B}} (\boldsymbol{\mathit{B}}^\top (\boldsymbol{\mathit{R}}(\nu)^{-1})\boldsymbol{\mathit{B}})^+ \boldsymbol{\mathit{B}}^\top g(\ss(\nu))\right\|_2^2\\
& \leq
\frac{1}{\nu^2} \left\|\left(I - (\boldsymbol{\mathit{R}}(\nu))^{-1/2}\boldsymbol{\mathit{B}} (\boldsymbol{\mathit{B}}^\top (\boldsymbol{\mathit{R}}(\nu)^{-1})\boldsymbol{\mathit{B}})^+ \boldsymbol{\mathit{B}}^\top(\boldsymbol{\mathit{R}}(\nu))^{-1/2}\right)
\sqrt{\boldsymbol{\mathit{r}}}g(\ss(\nu))\right\|_2^2\\
& \leq
\frac{1}{\nu^2} \left\|
\sqrt{\boldsymbol{\mathit{r}}}g(\ss(\nu))\right\|_2^2\\
&\leq \frac{m}{\nu^2}\,,
\end{align*}
and so
\begin{align}
 \mathcal{E} \leq
\int_{\nu=\mu}^{\mu'} \frac{m}{\nu^2} \left|d\nu\right|
= m \left(\frac{1}{\mu'} - \frac{1}{\mu}\right)
\leq m \frac{1.1\delta k}{\mu}
= 1.1 k \sqrt{m} / \mu\,.
\label{eq:integral_upper_bound}
\end{align}
On the other hand, for any $e\in E$ and $i\in[t(e)]$ we have
\begin{align*}
\int_{\nu=\mu_i(e)}^{\mu_{i+1}(e)} r_e(\nu) \left(\frac{df_e(\nu)}{d\nu}\right)^2 \left|d\nu\right|
& \geq
\frac{r_e(\mu_i(e))}{(1+6\gamma)^3}
\int_{\nu=\mu_i(e)}^{\mu_{i+1}(e)} \left(\frac{df_e(\nu)}{d\nu}\right)^2 \left|d\nu\right| \\
& \geq
\frac{r_e(\mu_i(e))}{(1+6\gamma)^3}
\frac{\left(\int_{\nu=\mu_i(e)}^{\mu_{i+1}(e)}
\left|\frac{df_e(\nu)}{d\nu}\right| \left|d\nu\right|\right)^2}
{
\int_{\nu=\mu_i(e)}^{\mu_{i+1}(e)} \left|d\nu\right|
}\\
& =
\frac{r_e(\mu_i(e))}{(1+6\gamma)^3(\mu_i(e) - \mu_{i+1}(e))}
\left(f(\mu_i(e)) - f(\mu_{i+1}(e))\right)^2\\
& \geq
\frac{\gamma^2}{36(1+6\gamma)^3(\mu_i(e) - \mu_{i+1}(e))}\,,
\end{align*}
where we used the Cauchy-Schwarz inequality.
Now, note that
\begin{align*}
\int_{\nu=\mu_1(e)}^{\mu_{t(e)+1}(e)} r_e(\nu) \left(\frac{df_e(\nu)}{d\nu}\right)^2 \left|d\nu\right|
& \geq
\sum\limits_{i=1}^{t(e)} \frac{\gamma^2}{(1+6\gamma)^3(\mu_i(e) - \mu_{i+1}(e))}\\
& \geq
\frac{\gamma^2 (t(e))^2}{(1+6\gamma)^3(\mu - \mu')}\\
& \geq
\frac{\gamma^2 (t(e))^2\sqrt{m}}{(1+6\gamma)^3 k\mu}\,,
\end{align*}
where remember that $t(e) = \mathrm{change}(e,\gamma)$
and we again used Cauchy-Schwarz.
Summing this up for all $e\in E$ and combining with (\ref{eq:integral_upper_bound}),
we get that
$\sum\limits_{e\in E} (\mathrm{change}(e,\gamma))^2 \leq O(k^2 / \gamma^2)$.
\end{proof}

\begin{lemma}[Central path $\ell_\infty$ slack stability]
Consider a minimum cost flow instance on a graph $G(V,E)$.
For any $\mu > 0$ and
$\mu' = \mu / (1+1/\sqrt{m})^k$ for some $k \in (0,\sqrt{m}/10)$, we have
\begin{align*}
\ss(\mu') \approx_{3k^2} \ss(\mu)\,.
\end{align*}
\label{lem:resistance_stability2}
\end{lemma}
\begin{proof}[Proof of Lemma~\ref{lem:resistance_stability2}]
By Lemma~\ref{lem:energy_stability}, for any $e\in E$ we have that
\begin{align}
\left(\frac{1}{s_e(\mu)^+\cdot s_e(\mu')^+} + \frac{1}{s_e(\mu)^-\cdot s_e(\mu')^-}\right) \left(f_e(\mu') - f_e(\mu)\right)^2
\leq 2k^2\,.
\label{eq:edge_energy_stability}
\end{align}

If $s_e(\mu')^+ = (1+c)\cdot s_e(\mu)^+$ for some $c\geq 0$, then
\[ (f_e(\mu') - f_e(\mu))^2 = c^2 (s_e(\mu)^+)^2\]
and
\[s_e(\mu)^+\cdot s_e(\mu')^+ = (1+c) (s_e(\mu)^+)^2\,,\]
so by (\ref{eq:edge_energy_stability}) we have that $c \leq 3k^2$.

Similarly, if $s_e(\mu')^+ = (1+c)^{-1} \cdot s_e(\mu)^+$ for some $c \geq 0$, then
\[ (f_e(\mu') - f_e(\mu))^2 = c^2 (s_e(\mu')^+)^2\]
and
\[ s_e(\mu)^+\cdot s_e(\mu')^+ = (1+c) (s_e(\mu')^+)^2\,,\]
so by (\ref{eq:edge_energy_stability}) we have that $c \leq 3k^2$.

We have proved that $s_e(\mu')^+\approx_{3k^2} s_e(\mu)^+$ and by symmetry we also have
$s_e(\mu')^- \approx_{3k^2} s_e(\mu)^-$.
\end{proof}

\subsection{Proof of Lemma~\ref{lem:approx_central}}
\label{sec:proof_lem_approx_central}

Our goal is to keep track of
how close $\boldsymbol{\mathit{f}}^*$ remains to centrality (in $\ell_2$ norm) and
how close $\boldsymbol{\mathit{f}}$ remains to $\boldsymbol{\mathit{f}}^*$ in $\ell_\infty$ norm.
From these two we can conclude that at all times $\boldsymbol{\mathit{f}}$ is close in $\ell_\infty$
to the central flow.
We first prove the following lemma, which bounds how the distance
of $\boldsymbol{\mathit{f}}^*$ to centrality (measured in energy of the residual)
degrades when taking a progress step.
\begin{lemma}
Let $\boldsymbol{\mathit{f}}^*$ be a flow with slacks $\ss^*$ and resistances $\boldsymbol{\mathit{r}}^*$, %
and $\boldsymbol{\mathit{f}}$ be a flow with slacks $\ss$ and resistances $\boldsymbol{\mathit{r}}$,
where $\ss\approx_{1+\epsilon_{\mathrm{solve}}} \ss^*$ for some $\epsilon_{\mathrm{solve}} \in(0,0.1)$.
We define
$\boldsymbol{\mathit{f}}'^* = \boldsymbol{\mathit{f}}^* + \epsilon_{\mathrm{step}}\boldsymbol{\mathit{\widetilde{f}}}^*$
for some $\epsilon_{\mathrm{step}} \in(0,0.1)$ (and the new slacks $\ss'^*$), where
\begin{align}
& \boldsymbol{\mathit{\widetilde{f}}}^* = \delta g(\ss) - \delta \boldsymbol{\mathit{R}}^{-1}\boldsymbol{\mathit{B}}(\boldsymbol{\mathit{B}}^\top \boldsymbol{\mathit{R}}^{-1} \boldsymbol{\mathit{B}})^+ \boldsymbol{\mathit{B}}^\top g(\ss) \,,
\label{eq:ipm_step}
\end{align}
$\delta = \frac{1}{\sqrt{m}}$,
and $g(\ss) := \frac{\frac{1}{\ss^+} - \frac{1}{\ss^-}}{\boldsymbol{\mathit{r}}}$.
If we let $\boldsymbol{\mathit{h}} = \frac{\boldsymbol{\mathit{c}}}{\mu} + \frac{1}{\ss^{*+}} - \frac{1}{\ss^{*-}}$
and
$\boldsymbol{\mathit{h}}' = \frac{\boldsymbol{\mathit{c}}(1+\epsilon_{\mathrm{step}}\delta)}{\mu} + \frac{1}{\ss'^{*+}} - \frac{1}{\ss'^{*-}}$
be the residuals of $\boldsymbol{\mathit{f}}^*$ and $\boldsymbol{\mathit{f}}'^*$ for some $\mu > 0$,
then
\[
\left\|\boldsymbol{\mathit{C}}^\top \boldsymbol{\mathit{h}}'\right\|_{\boldsymbol{\overline{\mathit{H}}}^+} \leq
(1+\epsilon_{\mathrm{step}}\delta)
\left\|\boldsymbol{\mathit{C}}^\top \boldsymbol{\mathit{h}}\right\|_{\boldsymbol{\overline{\mathit{H}}}^+}
+
5 \left\|\frac{\boldsymbol{\mathit{r}}^*}{\boldsymbol{\mathit{\bar{r}}}}\right\|_\infty^{1/2} \epsilon_{\mathrm{solve}} \cdot \epsilon_{\mathrm{step}} +
2\left\|\frac{\boldsymbol{\mathit{r}}'^*}{\boldsymbol{\mathit{\bar{r}}}}\right\|_\infty^{1/2} \epsilon_{\mathrm{step}}^2
\,,
\] where $\boldsymbol{\mathit{\bar{r}}}$ are some arbitrary resistances and
$\boldsymbol{\overline{\mathit{H}}} = \boldsymbol{\mathit{C}}^\top \overline{\boldsymbol{\mathit{R}}} \boldsymbol{\mathit{C}}$.
\label{lem:ipm_step}
\end{lemma}
\begin{proof}
Let $\boldsymbol{\mathit{\rho}}^+ = \epsilon_{\mathrm{step}} \boldsymbol{\mathit{\widetilde{f}}}^* / \ss^{*+}$ and $\boldsymbol{\mathit{\rho}}^- = -\epsilon_{\mathrm{step}}\boldsymbol{\mathit{\widetilde{f}}}^* /\ss^{*-}$.
First of all, it is easy to see that
\begin{align*}
\left\|\boldsymbol{\mathit{\rho}}\right\|_2
&\leq \left\|\frac{\ss}{\ss^*}\right\|_\infty \left\|\frac{\ss^*}{\ss}\boldsymbol{\mathit{\rho}}\right\|_2\\
&\leq \epsilon_{\mathrm{step}}(1+\epsilon_{\mathrm{solve}})\left\|\boldsymbol{\mathit{\widetilde{f}}}^*\right\|_{\boldsymbol{\mathit{r}},2}\\
& = \epsilon_{\mathrm{step}}\delta(1+\epsilon_{\mathrm{solve}}) \left\|\sqrt{\boldsymbol{\mathit{r}}}g(\ss) - \boldsymbol{\mathit{R}}^{-1/2} \boldsymbol{\mathit{B}} (\boldsymbol{\mathit{B}}^\top \boldsymbol{\mathit{R}}^{-1}\boldsymbol{\mathit{B}})^+ \boldsymbol{\mathit{B}}^\top g(\ss)\right\|_{2}\\
& = \epsilon_{\mathrm{step}}\delta (1+\epsilon_{\mathrm{solve}})\left\|\left(\boldsymbol{\mathit{I}} - \boldsymbol{\mathit{R}}^{-1/2} \boldsymbol{\mathit{B}} (\boldsymbol{\mathit{B}}^\top \boldsymbol{\mathit{R}}^{-1}\boldsymbol{\mathit{B}})^+ \boldsymbol{\mathit{B}}^\top\boldsymbol{\mathit{R}}^{-1/2}\right) \sqrt{\boldsymbol{\mathit{r}}}g(\ss)\right\|_{2}\\
& \leq \epsilon_{\mathrm{step}}\delta (1+\epsilon_{\mathrm{solve}})\left\|\sqrt{\boldsymbol{\mathit{r}}}g(\ss)\right\|_{2}\\
& = \epsilon_{\mathrm{step}}\delta (1+\epsilon_{\mathrm{solve}})\left\|\frac{\frac{1}{\ss^+} - \frac{1}{\ss^-}}{\sqrt{\frac{1}{(\ss^+)^2} + \frac{1}{(\ss^-)^2}}}\right\|_{2}\\
& \leq \epsilon_{\mathrm{step}} \delta (1+\epsilon_{\mathrm{solve}})\sqrt{m}\\
& = \epsilon_{\mathrm{step}}(1+\epsilon_{\mathrm{solve}})\,.
\end{align*}
We bound the energy to route the residual of $\boldsymbol{\mathit{f}}'^*$ as
\begin{align*}
& \left\|\boldsymbol{\mathit{C}}^\top \boldsymbol{\mathit{h}}'\right\|_{\boldsymbol{\overline{\mathit{H}}}^+} \\
& =  \left\|\boldsymbol{\mathit{C}}^\top \boldsymbol{\mathit{h}} + \boldsymbol{\mathit{C}}^\top \left(\frac{\epsilon_{\mathrm{step}}\delta \boldsymbol{\mathit{c}}}{\mu} + \frac{1}{\ss'^{*+}} - \frac{1}{\ss^{*+}} - \frac{1}{\ss'^{*-}} + \frac{1}{\ss^{*-}}\right) \right\|_{\boldsymbol{\overline{\mathit{H}}}^{+}}\\
& =  \left\|\boldsymbol{\mathit{C}}^\top \boldsymbol{\mathit{h}} +
\boldsymbol{\mathit{C}}^\top \left(\frac{\epsilon_{\mathrm{step}}\delta \boldsymbol{\mathit{c}}}{\mu} +
\frac{\boldsymbol{\mathit{\rho}}^+}{\ss'^{*+}} - \frac{\boldsymbol{\mathit{\rho}}^-}{\ss'^{*-}}
\right) \right\|_{\boldsymbol{\overline{\mathit{H}}}^{+}}\\
& =  \left\|\boldsymbol{\mathit{C}}^\top \boldsymbol{\mathit{h}} + \boldsymbol{\mathit{C}}^\top \left(\frac{\epsilon_{\mathrm{step}}\delta \boldsymbol{\mathit{c}}}{\mu} +
\frac{\boldsymbol{\mathit{\rho}}^+}{\ss^{*+}} - \frac{\boldsymbol{\mathit{\rho}}^-}{\ss^{*-}}\right) + \boldsymbol{\mathit{C}}^\top\left( \frac{(\boldsymbol{\mathit{\rho}}^+)^2}{\ss'^{*+}}  - \frac{(\boldsymbol{\mathit{\rho}}^-)^2}{\ss'^{*-}}\right)\right\|_{\boldsymbol{\overline{\mathit{H}}}^{+}}\,.
\end{align*}
Now, using (\ref{eq:ipm_step}) we get that
$\boldsymbol{\mathit{r}} \boldsymbol{\mathit{\widetilde{f}}}^* = \delta \boldsymbol{\mathit{r}} g(\ss) - \delta \boldsymbol{\mathit{B}} (\boldsymbol{\mathit{B}}^\top \boldsymbol{\mathit{R}}^{-1} \boldsymbol{\mathit{B}})^+ \boldsymbol{\mathit{B}}^\top g(\ss)$
and so
$\boldsymbol{\mathit{C}}^\top \left(\boldsymbol{\mathit{r}} \boldsymbol{\mathit{\widetilde{f}}}^*\right)
= \delta \boldsymbol{\mathit{C}}^\top \left(\boldsymbol{\mathit{r}} g(\ss)\right)$, which follows by the fact that for any $i$,
$\mathbf{1}_i^\top \boldsymbol{\mathit{C}}^\top \boldsymbol{\mathit{B}} = \left(\boldsymbol{\mathit{B}}^\top \boldsymbol{\mathit{C}} \mathbf{1}_i\right)^\top = \mathbf{0}$, since $\boldsymbol{\mathit{C}} \mathbf{1}_i$
is a circulation by definition of $\boldsymbol{\mathit{C}}$.
As $\boldsymbol{\mathit{r}} \boldsymbol{\mathit{\widetilde{f}}}^* =
\left(\frac{1}{(\ss^+)^2} + \frac{1}{(\ss^-)^2}\right) \boldsymbol{\mathit{\widetilde{f}}}^*
= \epsilon_{\mathrm{step}}^{-1} \frac{\ss^{*+}}{(\ss^+)^2}\boldsymbol{\mathit{\rho}}^+ - \epsilon_{\mathrm{step}}^{-1}\frac{\ss^{*-}}{(\ss^-)^2} \boldsymbol{\mathit{\rho}}^-
$, we have
$\epsilon_{\mathrm{step}} \delta \boldsymbol{\mathit{C}}^\top \left(\boldsymbol{\mathit{r}} g(\ss)\right) = \boldsymbol{\mathit{C}}^\top \left(\frac{\ss^{*+}}{(\ss^+)^2}\boldsymbol{\mathit{\rho}}^+ -
\frac{\ss^{*-}}{(\ss^-)^2}\boldsymbol{\mathit{\rho}}^-\right)$ and so
\begin{align*}
& \left\|\boldsymbol{\mathit{C}}^\top \boldsymbol{\mathit{h}} + \boldsymbol{\mathit{C}}^\top \left(\frac{\epsilon_{\mathrm{step}}\delta \boldsymbol{\mathit{c}}}{\mu} +
\frac{\boldsymbol{\mathit{\rho}}^+}{\ss^{*+}} - \frac{\boldsymbol{\mathit{\rho}}^-}{\ss^{*-}}\right) + \boldsymbol{\mathit{C}}^\top\left( \frac{(\boldsymbol{\mathit{\rho}}^+)^2}{\ss'^{*+}}  - \frac{(\boldsymbol{\mathit{\rho}}^-)^2}{\ss'^{*-}}\right)\right\|_{\boldsymbol{\overline{\mathit{H}}}^{+}}\\
& =\left\|\boldsymbol{\mathit{C}}^\top \boldsymbol{\mathit{h}} + \boldsymbol{\mathit{C}}^\top \left(
\frac{\epsilon_{\mathrm{step}} \delta \boldsymbol{\mathit{c}}}{\mu} + \epsilon_{\mathrm{step}}\delta \boldsymbol{\mathit{r}} g(\ss) -\frac{\ss^{*+}}{(\ss^{+})^2}\boldsymbol{\mathit{\rho}}^+ + \frac{\ss^{*-}}{(\ss^{-})^2} \boldsymbol{\mathit{\rho}}^-
+ \frac{\boldsymbol{\mathit{\rho}}^+}{\ss^{*+}} - \frac{\boldsymbol{\mathit{\rho}}^-}{\ss^{*-}}\right) + \boldsymbol{\mathit{C}}^\top\left( \frac{(\boldsymbol{\mathit{\rho}}^+)^2}{\ss'^{*+}}  -\frac{(\boldsymbol{\mathit{\rho}}^-)^2}{\ss'^{*-}}\right)\right\|_{\boldsymbol{\overline{\mathit{H}}}^{+}}\\
& =  \Big\|\boldsymbol{\mathit{C}}^\top \boldsymbol{\mathit{h}}
+ \epsilon_{\mathrm{step}} \delta \boldsymbol{\mathit{C}}^\top \left(\frac{\boldsymbol{\mathit{c}}}{\mu} + \boldsymbol{\mathit{r}} g(\ss)\right)
+ \boldsymbol{\mathit{C}}^\top \left(\left(
\mathbf{1} - \left(\frac{\ss^{*+}}{\ss^+}\right)^2\right) \frac{\boldsymbol{\mathit{\rho}}^+}{\ss^{*+}}
- \left(\mathbf{1} - \left(\frac{\ss^{*-}}{\ss^-}\right)^2\right) \frac{\boldsymbol{\mathit{\rho}}^-}{\ss^{*-}}\right)\\
& + \boldsymbol{\mathit{C}}^\top\left( \frac{(\boldsymbol{\mathit{\rho}}^+)^2}{\ss'^{*+}} - \frac{(\boldsymbol{\mathit{\rho}}^-)^2}{\ss'^{*-}}\right)\Big\|_{\boldsymbol{\overline{\mathit{H}}}^{+}}\\
& \leq (1+\epsilon_{\mathrm{step}}\delta)\left\|\boldsymbol{\mathit{C}}^\top \boldsymbol{\mathit{h}}\right\|_{\boldsymbol{\overline{\mathit{H}}}^{+}}
+ 5 \left\|\frac{\boldsymbol{\mathit{r}}^*}{\boldsymbol{\mathit{\bar{r}}}}\right\|_\infty^{1/2} \epsilon_{\mathrm{solve}} \cdot \epsilon_{\mathrm{step}} +
2 \left\|\frac{\boldsymbol{\mathit{r}}'^{*}}{\boldsymbol{\mathit{\bar{r}}}}\right\|_\infty^{1/2} \epsilon_{\mathrm{step}}^2
\end{align*}
where we have used the triangle inequality, the fact that
\begin{align*}
& \epsilon_{\mathrm{step}}\delta \left\|\boldsymbol{\mathit{C}}^\top \left(\frac{\boldsymbol{\mathit{c}}}{\mu} + \boldsymbol{\mathit{r}} g(\ss)\right)\right\|_{\boldsymbol{\overline{\mathit{H}}}^{+}}\\
& = \epsilon_{\mathrm{step}}\delta \left\|\boldsymbol{\mathit{C}}^\top \left(\frac{\boldsymbol{\mathit{c}}}{\mu} + \frac{1}{\ss^+} - \frac{1}{\ss^-}\right)\right\|_{\boldsymbol{\overline{\mathit{H}}}^{+}}\\
& \leq \epsilon_{\mathrm{step}}\delta \left\|\boldsymbol{\mathit{C}}^\top \left(\frac{\boldsymbol{\mathit{c}}}{\mu} + \frac{1}{\ss^{*+}} - \frac{1}{\ss^{*-}}\right)\right\|_{\boldsymbol{\overline{\mathit{H}}}^{+}}
+\epsilon_{\mathrm{step}}\delta \left\|\boldsymbol{\mathit{C}}^\top \left(\frac{1}{\ss^+} - \frac{1}{\ss^{*+}} - \frac{1}{\ss^-} + \frac{1}{\ss^{*-}}\right)\right\|_{\boldsymbol{\overline{\mathit{H}}}^{+}}\\
& \leq \epsilon_{\mathrm{step}}\delta \left\|\boldsymbol{\mathit{C}}^\top \left(\frac{\boldsymbol{\mathit{c}}}{\mu} + \frac{1}{\ss^{*+}} - \frac{1}{\ss^{*-}}\right)\right\|_{\boldsymbol{\overline{\mathit{H}}}^{+}}
+\epsilon_{\mathrm{step}}\delta
\left\|\frac{\boldsymbol{\mathit{r}}^*}{\boldsymbol{\mathit{\bar{r}}}}\right\|_\infty^{1/2} \left\|\boldsymbol{\mathit{C}}^\top \left(\frac{1}{\ss^+} - \frac{1}{\ss^{*+}} - \frac{1}{\ss^-} + \frac{1}{\ss^{*-}}\right)\right\|_{(\boldsymbol{\mathit{C}}^\top \boldsymbol{\mathit{R}}^* \boldsymbol{\mathit{C}})^{+}}\\
& \leq \epsilon_{\mathrm{step}}\delta \left\|\boldsymbol{\mathit{C}}^\top \boldsymbol{\mathit{h}}\right\|_{\boldsymbol{\overline{\mathit{H}}}^{+}}
+ \epsilon_{\mathrm{step}}\delta
\left\|\frac{\boldsymbol{\mathit{r}}^*}{\boldsymbol{\mathit{\bar{r}}}}\right\|_\infty^{1/2}
\left\|
\frac{\frac{1}{\ss^+} - \frac{1}{\ss^{*+}} - \frac{1}{\ss^-} + \frac{1}{\ss^{*-}}}{
	\left(\frac{1}{(\ss^{*+})^2} + \frac{1}{(\ss^{*-})^2}\right)^{1/2}}\right\|_2\\
& \leq \epsilon_{\mathrm{step}}\delta \left\|\boldsymbol{\mathit{C}}^\top \boldsymbol{\mathit{h}}\right\|_{\boldsymbol{\overline{\mathit{H}}}^{+}}
+ \epsilon_{\mathrm{step}}\delta
\left\|\frac{\boldsymbol{\mathit{r}}^*}{\boldsymbol{\mathit{\bar{r}}}}\right\|_\infty^{1/2}\left(
\left\|
\frac{\frac{1}{\ss^+} - \frac{1}{\ss^{*+}}}{
	\left(\frac{1}{(\ss^{*+})^2}\right)^{1/2}}\right\|_2 +
\left\|
\frac{\frac{1}{\ss^-} - \frac{1}{\ss^{*-}}}{
	\left(\frac{1}{(\ss^{*-})^2}\right)^{1/2}}\right\|_2\right)\\
& =\epsilon_{\mathrm{step}}\delta \left\|\boldsymbol{\mathit{C}}^\top \boldsymbol{\mathit{h}}\right\|_{\boldsymbol{\overline{\mathit{H}}}^{+}}
+ \epsilon_{\mathrm{step}}\delta
\left\|\frac{\boldsymbol{\mathit{r}}^*}{\boldsymbol{\mathit{\bar{r}}}}\right\|_\infty^{1/2}
\left(
\left\|
\frac{\ss^{*+}}{\ss^{+}} - \mathbf{1}\right\|_2 +
\left\|
	\frac{\ss^{*-}}{\ss^{-}} - \mathbf{1}
	\right\|_2\right)\\
& \leq\epsilon_{\mathrm{step}}\delta \left\|\boldsymbol{\mathit{C}}^\top \boldsymbol{\mathit{h}}\right\|_{\boldsymbol{\overline{\mathit{H}}}^{+}}
+ \epsilon_{\mathrm{step}}\delta
\left\|\frac{\boldsymbol{\mathit{r}}^*}{\boldsymbol{\mathit{\bar{r}}}}\right\|_\infty^{1/2} 2\epsilon_{\mathrm{solve}}\sqrt{m}
\text{ (as $\ss \approx_{1+\epsilon_{\mathrm{solve}}} \ss^*$) }
\\
& =\epsilon_{\mathrm{step}}\delta \left\|\boldsymbol{\mathit{C}}^\top \boldsymbol{\mathit{h}}\right\|_{\boldsymbol{\overline{\mathit{H}}}^{+}}
+ 2
\left\|\frac{\boldsymbol{\mathit{r}}^*}{\boldsymbol{\mathit{\bar{r}}}}\right\|_\infty^{1/2} \epsilon_{\mathrm{step}}\epsilon_{\mathrm{solve}}
\end{align*}
and similarly, using
$\left\|1 - \left(\frac{\ss^{*}}{\ss}\right)^2\right\|_\infty
\leq \epsilon_{\mathrm{solve}}(2+\epsilon_{\mathrm{solve}})$, the fact that
\begin{align*}
& \Big\|\boldsymbol{\mathit{C}}^\top \left(\left(
\mathbf{1} - \left(\frac{\ss^{*+}}{\ss^+}\right)^2\right) \frac{\boldsymbol{\mathit{\rho}}^+}{\ss^{*+}}
- \left(\mathbf{1} - \left(\frac{\ss^{*-}}{\ss^-}\right)^2\right) \frac{\boldsymbol{\mathit{\rho}}^-}{\ss^{*-}}\right)
+ \boldsymbol{\mathit{C}}^\top\left( \frac{(\boldsymbol{\mathit{\rho}}^+)^2}{\ss'^{*+}}  +\frac{(\boldsymbol{\mathit{\rho}}^-)^2}{\ss'^{*-}}\right)\Big\|_{\boldsymbol{\overline{\mathit{H}}}^{+}}\\
& \leq
\left\|\frac{\boldsymbol{\mathit{r}}^*}{\boldsymbol{\mathit{\bar{r}}}}\right\|_\infty^{1/2} \epsilon_{\mathrm{solve}}(2+\epsilon_{\mathrm{solve}})\left\|\boldsymbol{\mathit{\rho}}\right\|_2 + \left\|\frac{\boldsymbol{\mathit{r}}'^*}{\boldsymbol{\mathit{\bar{r}}}}\right\|_\infty^{1/2} \left\|\boldsymbol{\mathit{\rho}}\right\|_4^2\\
& \leq
\left\|\frac{\boldsymbol{\mathit{r}}^*}{\boldsymbol{\mathit{\bar{r}}}}\right\|_\infty^{1/2} \epsilon_{\mathrm{step}}\epsilon_{\mathrm{solve}}(2+\epsilon_{\mathrm{solve}})(1+\epsilon_{\mathrm{solve}}) +
\left\|\frac{\boldsymbol{\mathit{r}}'^*}{\boldsymbol{\mathit{\bar{r}}}}\right\|_\infty^{1/2} \epsilon_{\mathrm{step}}^2 (1+\epsilon_{\mathrm{solve}})^2\\
& \leq
3 \left\|\frac{\boldsymbol{\mathit{r}}^*}{\boldsymbol{\mathit{\bar{r}}}}\right\|_\infty^{1/2} \epsilon_{\mathrm{step}} \epsilon_{\mathrm{solve}} +
2 \left\|\frac{\boldsymbol{\mathit{r}}'^*}{\boldsymbol{\mathit{\bar{r}}}}\right\|_\infty^{1/2} \epsilon_{\mathrm{step}}^2\,.
\end{align*}
\end{proof}

We will also use the following lemma, which is standard~\cite{axiotis2020circulation}.

\begin{lemma}[Small residual implies $\ell_\infty$ closeness]
Given a flow $\boldsymbol{\mathit{f}} = \boldsymbol{\mathit{f}}^0 + \boldsymbol{\mathit{C}} \boldsymbol{\mathit{x}}$ with slacks $\ss$ and resistances $\boldsymbol{\mathit{r}}$,
if $\left\|\boldsymbol{\mathit{C}}^\top\left(\frac{\boldsymbol{\mathit{c}}}{\mu} + \frac{1}{\ss^+} - \frac{1}{\ss^-}\right)\right\|_{(\boldsymbol{\mathit{C}}^\top \boldsymbol{\mathit{R}} \boldsymbol{\mathit{C}})^+} \leq 1/1000$
then $\boldsymbol{\mathit{f}}$ is $(\mu,1.01)$-central.
\label{lem:small_residual_linfty}
\end{lemma}

Applying Lemma~\ref{lem:ipm_step} for $T=\frac{k}{\epsilon_{\mathrm{step}}}$ iterations, we get the lemma below,
which measures the closeness of $\boldsymbol{\mathit{f}}^*$ to the central path in $\ell_2$ after $T$ iterations.
\begin{lemma}[Centrality of $\boldsymbol{\mathit{f}}^*$]
Let $\boldsymbol{\mathit{f}}^{*1},\dots,\boldsymbol{\mathit{f}}^{*T+1}$
be flows with slacks $\ss^{*1},\dots,\ss^{*T+1}$
and resistances $\boldsymbol{\mathit{r}}^{*1},\dots,\boldsymbol{\mathit{r}}^{*T+1}$,
and $\boldsymbol{\mathit{f}}^{1},\dots,\boldsymbol{\mathit{f}}^{T+1}$
be flows with slacks $\ss^{1},\dots,\ss^{T+1}$ and resistances $\boldsymbol{\mathit{r}}^{1},\dots,\boldsymbol{\mathit{r}}^{T+1}$,
such that $\ss^t \approx_{1+\epsilon_{\mathrm{solve}}}\ss^{*t}$
for all $t\in [T]$,
where $T = \frac{k}{\epsilon_{\mathrm{step}}}$ for some $k\leq \sqrt{m} / 10$,
$\epsilon_{\mathrm{step}}\in(0,0.1)$ and $\epsilon_{\mathrm{solve}}\in(0,0.1)$.
Additionally, we have that
\begin{itemize}
\item $\boldsymbol{\mathit{f}}^{*1}$ is $\mu$-central
\item {For all $t\in[T]$, $\boldsymbol{\mathit{f}}^{*t+1} = \boldsymbol{\mathit{f}}^{*t} + \epsilon_{\mathrm{step}} \cdot \boldsymbol{\mathit{\widetilde{f}}}^t$, where
\[ \left\|\sqrt{\boldsymbol{\mathit{r}}^t}\left(\boldsymbol{\mathit{\widetilde{f}}}^{*t} - \boldsymbol{\mathit{\widetilde{f}}}^{t}\right) \right\|_\infty \leq \varepsilon\,, \]
\[
\boldsymbol{\mathit{\widetilde{f}}}^{*t} = \delta g(\ss^t) - \delta (\boldsymbol{\mathit{R}}^t)^{-1} \boldsymbol{\mathit{B}}\left(\boldsymbol{\mathit{B}}^\top (\boldsymbol{\mathit{R}}^t)^{-1} \boldsymbol{\mathit{B}}\right)^+
\boldsymbol{\mathit{B}}^\top g(\ss^t) \]
and
$\delta = \frac{1}{\sqrt{m}}$.
}
\end{itemize}
Then,
$\boldsymbol{\mathit{f}}^{*T+1}$ is $(\mu/(1+\epsilon_{\mathrm{step}}\delta)^{T},1.01)$-central,
as long as we set $\epsilon_{\mathrm{step}} \leq 10^{-5}k^{-3}$
and $\epsilon_{\mathrm{solve}} \leq 10^{-5} k^{-3}$.
\label{lem:small_residual}
\end{lemma}
\begin{proof}
For all $t\in[T+1]$, we denote the residual
of $\boldsymbol{\mathit{f}}^{*t}$ as
$\boldsymbol{\mathit{h}}^t =
\frac{\boldsymbol{\mathit{c}}(1+\epsilon_{\mathrm{step}}\delta)^{t-1}}{\mu}
+ \frac{1}{\ss^{+,*t}} - \frac{1}{\ss^{-,*t}}$.
Note that $\boldsymbol{\mathit{C}}^\top \boldsymbol{\mathit{h}}^1 = \mathbf{0}$ as $\boldsymbol{\mathit{f}}^{*1}$ is $\mu$-central.

We assume that the statement of the lemma is not true, and
let $\widehat{T}$ be the smallest $t\in [T+1]$ such that
$\boldsymbol{\mathit{f}}^{*t}$ is not $(\mu / (1 + \epsilon_{\mathrm{step}}\delta)^{t-1},1.01)$-central.
Obviously $\widehat{T} > 1$.
This means that $\boldsymbol{\mathit{f}}^{*t}$ is
$(\mu / (1 + \epsilon_{\mathrm{step}}\delta)^{t-1},1.01)$-central for all $t\in[\widehat{T}-1]$, i.e.
$\ss^{*t}\approx_{1.01} \ss\left(\mu / (1+\epsilon_{\mathrm{step}}\delta)^{t-1}\right)$.

Also, note that by Lemma~\ref{lem:resistance_stability2} about slack stability,
and since
$(1+\epsilon_{\mathrm{step}}\delta)^{\left|\widehat{T}-t\right|} \leq (1+\delta)^{1.1k}$,
we have
$\ss\left(\mu / (1+\epsilon_{\mathrm{step}}\delta)^{t-1}\right)
\approx_{3.7k^2} \ss\left(\mu / (1+\epsilon_{\mathrm{step}}\delta)^{\widehat{T}-1}\right)$ for all $t\in[T+1]$.
Additionally, note that, as shown in proof of Lemma~\ref{lem:ipm_step}, we have
\[ \left\|\boldsymbol{\mathit{\widetilde{f}}}^{*\widehat{T}-1}\right\|_{\boldsymbol{\mathit{r}}^{\widehat{T}-1},\infty} \leq
\left\|\boldsymbol{\mathit{\widetilde{f}}}^{*\widehat{T}-1}\right\|_{\boldsymbol{\mathit{r}}^{\widehat{T}-1},2} \leq 1 \,,\]
so
\begin{align*}
\left\|\frac{\ss^{*\widehat{T}}}{\ss^{*\widehat{T}-1}} - \mathbf{1}\right\|_\infty
& =\epsilon_{\mathrm{step}}\left\|\frac{\boldsymbol{\mathit{\widetilde{f}}}^{\widehat{T}-1}}{\ss^{*\widehat{T}-1}}\right\|_\infty\\
& \leq \epsilon_{\mathrm{step}}(1+\epsilon_{\mathrm{solve}})\left\|\sqrt{\boldsymbol{\mathit{r}}^{\widehat{T}-1}} \boldsymbol{\mathit{\widetilde{f}}}^{\widehat{T}-1}\right\|_\infty\\
& \leq \epsilon_{\mathrm{step}}(1+\epsilon_{\mathrm{solve}})\left(\left\|\sqrt{\boldsymbol{\mathit{r}}^{\widehat{T}-1}} \boldsymbol{\mathit{\widetilde{f}}}^{*\widehat{T}-1}\right\|_\infty + \varepsilon\right)\\
& \leq \epsilon_{\mathrm{step}}(1+\epsilon_{\mathrm{solve}})\left(1 + \varepsilon\right)\\
& \leq 1.3\epsilon_{\mathrm{step}}\,.
\end{align*}
From this we conclude that $\ss^{*\widehat{T}} \approx_{1+2.6\epsilon_{\mathrm{step}}} \ss^{*\widehat{T}-1}$, and from the previous
discussion we get that
\[\ss^{*\widehat{T}}
\approx_{1+2.6\epsilon_{\mathrm{step}}}
\ss^{*\widehat{T}-1}
\approx_{1.01}
\ss(\mu/(1+\epsilon_{\mathrm{step}}\delta)^{\widehat{T}-1})
\approx_{3.7k^2}
\ss(\mu/(1+\epsilon_{\mathrm{step}}\delta)^{t-1})
\approx_{1.01}
\ss^{*t}\,,\]
so
$\ss^{*\widehat{T}} \approx_{4k^2} \ss^{*t}$
for all $t\in[\widehat{T}-1]$.

On the other hand,
if we apply Lemma~\ref{lem:ipm_step} $\widehat{T}-1$ times
with $\boldsymbol{\mathit{\bar{r}}} = \boldsymbol{\mathit{r}}^{*\widehat{T}}$, we get
\begin{align*}
& \left\|\boldsymbol{\mathit{C}}^\top \boldsymbol{\mathit{h}}^{\widehat{T}}\right\|_{\left(\boldsymbol{\mathit{C}}^\top \boldsymbol{\mathit{R}}^{\widehat{T}}\boldsymbol{\mathit{C}}\right)^+} \\
& =\left\|\boldsymbol{\mathit{C}}^\top \boldsymbol{\mathit{h}}^{\widehat{T}}\right\|_{\boldsymbol{\overline{\mathit{H}}}^+} \\
& \leq
(1+\epsilon_{\mathrm{step}}\delta)
\left\|\boldsymbol{\mathit{C}}^\top \boldsymbol{\mathit{h}}^{{\widehat{T}}-1}\right\|_{\boldsymbol{\overline{\mathit{H}}}^+}
+ 5 \left\|\frac{\boldsymbol{\mathit{r}}^{*{\widehat{T}}-1}}{\boldsymbol{\mathit{\bar{r}}}}\right\|_\infty^{1/2} \epsilon_{\mathrm{step}} \cdot \epsilon_{\mathrm{solve}} +
2\left\|\frac{\boldsymbol{\mathit{r}}^{*\widehat{T}}}{\boldsymbol{\mathit{\bar{r}}}}\right\|_\infty^{1/2} \epsilon_{\mathrm{step}}^2\\
& \dots\\
& \leq
5 \sum\limits_{t=1}^{\widehat{T}-1} (1+\epsilon_{\mathrm{step}}\delta)^{\widehat{T}-t-1}
\left\|\frac{\boldsymbol{\mathit{r}}^{*t}}{\boldsymbol{\mathit{r}}^{*\widehat{T}}}\right\|_\infty^{1/2} \epsilon_{\mathrm{step}} \cdot \epsilon_{\mathrm{solve}}
+
2\sum\limits_{t=1}^{\widehat{T}-1} (1+\epsilon_{\mathrm{step}}\delta)^{\widehat{T}-t-1}
\left\|\frac{\boldsymbol{\mathit{r}}^{*t+1}}{\boldsymbol{\mathit{r}}^{*\widehat{T}}}\right\|_\infty^{1/2} \epsilon_{\mathrm{step}}^2\\
& \leq
6 T
\max_{t\in [\widehat{T}-1]} \left\|\frac{\boldsymbol{\mathit{r}}^{*t}}{\boldsymbol{\mathit{r}}^{*\widehat{T}}}\right\|_\infty^{1/2} \epsilon_{\mathrm{step}} \cdot \epsilon_{\mathrm{solve}}
+
2.4 T \max_{t\in [\widehat{T}-1]}
\left\|\frac{\boldsymbol{\mathit{r}}^{*t+1}}{\boldsymbol{\mathit{r}}^{*\widehat{T}}}\right\|_\infty^{1/2} \epsilon_{\mathrm{step}}^2\\
& \leq
24 T k^2 \epsilon_{\mathrm{step}} \cdot \epsilon_{\mathrm{solve}}
+
10 T k^2
\epsilon_{\mathrm{step}}^2 \\
& =
24
k^3 \epsilon_{\mathrm{solve}}
+
10
k^3
\epsilon_{\mathrm{step}}\\
& \leq 1/1000\,,
\end{align*}
where we used the fact that
$(1+\epsilon_{\mathrm{step}}\delta)^{\widehat{T}} \leq e^{\epsilon_{\mathrm{step}}\delta T} = e^{\delta k} \leq 1.2$
and our setting of $\epsilon_{\mathrm{solve}} \leq 10^{-5}k^{-3}$ and
$\epsilon_{\mathrm{step}} \leq 10^{-5}k^{-3}$.
By Lemma~\ref{lem:small_residual_linfty}
this implies that
$\boldsymbol{\mathit{f}}^{*\widehat{T}}$
is $(\mu / (1+\epsilon_{\mathrm{step}}\delta)^{\widehat{T}-1},1.01)$-central, a contradiction.

\end{proof}

We are now ready to prove the following lemma, which is the goal of this section:
\begin{replemma}{lem:approx_central}
Let $\boldsymbol{\mathit{f}}^1,\dots,\boldsymbol{\mathit{f}}^{T+1}$ be flows with
slacks $\ss^t$ and resistances $\boldsymbol{\mathit{r}}^t$ for $t\in[T+1]$,
where $T = \frac{k}{\epsilon_{\mathrm{step}}}$ for some $k\leq \sqrt{m}/10$
and $\epsilon_{\mathrm{step}} = 10^{-5}k^{-3}$, %
such that
\begin{itemize}
\item $\boldsymbol{\mathit{f}}^1$ is $(\mu,1+\epsilon_{\mathrm{solve}}/8)$-central for $\epsilon_{\mathrm{solve}} = 10^{-5} k^{-3}$ %
\item {For all $t\in[T]$,
$\boldsymbol{\mathit{f}}^{t+1} = \begin{cases}
\boldsymbol{\mathit{f}}(\mu) + \epsilon_{\mathrm{step}} \sum\limits_{i=1}^{t} \boldsymbol{\mathit{\widetilde{f}}}^i & \text{if $\exists i\in[t]:\boldsymbol{\mathit{\widetilde{f}}}^{i} \neq \mathbf{0}$}\\
\boldsymbol{\mathit{f}}^1 & \text{otherwise}
\end{cases}$, where
\[
\boldsymbol{\mathit{\widetilde{f}}}^{*t} = \delta g(\ss^t) - \delta (\boldsymbol{\mathit{R}}^t)^{-1} \boldsymbol{\mathit{B}}\left(\boldsymbol{\mathit{B}}^\top (\boldsymbol{\mathit{R}}^t)^{-1} \boldsymbol{\mathit{B}}\right)^+ \boldsymbol{\mathit{B}}^\top g(\ss^t) \]
for $\delta = \frac{1}{\sqrt{m}}$ and
\[ \left\|\sqrt{\boldsymbol{\mathit{r}}^t}\left(\boldsymbol{\mathit{\widetilde{f}}}^{*t} - \boldsymbol{\mathit{\widetilde{f}}}^{t}\right) \right\|_\infty \leq \varepsilon \]
for $\varepsilon = 10^{-6} k^{-6}$.
}
\end{itemize}
Then, setting $\epsilon_{\mathrm{step}} = \epsilon_{\mathrm{solve}} = 10^{-5} k^{-3}$ and
$\varepsilon = 10^{-6} k^{-6}$
we get that
$\ss^{T+1} \approx_{1.1} \ss\left(\mu/(1+\epsilon_{\mathrm{step}}\delta)^{k\epsilon_{\mathrm{step}}^{-1}}\right)$.
\end{replemma}
\begin{proof}
We set $\boldsymbol{\mathit{f}}^{*1} = \boldsymbol{\mathit{f}}(\mu)$ and
for each $t\in[T]$, %
\[ \boldsymbol{\mathit{f}}^{*t+1} = \boldsymbol{\mathit{f}}^{*t}  + \epsilon_{\mathrm{step}} \boldsymbol{\mathit{\widetilde{f}}}^{*t} \,, \]
and the corresponding slacks $\ss^{*t}$ and resistances $\boldsymbol{\mathit{r}}^{*t}$.
Let $\widehat{T}$ be the first $t\in[T+1]$ such that
$\ss^{\widehat{T}} \not\approx_{1+\epsilon_{\mathrm{solve}}} \ss^{*\widehat{T}}$.
Obviously $t > 1$ as $\ss^1 \approx_{1+\epsilon_{\mathrm{solve}}/8} \ss(\mu) = \ss^{*1}$.

Now, for all $t\in[T]$ we have
\[ \left\|\sqrt{\boldsymbol{\mathit{r}}^t}\left(\boldsymbol{\mathit{\widetilde{f}}}^{*t} - \boldsymbol{\mathit{\widetilde{f}}}^t\right)\right\|_\infty \leq \varepsilon \,. \]
Fix some $e\in E$. If $\widetilde{f}_e^t = \mathbf{0}$ for all $t\in [\widehat{T}-1]$, then we have
$\sqrt{r_e^{\widehat{T}}}\left|\widetilde{f}_e^{*t}\right| = \sqrt{r_e^t}\left|\widetilde{f}_e^{*t}\right| \leq \varepsilon$ for all such $t$.
This means that
\begin{align*}
 \sqrt{r_e^{\widehat{T}}} \left|f_e^{*\widehat{T}} - f_e^{\widehat{T}}\right|
& \leq \sqrt{r_e^{\widehat{T}}} \left|f_e^{*\widehat{T}} - f_e^{*1}\right|
+ \sqrt{r_e^{\widehat{T}}} \left|f_e^{*1} - f_e^{\widehat{T}}\right|\\
& = \sqrt{r_e^{\widehat{T}}} \left|f_e^{*\widehat{T}} - f_e^{*1}\right|
+ \sqrt{r_e^{\widehat{T}}} \left|f_e^{*1} - f_e^{1}\right|\\
& \leq \epsilon_{\mathrm{step}}\sqrt{r_e^{\widehat{T}}}\sum\limits_{t=1}^{\widehat{T}-1} \left|\widetilde{f}_e^{*t}\right|
+ \sqrt{r_e^{\widehat{T}}} \left|f_e^{*1} - f_e^{1}\right|\\
& \leq \widehat{T}\epsilon_{\mathrm{step}}\varepsilon
+ \sqrt{r_e^{\widehat{T}}} \left|f_e^{*1} - f_e^{1}\right|\\
& \leq k \varepsilon + \sqrt{2} \epsilon_{\mathrm{solve}}/8\\
& \leq \epsilon_{\mathrm{solve}} / 2\,,
\end{align*}
as long as $\varepsilon \leq \epsilon_{\mathrm{solve}} / (2k) = O(1/k^4)$.
In the second to last inequality
we used Lemma~\ref{lem:approx_conversion}.

Otherwise, there exists $t\in[\widehat{T}-1]$ such that $\widetilde{f}_e^t \neq \mathbf{0}$,
and by definition
$f_e^{\widehat{T}} = f_e(\mu) + \epsilon_{\mathrm{step}}\sum\limits_{t=1}^{\widehat{T}-1} \widetilde{f}_e^t$,
so
\begin{align*}
\sqrt{r_e^{*\widehat{T}}}\left|f_e^{*\widehat{T}} - f_e^{\widehat{T}}\right|
& \leq
\sqrt{r_e^{*\widehat{T}}}\left|f_e^{*1} - f_e(\mu)\right| +
\epsilon_{\mathrm{step}}\sum\limits_{t=1}^{\widehat{T}-1}\sqrt{r_e^{*\widehat{T}}}\left|\widetilde{f}_e^{*t} - \widetilde{f}_e^t\right|\\
& \leq 3k^2
\epsilon_{\mathrm{step}}\sum\limits_{t=1}^{\widehat{T}-1}\sqrt{r_e^{*t}}
\left|\widetilde{f}_e^{*t} - \widetilde{f}_e^t\right|\\
& \leq
 3k^2
 \epsilon_{\mathrm{step}}(1+\epsilon_{\mathrm{solve}})\sum\limits_{t=1}^{\widehat{T}-1}\sqrt{r_e^{t}}\left|\widetilde{f}_e^{*t} - \widetilde{f}_e^t\right|\\
& \leq
3k^2\epsilon_{\mathrm{step}}(1+\epsilon_{\mathrm{solve}}) T \varepsilon\\
& \leq4k^3\varepsilon\,,
\end{align*}
where we have used
Lemma~\ref{lem:resistance_stability2}
and
the fact that $\ss^t \approx_{1+\epsilon_{\mathrm{solve}}} \ss^{*t}$ for all $t\in [\widehat{T}-1]$
which also implies that $\sqrt{\boldsymbol{\mathit{r}}^t}\approx_{1+\epsilon_{\mathrm{solve}}} \sqrt{\boldsymbol{\mathit{r}}^{*t}}$.
Setting $\varepsilon = \frac{\epsilon_{\mathrm{solve}}}{8k^3} = O\left(\frac{1}{k^6}\right)$, this becomes $\leq \epsilon_{\mathrm{solve}}/2$.

Therefore we have proved that
$\left\|\sqrt{\boldsymbol{\mathit{r}}^{*\widehat{T}}}\left(\boldsymbol{\mathit{f}}^{*\widehat{T}} - \boldsymbol{\mathit{f}}^{\widehat{T}}\right)\right\|_\infty \leq \epsilon_{\mathrm{solve}}/2$, and so
$\ss^{*\widehat{T}} \approx_{1+\epsilon_{\mathrm{solve}}} \ss^{\widehat{T}}$, a contradiction.
Therefore we
conclude that $\ss^t \approx_{1+\epsilon_{\mathrm{solve}}} \ss^{*t}$ for all $t\in [T+1]$.

Now,
as long as $\epsilon_{\mathrm{step}}, \epsilon_{\mathrm{solve}} \leq 10^{-5} k^{-3}$,
we can apply Lemma~\ref{lem:small_residual}, which guarantees
that $\ss^{*T+1} \approx_{1.01} \ss\left(\mu / (1+\epsilon_{\mathrm{step}}\delta)^{T}\right)$,
and so $\ss^{T+1} \approx_{1.1} \ss\left(\mu / (1+\epsilon_{\mathrm{step}}\delta)^{T}\right)$.
Therefore we set $\epsilon_{\mathrm{step}} = \epsilon_{\mathrm{solve}} = 10^{-5} k^{-3}$ and
$\varepsilon = 10^{-6} k^{-6} \leq \frac{\epsilon_{\mathrm{solve}}}{8k^3}$.
\end{proof}

\subsection{Proof of Lemma~\ref{lem:multistep}}
\label{proof_lem_multistep}
\begin{proof}

We will apply Lemma~\ref{lem:approx_central}
with $\boldsymbol{\mathit{f}}^1$ being the flow corresponding to the resistances
$\mathcal{L}.\boldsymbol{\mathit{r}} = \mathcal{C}.\boldsymbol{\mathit{r}}$,
and $T = k\epsilon_{\mathrm{step}}^{-1}$.
Note that it is important to maintain the invariant $\mathcal{L}.\boldsymbol{\mathit{r}} = \mathcal{C}.\boldsymbol{\mathit{r}}$ throughout
the algorithm so that both data structures
correspond to the same electrical flow problem.
For each $t\in [T]$, for the $t$-th iteration,
Lemma~\ref{lem:approx_central}
requires an estimate $\boldsymbol{\mathit{\widetilde{f}}}^t$
such that
$\left\|\sqrt{\boldsymbol{\mathit{r}}^t}\left(\boldsymbol{\mathit{\widetilde{f}}}^{*t} - \boldsymbol{\mathit{\widetilde{f}}}^t\right)\right\|_\infty \leq \varepsilon$,
where
\[ \boldsymbol{\mathit{\widetilde{f}}}^{*t} = \delta g(\ss^t) - \delta
(\boldsymbol{\mathit{R}}^t)^{-1}\boldsymbol{\mathit{B}} \left(\boldsymbol{\mathit{B}}^\top (\boldsymbol{\mathit{R}}^t)^{-1}\boldsymbol{\mathit{B}}\right)^+\boldsymbol{\mathit{B}}^\top g(\ss^t) \]
and $\delta = 1/\sqrt{m}$.

We claim that such an estimate can be computed for all $t$ by using $\mathcal{L}$ and $\mathcal{C}$.
We apply the following process for each $t\in[T]$:
\begin{itemize}
\item{Let $Z$ be the edge set returned by $\mathcal{L}.\textsc{Solve}()$.}
\item{Call $\mathcal{C}.\textsc{Check}(e)$ for each $e\in Z$ to obtain flow values
$\widetilde{f}_e^t$.}
\item{Compute $\boldsymbol{\mathit{f}}^t$ and its slacks $\ss^{t+1}$ and resistances $\boldsymbol{\mathit{r}}^{t+1}$
as in Lemma~\ref{lem:approx_central}, i.e.
\[ f_e^{t+1} = \begin{cases}
f_e(\mu) + \epsilon_{\mathrm{step}} \sum\limits_{i=1}^{t} \widetilde{f}_e^i & \text{if $\exists i\in[t]:\widetilde{f}_e^{i} \neq 0$}\\
f_e^1 & \text{otherwise}
\end{cases}\,. \]
This can be computed in $O\left(\left|Z\right|\right)$ by
adding either $\epsilon_{\mathrm{step}}\widetilde{f}_e^i$ or $f_e(\mu) - f_e^1 + \epsilon_{\mathrm{step}}\widetilde{f}_e^i$ to $f_e^t$ for each $e\in Z$.
}
\item{Call $\mathcal{L}.\textsc{Update}(e,\boldsymbol{\mathit{f}}^{t+1})$
and
$\mathcal{C}.\textsc{Update}(e,\boldsymbol{\mathit{f}}^{t+1})$
for all $e$ in the support of $\boldsymbol{\mathit{\widetilde{f}}}^t$.
Note that $\mathcal{L}.\textsc{Update}$ works as long as
\[ r_e^{\max} / \alpha \leq r_e^{t+1} \leq \alpha \cdot r_e^{\min} \,,\]
where $r_e^{\max}$, $r_e^{\min}$ are the maximum and minimum values of
$\mathcal{L}.r_e$ since the last call to $\mathcal{L}.\textsc{BatchUpdate}$.
After this, we have $\mathcal{L}.\boldsymbol{\mathit{r}} = \mathcal{C}.\boldsymbol{\mathit{r}} = \boldsymbol{\mathit{r}}^{t+1}$.}
\end{itemize}
In the above process, when $\mathcal{L}.\textsc{Solve}()$ is called
we have $\mathcal{L}.\boldsymbol{\mathit{r}} = \boldsymbol{\mathit{r}}^t$ (for $t=1$ this is true because
$\mathcal{L}.\boldsymbol{\mathit{r}}$ are the resistances corresponding to $\boldsymbol{\mathit{f}}^1$).
By the $(\alpha,\beta,\varepsilon/2)$-\textsc{Locator} guarantees
in Definition~\ref{def:locator}, with high probability
$Z$ contains all the edges $e$ such that
$\sqrt{r_e^t} \left|\widetilde{f}_e^{*t} \right| \geq \varepsilon / 2$.
Now, for each $e\in Z$,
$\mathcal{C}.\textsc{Check}(e)$
returns a flow value $\widetilde{f}_e^t$ such that:
\begin{itemize}
\item $\sqrt{r_e^t} \left|\widetilde{f}_e^t - \widetilde{f}_e^{*t}\right| \leq \varepsilon$
\item if $\sqrt{r_e^t} \left|\widetilde{f}_e^{*t}\right| < \varepsilon / 2$, then $\widetilde{f}_e^t = 0$.
\end{itemize}
Therefore, the condition that
\[ \sqrt{\boldsymbol{\mathit{r}}^t}\left\|\boldsymbol{\mathit{\widetilde{f}}}^t - \boldsymbol{\mathit{\widetilde{f}}}^{*t}\right\|_\infty \leq \varepsilon \]
is satisfied.
Additionally $\boldsymbol{\mathit{\widetilde{f}}}^t$ is independent of the randomness of $\mathcal{L}$, because
(the distribution of) $\boldsymbol{\mathit{\widetilde{f}}}^t$ would be the same if $\mathcal{C}.\textsc{Check}$
was run for {\bf all} edges $e$.

It remains to show that the $\textsc{Locator}$ requirement
\[ \boldsymbol{\mathit{r}}^{\max} / \alpha \leq \boldsymbol{\mathit{r}}^{t+1} \leq \alpha \cdot \boldsymbol{\mathit{r}}^{\min} \]
is satisfied.
Consider the minimum value of $t$ for which this is not satisfied.
By Lemma~\ref{lem:approx_central}, we have that
\begin{align}
\ss^{\tau+1} \approx_{1.1} \ss\left(\mu/(1+\epsilon_{\mathrm{step}}\delta)^{\tau}\right)
\label{eq:slack_1.1_approx}
\end{align}
for any $\tau\in [t]$.

Now let $\boldsymbol{\mathit{\widehat{r}}}$ be the resistances of $\mathcal{L}$ at any point since the last call to
$\mathcal{L}.\textsc{BatchUpdate}$. By the lemma statement and (\ref{eq:slack_1.1_approx}),
we know that $\boldsymbol{\mathit{\widehat{r}}} \approx_{1.1^2} \boldsymbol{\mathit{r}}(\hat{\mu})$
for some $\hat{\mu}\in[\mu / (1+\epsilon_{\mathrm{step}}\delta)^t, \mu^0]$.
However, we also know that $\mu^0 \leq \mu \cdot (1+\epsilon_{\mathrm{step}}\delta)^{(0.5\alpha^{1/4} - k)\epsilon_{\mathrm{step}}^{-1}}$
and so
\[ \frac{\hat{\mu}}{\mu/(1+\epsilon_{\mathrm{step}}\delta)^{t}}
\leq (1 + \epsilon_{\mathrm{step}}\delta)^{0.5\alpha^{1/4}\epsilon_{\mathrm{step}}^{-1}}
\leq (1 + \delta)^{0.5\alpha^{1/4}}
\,, \]
so by Lemma~\ref{lem:resistance_stability2} we have
\[
\ss\left(\mu/(1+\epsilon_{\mathrm{step}}\delta)^t\right)
\approx_{0.75\alpha^{1/2}}
\ss\left(\hat{\mu}\right)\,.
\]
As
$\ss^{t+1} \approx_{1.1} \ss\left(\mu/(1+\epsilon_{\mathrm{step}}\delta)^{t}\right)$,
we have that
$\ss^{t+1} \approx_{0.825\alpha^{1/2}} \ss(\hat{\mu})$,
and so
\[ \boldsymbol{\mathit{r}}^{t+1} \approx_{0.825\alpha} \boldsymbol{\mathit{r}}(\hat{\mu}) \approx_{1.1^2} \boldsymbol{\mathit{\widehat{r}}} \,.\]
This means that $\boldsymbol{\mathit{r}}^{t+1} \approx_{\alpha} \boldsymbol{\mathit{\widehat{r}}}$ and is a contradiction.

We conclude that the requirements of $\mathcal{L}$ are met for all $t$,
and as a result Lemma~\ref{lem:approx_central}
shows that
$\ss^{T+1} \approx_{1.1} \ss\left(\mu / (1+\epsilon_{\mathrm{step}}\delta)^{k\epsilon_{\mathrm{step}}^{-1}}\right)$.
By Lemma~\ref{lem:recenter}, we can
now obtain $\boldsymbol{\mathit{f}}\left(\mu / (1+\epsilon_{\mathrm{step}}\delta)^{k\epsilon_{\mathrm{step}}^{-1}}\right)$.
Finally, we return $\mathcal{L}.\boldsymbol{\mathit{r}}$ and $\mathcal{C}$ to their original states.

\paragraph{Success probability.}
We note that all the outputs of $\mathcal{C}$ are independent of the randomness
of $\mathcal{L}$, and $\mathcal{L}$ is only updated based on these outputs.
As each operation of $\mathcal{L}$ succeeds with high probability,
the whole process succeeds with high probability as well.

\paragraph{Runtime.}
The recentering operation in Lemma~\ref{lem:recenter} takes $\tO{m}$.
Additionally, we call $\mathcal{L}.\textsc{Solve}$
$k\epsilon_{\mathrm{step}}^{-1} = O(k^4)$ times
and, as $|Z| = O(1/\varepsilon^2)$, the total
number of times $\mathcal{L}.\textsc{Update}$,
$\mathcal{C}.\textsc{Update}$, and
$\mathcal{C}.\textsc{Check}$
are called is
$O(k\epsilon_{\mathrm{step}}^{-1} \varepsilon^{-2}) = O(k^{16})$.

\end{proof}

\subsection{Proof of Lemma~\ref{lem:mincostflow}}
\label{proof_lem_mincostflow}
\begin{proof}

Let $\delta = 1/\sqrt{m}$.
Over a number of $T=\tO{m^{1/2}/k}$ iterations, we will repeatedly apply $\textsc{MultiStep}$
(Lemma~\ref{lem:multistep}). We will also replace the oracle from
Definition~\ref{def:perfect_checker} by the $\textsc{Checker}$ data structure
in Section~\ref{sec:checker}.

\paragraph{Initialization.}
We first initialize the $\textsc{Locator}$ with error $\varepsilon / 2$, by calling
$\mathcal{L}.\textsc{Initialize}(\boldsymbol{\mathit{f}})$.
Let $\ss^t$ be the slacks $\mathcal{L}.\ss$
before the $t$-th iteration and $\boldsymbol{\mathit{r}}^t$ the corresponding resistances,
and $\ss^{0t}$ be the slacks $\mathcal{L}.\boldsymbol{\mathit{r}}^0$ before the $t$-th iteration
and $\boldsymbol{\mathit{r}}^{0t}$ the corresponding resistances,
for $t\in[T]$.
Also, we let $\mu_t = \mu / \left(1 + \epsilon_{\mathrm{step}}\delta\right)^{(t-1)k\epsilon_{\mathrm{step}}^{-1}}$.
We will maintain the invariant that
$\ss^t \approx_{1+\epsilon_{\mathrm{solve}}/8} \ss\left(\mu_t\right)$, which is a requirement
in order to apply Lemma~\ref{lem:multistep}.

As in~\cite{gao2021fully}, we will also need to maintain $O(k^4)$
$\textsc{Checker}$s $\mathcal{C}^i$ for $i\in[O(k^4)]$,
so we call $\mathcal{C}^i.\textsc{Initialize}(\boldsymbol{\mathit{f}}, \varepsilon, \beta_{\textsc{Checker}})$ for each one of these.
Note that in general $\beta_{\textsc{Checker}} \neq \beta$, as
the vertex sparsifiers $\mathcal{L}$ and $\mathcal{C}^i$ will not be on the same vertex set.
As in Lemma~\ref{lem:multistep}, we will maintain the invariant that
$\mathcal{L}.\boldsymbol{\mathit{r}} = \mathcal{C}^i.\boldsymbol{\mathit{r}}$ for all $i$.

\paragraph{Resistance updates.}
Assuming that all the requirements of Lemma~\ref{lem:multistep} (\textsc{MultiStep})
are satisfied at the $t$-th iteration, that lemma computes a flow
$\boldsymbol{\mathit{\bar{f}}} = \boldsymbol{\mathit{f}}\left(\mu_{t+1}\right)$ with slacks $\boldsymbol{\bar{\mathit{s}}}$.
In order to guarantee that
$\ss^{t+1} \approx_{1+\epsilon_{\mathrm{solve}}/8} \ss\left(\mu_{t+1}\right)$,
we let $Z$ be the set
of edges such that either
\[ s_e^{+,t} \not\approx_{1+\epsilon_{\mathrm{solve}}/8} \bar{s}_e^+ \text{ or }
 s_e^{-,t} \not\approx_{1+\epsilon_{\mathrm{solve}}/8} \bar{s}_e^- \]
and then call
$\mathcal{L}.\textsc{Update}(e,\boldsymbol{\mathit{\bar{f}}})$ for all $e\in Z$.
This guarantees that
$s_e^{+,t+1} = \bar{s}_e^+$
and
$s_e^{-,t+1} = \bar{s}_e^-$
for all $e\in Z$
and so
$\ss^{t+1}\approx_{1+\epsilon_{\mathrm{solve}}/8} \boldsymbol{\bar{\mathit{s}}} = \ss\left(\mu_{t+1}\right)$.
We also apply the same updates to the $\mathcal{C}^i$'s
using $\mathcal{C}^i.\textsc{Update}$, in order to ensure that they have
the same resistances with $\mathcal{L}$.

\paragraph{Batched resistance updates.}
The number of times $\mathcal{L}.\textsc{Update}$ is called can be quite large
because of multiple edges on which error slowly accumulates. This is because in general
$\Omega(m)$ resistances will be updated
throughout the algorithm. As \textsc{Locator}.\textsc{Update} is only slightly sublinear,
this would lead to an $\Omega(m^{3/2})$-time algorithm.
For this reason, as in~\cite{gao2021fully}, we occasionally
(every $\widehat{T}$ iterations for some $\widehat{T}\geq 1$ to be defined later)
perform batched updates by calling $\mathcal{L}.\textsc{BatchUpdate}(Z,\boldsymbol{\mathit{\bar{f}}})$,
where $Z$
is the set
of edges such that either
\[ s_e^{+,t} \not\approx_{1+\epsilon_{\mathrm{solve}}/16} \bar{s}_e^+
\text{ or } s_e^{-,t} \not\approx_{1+\epsilon_{\mathrm{solve}}/16} \bar{s}_e^- \,. \]
This again guarantees that
$s_e^{+,t+1} = \bar{s}_e^+$
and $s_e^{-,t+1} = \bar{s}_e^-$
for all $e\in Z$
and so $\ss^{t+1}\approx_{1+\epsilon_{\mathrm{solve}}/16} \boldsymbol{\bar{\mathit{s}}} = \ss\left(\mu_{t+1}\right)$.
Note that after updating
$\mathcal{L}.\ss$ and $\mathcal{L}.\boldsymbol{\mathit{r}}$, this operation also sets
$\mathcal{L}.\boldsymbol{\mathit{r}}^0 = \mathcal{L}.\boldsymbol{\mathit{r}}$.
We perform the same resistance updates to the $\mathcal{C}^i$'s in the regular
(i.e. not batched) way, using $\mathcal{C}^i.\textsc{Update}$.

\paragraph{\textsc{Locator} requirements.}
What is left is to ensure that the requirements of Lemma~\ref{lem:multistep}
are satisfied at the $t$-th iteration, as well as that
the requirements of $\mathcal{L}$.\textsc{Update}
and $\mathcal{L}$.\textsc{BatchUpdate}
from Definition~\ref{def:locator}
are satisfied.

The requirements are as follows:
\begin{enumerate}
\item{Lemma~\ref{lem:multistep}: $\ss^{0t} \approx_{1+\epsilon_{\mathrm{solve}}/8} \ss\left(\mu^0\right)$
for some $\mu^0 \leq
\mu_t\cdot(1+\epsilon_{\mathrm{step}}\delta)^{(0.5\alpha^{1/4} - k)\epsilon_{\mathrm{step}}^{-1}}$.

Note that
$\mathcal{L}.\ss^0$ is updated every time $\mathcal{L}.\textsc{BatchUpdate}$ is called,
and after the call we have
$\mathcal{L}.\ss^0 = \mathcal{L}.\ss \approx_{1+\epsilon_{\mathrm{solve}}/16} \ss(\mu^0)$ for some $\mu^0 > 0$.
To ensure that it is called often enough,
we call
$\mathcal{L}.\textsc{BatchUpdate}(\emptyset)$ every $(0.5\alpha^{1/4} / k - 1)\epsilon_{\mathrm{step}}^{-1}$ iterations.
Because of this, we have
$\mu^0
\leq \mu_t \cdot \left(1+\epsilon_{\mathrm{step}}\delta\right)^{(0.5\alpha^{1/4}/k - 1)\epsilon_{\mathrm{step}}^{-1} \cdot k}
= \mu_t \cdot \left(1+\epsilon_{\mathrm{step}}\delta\right)^{(0.5\alpha^{1/4} - k)\epsilon_{\mathrm{step}}^{-1}}
$. Additionally, for any resistances $\boldsymbol{\mathit{\widehat{r}}}$ that $\mathcal{L}$ had at any point since the last
call to $\mathcal{L}.\textsc{BatchUpdate}$, it is immediate that
\[ \boldsymbol{\mathit{\widehat{r}}} \approx_{(1+\epsilon_{\mathrm{solve}}/8)^2} \boldsymbol{\mathit{r}}(\hat{\mu})\]
for some $\hat{\mu}\in[\mu_t, \mu^0]$, as this is exactly the invariant that our calls to
$\mathcal{L}.\textsc{Update}$ maintain. Therefore, $\boldsymbol{\mathit{\widehat{r}}} \approx_{1.1^2} \boldsymbol{\mathit{r}}(\hat{\mu})$.
}
\item{$\mathcal{L}$.\textsc{Update}: $r_e^{\max} / \alpha \leq r_e^{t+1} \leq \alpha \cdot r_e^{\min}$,
where $r_e^{\min}, r_e^{\max}$ are the minimum and maximum values that
$\mathcal{L}.r_e$ has had since the
last call to $\mathcal{L}.\textsc{BatchUpdate}$.

Let $\boldsymbol{\mathit{\widehat{r}}}$ be any value of $\mathcal{L}.\boldsymbol{\mathit{r}}$ since the last call to $\mathcal{L}.\textsc{BatchUpdate}$.
Because of the invariant maintained by resistance updates (including inside
$\textsc{MultiStep}$), we have that
$\boldsymbol{\mathit{\widehat{r}}}$ are $(\hat{\mu},1.1)$-central resistances for some $\hat{\mu}$ such that
\[ \mu_{t+1} \leq \hat{\mu}
\leq \mu_{t+1} \cdot \left(1+\epsilon_{\mathrm{step}}\delta\right)^{(0.5\alpha^{1/4} - k)\epsilon_{\mathrm{step}}^{-1}}
\leq \mu_{t+1} \cdot (1+\delta)^{0.5\alpha^{1/4}} \,.\]
As in the previous item, we have that
and $\ss^{0t}$ are $(\mu^0, 1+\epsilon_{\mathrm{solve}}/8)$-central.
By Lemma~\ref{lem:resistance_stability2} this implies
\[ \ss(\mu_{t+1})
\approx_{0.75\alpha^{1/2}}
\ss(\hat{\mu})\,,\]
and since $\boldsymbol{\mathit{\widehat{r}}} \approx_{1.1^2} \boldsymbol{\mathit{r}}(\hat{\mu})$, we conclude that
$\boldsymbol{\mathit{r}}(\mu_{t+1}) \approx_{\alpha} \boldsymbol{\mathit{\widehat{r}}}$.
}
\item{$\mathcal{L}$.\textsc{BatchUpdate}: Between any two successive calls to $\mathcal{L}.\textsc{Initialize}$,
the number of edges updated
(number of calls to $\mathcal{L}.\textsc{Update}$ plus
the sum of $|Z|$ for all calls to $\mathcal{L}.\textsc{BatchUpdate}$)
is $O(\beta m)$.

We make sure that this is satisfied by calling $\mathcal{L}.\textsc{Initialize}(\boldsymbol{\mathit{\bar{f}}})$
every $\epsilon_{\mathrm{solve}} \sqrt{\beta m} / k$ iterations, where
$\boldsymbol{\mathit{\bar{f}}} = \boldsymbol{\mathit{f}}(\mu_t)$, at the beginning of the $t$-th iteration.

Consider any two successive initializations at iterations
$t^{init}$ and $t^{end}$ respectively.
Let $\ell$ be the number of edges $e$ that have potentially
been updated, i.e. such that either
\[ s_e(\mu_{t^{init}})^{+} \not\approx_{1+\epsilon_{\mathrm{solve}}/16}s_e(\mu_{i})^{+} \text{ or }
s_e(\mu_{t^{init}})^- \not\approx_{1+\epsilon_{\mathrm{solve}}/16}s_e(\mu_{i})^- \]
for some $i\in\left[t^{init},t^{end}\right]$.
First, note that this implies that
\[ \sqrt{r_e(\mu_{t^{init}})}\left|f_e(\mu_{t^{init}}) - f_e(\mu_i)\right| >
\frac{\epsilon_{\mathrm{solve}} / 16}{1+\epsilon_{\mathrm{solve}}/16} > \epsilon_{\mathrm{solve}} / 17 \,. \]
Now, by the fact that $t^{end} - t^{init} \leq \epsilon_{\mathrm{solve}} \sqrt{\beta m} / k$, we have that
\[ \mu_{t^{init}} \leq
\mu_i \cdot (1+\epsilon_{\mathrm{step}}\delta)^{k\epsilon_{\mathrm{step}}^{-1}\cdot \epsilon_{\mathrm{solve}}\sqrt{\beta m} / k}
\leq \mu_i \cdot (1+\delta)^{\epsilon_{\mathrm{solve}}\sqrt{\beta m}} \,.\]
By applying Lemma~\ref{lem:resistance_stability1}
with $k=\epsilon_{\mathrm{solve}}\sqrt{\beta m}$
and $\gamma = \epsilon_{\mathrm{solve}}/17$, we get that
$\ell \leq O(\beta m)$.
Therefore the statement follows.
}
\end{enumerate}

We will also need to show how to implement the $\textsc{PerfectChecker}$
used in $\textsc{MultiStep}$ using the $\mathcal{C}^i$'s, as well as how to satisfy
all $\textsc{Checker}$ requirements.

\paragraph{\textsc{Checker} requirements.}

\begin{enumerate}
\item{Implementing $\varepsilon$-$\textsc{PerfectChecker}$ inside $\textsc{MultiStep}$.

We follow almost the same procedure as in~\cite{gao2021fully}, other than the fact
that we also need to provide some additional information to $\mathcal{C}^i.\textsc{Solve}$.
Each call to $\textsc{PerfectChecker}.\textsc{Update}$ translates to calls to
$\mathcal{C}^i.\textsc{TemporaryUpdate}$ for all $i$. In addition, the $i$-th
batch of calls to $\textsc{PerfectChecker}.\textsc{Check}$ inside $\textsc{MultiStep}$
(i.e. that corresponding to a single set of edges returned by $\mathcal{L}.\textsc{Solve}$)
is only run on $\mathcal{C}^i$ using $\mathcal{C}^i.\textsc{Check}$. As each call to
$\mathcal{C}^i.\textsc{Check}$ is independent of previous calls to it, we can get correct
outputs with high probability even when we run it multiple times (one for each edge
returned by $\mathcal{L}.\textsc{Solve}$).

In order to guarantee that we have a vector $\boldsymbol{\mathit{\pi}}_{old}^i$ as required by $\mathcal{C}^i.\textsc{Check}$,
once every $k^4$ calls to $\textsc{MultiStep}$ (i.e. if $t$ is a multiple of $k^4$) we compute
\[ \boldsymbol{\mathit{\pi}}_{old}^{i} = \boldsymbol{\mathit{\pi}}^{C^{i,t}}\left(\boldsymbol{\mathit{B}}^\top g(\ss(\mu_t))\right) \]
for all $i\in[O(k^4)]$, where
$C^{i,t}$ is the vertex set of the Schur complement data
structure stored internally by the $\mathcal{C}^i$ right before the $t$-th call to $\textsc{MultiStep}$.
This can be computed in $\tO{m}$ for each $i$ as in $\textsc{DemandProjector}.\textsc{Initialize}$
in Lemma~\ref{lem:ds}.
Now, the total number of $\mathcal{C}^i.\textsc{TemporaryUpdate}$s that have not been rolled back
is $O(k^{16})$, and the total number of $\mathcal{C}^i.\textsc{Update}$s over $k^4$ calls to
$\textsc{MultiStep}$ by Lemma~\ref{lem:resistance_stability1}
is $O(k^{10} / \epsilon_{\mathrm{solve}}^2) = O(k^{16})$. This means that the total number
of terminal insertions to $C^{i,t}$ as well as resistance changes is $O(k^{16})$.
By Lemma~\ref{lem:old_projection_approximate}, if $C^i$ is the current state of the vertex set
of the Schur complement of $\mathcal{C}^i$ and $\ss$ are the current slacks,
\[ \mathcal{E}_{\boldsymbol{\mathit{r}}} \left(\boldsymbol{\mathit{\pi}}_{old}^i -
\boldsymbol{\mathit{\pi}}^{C^i}(g(\ss))\right) \leq \tO{\alpha' \beta_{\textsc{Checker}}^{-4}} \cdot k^{32}\,,
\]
where $\alpha'$ is the largest possible multiplicative change of some $\mathcal{C}^i.r_e$ since
the computation of $\boldsymbol{\mathit{\pi}}_{old}^i$.
Furthermore, note that $\boldsymbol{\mathit{\pi}}_{old}$ is supported on $C^i$. This is because
$C^{i,t} \subseteq C^i$ and $C^{i,t}$ does not contain any temporary
terminals.

Now, as we have already proved in Lemma~\ref{lem:multistep}, at any
point inside the $t$-th call to $\textsc{MultiStep}$, $\mathcal{C}^i.\boldsymbol{\mathit{r}}$ are
$(\hat{\mu},1.1)$-central resistances for some
$\hat{\mu}\in[\mu_{t+1}, \mu_t]$.

Fix $\hat{\mu}\in[\mu_{t+1},\mu_t], \hat{\mu}'\in[\mu_{t'+1},\mu_{t'}]$, as well as the corresponding resistances
of $\mathcal{C}^i$, $\boldsymbol{\mathit{\widehat{r}}}$, $\boldsymbol{\mathit{\widehat{r}}}'$, where $t' \geq t$.
Now, note that since we are computing $\boldsymbol{\mathit{\pi}}_{old}^i$ every $k^4$ calls to $\textsc{MultiStep}$,
we have that
\[ \frac{\hat{\mu}}{\hat{\mu}'} \leq \frac{\mu_t}{\mu_{t'+1}}
\leq (1+\epsilon_{\mathrm{step}}\delta)^{k\epsilon_{\mathrm{step}}^{-1}\cdot (t'-t + 1)}
\leq (1+\delta)^{O(k^5)}\,,\]
so Lemma~\ref{lem:resistance_stability2} implies that
\[ \ss(\hat{\mu}) \approx_{O(k^{10})} \ss(\hat{\mu}')\,. \]
As $\boldsymbol{\mathit{\widehat{r}}} \approx_{1.1^2} \boldsymbol{\mathit{r}}(\hat{\mu})$
and $\boldsymbol{\mathit{\widehat{r}}}' \approx_{1.1^2} \boldsymbol{\mathit{r}}(\hat{\mu}')$,
we get that $\boldsymbol{\mathit{\widehat{r}}} \approx_{O(k^{20})} \boldsymbol{\mathit{\widehat{r}}}'$. Therefore,
$\alpha' \leq O(k^{20})$.
Setting $\beta_{\textsc{Checker}} \geq \tOm{\alpha'^{1/4} k^{8} \varepsilon^{-1/2} m^{-1/4}} = \tOm{k^{16} / m^{1/4}}$, we get that
\[ \tO{\alpha'\beta_{\textsc{Checker}}^{-4}}\cdot k^{32} \leq \varepsilon^2 m / 4\,, \]
as required
by $\mathcal{C}^i.\textsc{Check}$.

Finally, at the end of $\textsc{MultiStep}$ we bring all
$\mathcal{C}^i$ to their original state before calling $\textsc{MultiStep}$,
by calling $\mathcal{C}^i.\textsc{Rollback}$. We also update
all the resistances of $\mathcal{L}$ to their original state by calling $\mathcal{L}.\textsc{Update}$.
}
\item{Between any two successive calls to
$\mathcal{C}^i$.$\textsc{Initialize}$, the total number of edges updated
at any point (via $\mathcal{C}^i.\textsc{Update}$ or
$\mathcal{C}^i.\textsc{TemporaryUpdate}$ that have not been rolled back)
is $O(\beta_{\textsc{Checker}} m)$.

For $\textsc{Update}$, we can apply a similar analysis as in the
$\textsc{Locator}$ case to show that if we call
$\mathcal{C}^i$.$\textsc{Initialize}$ every $\epsilon_{\mathrm{solve}}\sqrt{\beta_{\textsc{Checker}} m} /k$ iterations,
the total number of updates never exceeds $O(\beta_{\textsc{Checker}} m)$.
For $\textsc{TemporaryUpdate}$, note that at any time there
are at most $O(k^{16})$ of these that have not been rolled back
(this is inside \textsc{MultiStep}). Therefore, as long as
$k^{16} \leq O(\beta_{\textsc{Checker}} m) \Leftrightarrow \beta_{\textsc{Checker}} \geq \Omega(k^{16} / m)$,
the requirement is met.
}
\end{enumerate}

\paragraph{Output Guarantee.}

After the application of Lemma~\ref{lem:multistep} at the last
iteration,
we will have $\boldsymbol{\mathit{\bar{f}}} = \boldsymbol{\mathit{f}}(\mu_{T+1})$, where
$\mu_{T+1} =
\mu / (1+\epsilon_{\mathrm{step}}\delta)^{\tO{m^{1/2} \epsilon_{\mathrm{step}}^{-1}}}
= \mu / \mathrm{poly}(m)
\leq m^{-10}$.

\paragraph{Success probability.}
Note that all operations of $\textsc{Locator}$ and
$\textsc{Checker}$ work with high probability. Regarding
the interaction of the randomness of
these data structures and the fact that they work against
oblivious adversaries, we defer to~\cite{gao2021fully}, where
there is a detailed discussion of why this works.

In short,
note that outside of $\textsc{MultiStep}$,
all updates are deterministic (as they only depend on the central path),
and in $\textsc{MultiStep}$
the updates to $\textsc{Locator}$ and $\textsc{Checker}$
only depend on outputs of a $\textsc{Checker}$. As each time
we are getting the output from a different $\textsc{Checker}$,
the inputs to $\mathcal{C}^i.\textsc{Check}$ are independent
of the randomness of $\mathcal{C}^i$, and thus succeed with high probability. Finally,
note that the output of $\textsc{Locator}$ is only passed onto
$\mathcal{C}^i.\textsc{Check}$, whose output is then independent of the inputs
received by $\textsc{Locator}$. Therefore, $\textsc{Locator}$ does not
``leak'' any randomness.

Our only deviation from~\cite{gao2021fully} in $\textsc{Checker}$ has to
do with the extra input of $\textsc{Checker}.\textsc{Check}$ ($\boldsymbol{\mathit{\pi}}_{old}^i$).
However, note that this is computed outside of $\textsc{MultiStep}$,
and as such the only randomness it depends on is the
$\beta_{\textsc{Checker}}$-congestion reduction subset $C^i$ generated when calling
$\mathcal{C}^i.\textsc{Initialize}$.
As such, it only depends on the internal randomness of $\mathcal{C}^i$. As we
mentioned, the output of $\mathcal{C}^i$.$\textsc{Check}$ is never fed back to
$\mathcal{C}^i$, and thus the operation works with high probability.

\paragraph{Runtime (except $\textsc{Checker}$).}
Each call to $\textsc{MultiStep}$ (Lemma~\ref{lem:multistep})
takes time $\tO{m}$ plus $O(k^{16})$ calls to
$\mathcal{L}.\textsc{Update}$ and $O(k^4)$ calls to $\mathcal{L}.\textsc{Solve}$.
As the total number of iterations is $\tO{m^{1/2} /k}$,
the total time because of calls to $\textsc{MultiStep}$
is $\tO{m^{3/2} / k}$, plus $\tO{m^{1/2} k^{15}}$
calls to
$\mathcal{L}.\textsc{Update}$ and $\tO{m^{1/2} k^3}$ calls to $\mathcal{L}.\textsc{Solve}$.

Now, the total number of calls to $\mathcal{L}.\textsc{Initialize}$ is
$\tO{\frac{m^{1/2} / k}{\epsilon_{\mathrm{solve}}\sqrt{\beta m}/k}} = \tO{k^3 \beta^{-1/2}}$.

The total number of calls to $\mathcal{L}.\textsc{BatchUpdate}(\emptyset)$
is $\tO{\frac{m^{1/2} / k}{0.5\alpha^{1/4} / k}} = \tO{m^{1/2} \alpha^{-1/4}}$
and the total number of calls to $\mathcal{L}.\textsc{BatchUpdate}(Z,\boldsymbol{\mathit{f}})$
is $\tO{\frac{m^{1/2}}{k \widehat{T}}}$.
Regarding the size of $Z$, let us focus on the calls
to $\mathcal{L}.\textsc{BatchUpdate}(Z,\boldsymbol{\mathit{f}})$
between two successive calls
to $\mathcal{L}.\textsc{Initialize}$.
We already showed that the sum of $|Z|$ over all
calls during this interval is $O(\beta m)$. Therefore
the total sum of $|Z|$ over all iterations of the algorithm is
$\tO{m k^3 \beta^{1/2}}$.

In order to bound the number of calls to $\mathcal{L}.\textsc{Update}$,
we concentrate on those between two successive calls to
$\mathcal{L}.\textsc{BatchUpdate}(Z,\boldsymbol{\mathit{f}})$ in iterations $t^{old}$ and $t^{new} > t^{old}$.
After the call to $\mathcal{L}.\textsc{BatchUpdate}(Z,\boldsymbol{\mathit{f}})$
in iteration $t^{old}$ we have
$\mathcal{L}.\ss \approx_{1+\epsilon_{\mathrm{solve}}/16} \ss(\mu_{t^{old}})$.
Fix $\mu\in\left[\mu(t^{new}),\mu(t^{old})\right]$ and let $\ell$ be the
number of $e\in E$ such that
$s_e(\mu)\not\approx_{1+\epsilon_{\mathrm{solve}}/8} s_e^{t^{old}}$.
As $s_e^{t^{old}} \approx_{1+\epsilon_{\mathrm{solve}}/16} s_e(\mu_{t^{old}})$
by the guarantees of $\mathcal{L}.\textsc{BatchUpdate}$,
this implies that
$s_e(\mu)\not\approx_{1+\epsilon_{\mathrm{solve}}/16} s_e(\mu_{t^{old}})$,
and so
\[ \sqrt{r_e(\mu^{t^{old}})}\left|
	f_e(\mu_{t^{old}}) -
	f_e(\mu) \right| \geq \frac{\epsilon_{\mathrm{solve}} / 16}{1+\epsilon_{\mathrm{solve}}/16} > \epsilon_{\mathrm{solve}}/17 \,.\]
As
\[ \mu_{t^{old}} \leq \mu\cdot
(1+\epsilon_{\mathrm{step}}\delta)^{k\epsilon_{\mathrm{step}}^{-1}\cdot \widehat{T}}
\leq \mu\cdot
(1+\delta)^{k\cdot\widehat{T}}
\,,\]
by applying Lemma~\ref{lem:resistance_stability1}
with $k = (1+\delta)^{k\cdot\widehat{T}}$
and $\gamma = \epsilon_{\mathrm{solve}} / 17$, we get that
$\ell \leq O(k^2 \widehat{T}^2 \epsilon_{\mathrm{solve}}^{-2})$.
As there are
$\tO{\frac{m^{1/2}}{k\widehat{T}}}$ calls to
$\mathcal{L}.\textsc{BatchUpdate}(Z,\boldsymbol{\mathit{f}})$,
the total number of calls to $\mathcal{L}.\textsc{Update}$
is
\[  \tO{ m^{1/2} \widehat{T} \epsilon_{\mathrm{solve}}^{-2}}
  \tO{ m^{1/2} k^6 \widehat{T}}
\,.\]

We conclude that we have runtime $\tO{m^{3/2}/k}$, plus
\begin{itemize}
\item $\tO{k^3 \beta^{-1/2}}$ calls to $\mathcal{L}.\textsc{Initialize}$,
\item $\tO{m^{1/2} k^3}$ calls to $\mathcal{L}.\textsc{Solve}$,
\item $\tO{m^{1/2} \left(k^6 \widehat{T} + k^{15}\right)}$ calls to $\mathcal{L}.\textsc{Update}$,
\item $\tO{m^{1/2} \alpha^{-1/4}}$ calls to $\mathcal{L}.\textsc{BatchUpdate}(\emptyset)$, and
\item $\tO{m^{1/2} k^{-1} \widehat{T}^{-1}}$ calls to $\mathcal{L}.\textsc{BatchUpdate}(Z,\boldsymbol{\mathit{f}})$.
\end{itemize}

\paragraph{Runtime of $\textsc{Checker}$.} We look at each operation separately.
We begin with the runtime of $\textsc{Checker}.\textsc{Check}$. We have
\[ \tO{\underbrace{m^{1/2} / k}_{\text{\# calls to \textsc{MultiStep}}}
\cdot
\underbrace{k^{16}}_{\text{\# calls in each $\textsc{MultiStep}$}}
\cdot
\underbrace{(\beta_{\textsc{Checker}} m + (k^{16} \beta_{\textsc{Checker}}^{-2} \varepsilon^{-2})^2))\varepsilon^{-2}}_{\text{runtime per call}}
} \,.\]
To make the first term $\tO{m^{3/2} / k}$, we set $\beta_{\textsc{Checker}} = k^{-28}$. Note that this satisfies
our previous requirements that $\beta_{\textsc{Checker}} \geq \tOm{k^{16} / m}$ and $\beta_{\textsc{Checker}} \geq \tOm{k^{16}/m^{1/4}}$
as long as $k \leq m^{1/176}$.
Therefore the total runtime because of this operation is $\tO{m^{3/2} / k + m^{1/2} k^{195}}$.

For $\textsc{Checker}.\textsc{Initialize}$, we have
\[ \tO{\underbrace{k^4}_{\# \textsc{Checker}s} \cdot \underbrace{k^3 \beta_{\textsc{Checker}}^{-1/2}}_{\# \text{times initialized}}
\cdot \underbrace{m \beta_{\textsc{Checker}}^{-4} \varepsilon^{-4}}_{\text{runtime per init}}} =
\tO{m k^{157}}\,. \]

For $\textsc{Checker}.\textsc{Update}$, similarly with the analysis of $\textsc{Locator}$ but
noting that there are no batched updates, we have
\[ \tO{
\underbrace{k^4}_{\text{\#\textsc{Checker}s}}
\cdot \underbrace{m \epsilon_{\mathrm{solve}}^{-2}}_{\text{\#calls per \textsc{Checker}}}
\cdot \underbrace{\beta_{\textsc{Checker}}^{-2} \varepsilon^{-2}}_{\text{runtime per call}}
} = \tO{mk^{78}}\,. \]

For $\textsc{Checker}.\textsc{TemporaryUpdate}$, we have
\[
\tO{
\underbrace{k^4}_{\text{\#\textsc{Checker}s}}
\cdot
\underbrace{m^{1/2} / k}_{\text{\# calls to \textsc{MultiStep}}}
\cdot
\underbrace{k^{16}}_{\text{\# calls per \textsc{MultiStep}}}
\cdot
\underbrace{(k^{16} \beta_{\textsc{Checker}}^{-2} \varepsilon^{-2})^2}_{\text{runtime per call}}
}
= \tO{m^{1/2} k^{187}}\,.
\]
Finally, note that, by definition, computing the vectors $\boldsymbol{\mathit{\pi}}_{old}^i$ takes $\tO{m^{3/2}/k}$,
as we do it once per $k^{4}$ calls to $\textsc{MultiStep}$ and it takes $\tO{mk^4}$.

As long as $k \leq m^{1/316}$, the total runtime because of $\textsc{Checker}$
is $\tO{m^{3/2}/k}$.
\end{proof}

\section{Auxiliary Lemmas}
\label{sec:aux}

\begin{replemma}{lem:sc-energy-bd}
Let $\boldsymbol{\mathit{d}}$ be a demand vector,  let $\boldsymbol{\mathit{r}}$ be resistances, and let $C \subseteq V$ be a subset of vertices.
Then
\[
\mathcal{E}_{\boldsymbol{\mathit{r}}}\left( \boldsymbol{\mathit{\pi}}^C(\boldsymbol{\mathit{d}}) \right) \leq \mathcal{E}_{\boldsymbol{\mathit{r}}}\left( \boldsymbol{\mathit{d}} \right) \,.
\]
\end{replemma}
\begin{proof}
Letting $F = V\setminus C$, and $\boldsymbol{\mathit{L}}$ be the Laplacian of the underlying graph, we can write
\[
\boldsymbol{\mathit{\pi}}^C(\boldsymbol{\mathit{d}}) = \boldsymbol{\mathit{d}}_C - \boldsymbol{\mathit{L}}_{CF} \boldsymbol{\mathit{L}}_{FF}^{-1} \boldsymbol{\mathit{d}}_F\,.
\]
By factoring  $\boldsymbol{\mathit{L}}^+$ as
\begin{align*}
\boldsymbol{\mathit{L}}^+ =\left[\begin{array}{cc}
I & 0\\
-\boldsymbol{\mathit{L}}_{FF}^{-1}\boldsymbol{\mathit{L}}_{FC} & I
\end{array}\right]\left[\begin{array}{cc}
SC(\boldsymbol{\mathit{L}},C)^{+} & 0\\
0 & \boldsymbol{\mathit{L}}_{FF}^{-1}
\end{array}\right]\left[\begin{array}{cc}
I & -\boldsymbol{\mathit{L}}_{CF}\boldsymbol{\mathit{L}}_{FF}^{-1}\\
0 & I
\end{array}\right]
\end{align*}
we can write
\begin{align*}
\mathcal{E}_{\boldsymbol{\mathit{r}}}(\boldsymbol{\mathit{d}}) = \boldsymbol{\mathit{d}}^\top \boldsymbol{\mathit{L}}^+ \boldsymbol{\mathit{d}}  =
\left[\begin{array}{cc}
\boldsymbol{\mathit{\pi}}^C(\boldsymbol{\mathit{d}}) \\
\boldsymbol{\mathit{d}}_F
\end{array}\right]^\top \left[\begin{array}{cc}
SC(\boldsymbol{\mathit{L}},C)^{+} & 0\\
0 & \boldsymbol{\mathit{L}}_{FF}^{-1}
\end{array}\right]\left[\begin{array}{cc}
\boldsymbol{\mathit{\pi}}^C(\boldsymbol{\mathit{d}}) \\
\boldsymbol{\mathit{d}}_F
\end{array}\right]
= \|\boldsymbol{\mathit{\pi}}^C(\boldsymbol{\mathit{d}})\|_{SC(\boldsymbol{\mathit{L}},C)^+}^2 + \|\boldsymbol{\mathit{d}}_F\|_{\boldsymbol{\mathit{L}}_{FF}^{-1}}^2\,.
\end{align*}
Furthermore, we can use the same factorization to write
\begin{align*}
\mathcal{E}_{\boldsymbol{\mathit{r}}}(\boldsymbol{\mathit{\pi}}^C(\boldsymbol{\mathit{d}})) =
\left[\begin{array}{cc}
\boldsymbol{\mathit{\pi}}^C(\boldsymbol{\mathit{d}}) \\
0
\end{array}\right]^\top \left[\begin{array}{cc}
SC(\boldsymbol{\mathit{L}},C)^{+} & 0\\
0 & \boldsymbol{\mathit{L}}_{FF}^{-1}
\end{array}\right]\left[\begin{array}{cc}
\boldsymbol{\mathit{\pi}}^C(\boldsymbol{\mathit{d}}) \\
0
\end{array}\right]
= \|\boldsymbol{\mathit{\pi}}^C(\boldsymbol{\mathit{d}})\|_{SC(\boldsymbol{\mathit{L}},C)^+}^2\,,
\end{align*}
which proves the claim.
\end{proof}

\begin{lemma}
For any $\mu\in(1/\mathrm{poly}(m),\mathrm{poly}(m))$, we have
$\left\|\boldsymbol{\mathit{r}}(\mu)\right\|_\infty \leq m^{\tO{\log m}}$.
\end{lemma}
\begin{proof}

By Appendix A in~\cite{axiotis2020circulation}, for some
$\mu_0 = \Theta(\left\|\boldsymbol{\mathit{c}}\right\|_2)$,
the solution $\boldsymbol{\mathit{f}} = \boldsymbol{\mathit{u}} / 2$
has
\[
\left\|\boldsymbol{\mathit{C}}^\top \left(\frac{\boldsymbol{\mathit{c}}}{\mu_0} +
\frac{\mathbf{1}}{\ss^+} - \frac{\mathbf{1}}{\ss^-}\right)\right\|_{(\boldsymbol{\mathit{C}}^\top \boldsymbol{\mathit{R}} \boldsymbol{\mathit{C}})^+} \leq 1/10\,.\] This implies that
$\min_e \left\{s_e(\mu_0)^+,s_e(\mu_0)^-\right\}
\geq \min_e u_e / 4 \geq 1/4$, and so
$\left\|\boldsymbol{\mathit{r}}(\mu_0)\right\|_\infty \leq O(1)$.
Additinally,
$\left\|\boldsymbol{\mathit{c}}\right\|_\infty \in\left[1,\mathrm{poly}(m)\right]$,
so
$\mu_0 = \Theta\left(\mathrm{poly}(m)\right)$.

Now, for any integer $i \geq 0$ we let
$\mu_{i+1} = \mu_{i}\cdot (1 - 1/\sqrt{m})^{\sqrt{m}/10}$.
By Lemma~\ref{lem:resistance_stability2} we have that
$\boldsymbol{\mathit{r}}\left(\mu_{i+1}\right) \approx_{m^2}
\boldsymbol{\mathit{r}}\left(\mu_{i}\right)$, and so
\[ \boldsymbol{\mathit{r}}\left(\frac{1}{\mathrm{poly}(m)}\right)
= \boldsymbol{\mathit{r}}(\mu_{\tO{\log m}})
\leq \left(\frac{9}{100} m^2\right)^{\tO{\log m}} \boldsymbol{\mathit{r}}(\mu_0)
\leq m^{\tO{\log m}} \boldsymbol{\mathit{r}}(\mu_0)
\leq m^{\tO{\log m}} \,. \]
\end{proof}

\begin{lemma}
Given a graph $G(V,E)$ with resistances $\boldsymbol{\mathit{r}}$ and any parameter $\varepsilon > 0$,
there exists an algorithm that runs in time $\tO{m/\varepsilon^2}$ and produces
a matrix $\boldsymbol{\mathit{Q}}\in\mathbb{R}^{\tO{1/\varepsilon^2}\times n}$ such that
with high probability
for any $u,v\in V$,
\[ R_{eff}(u,v) \approx_{1+\varepsilon} \left\|\boldsymbol{\mathit{Q}}\mathbf{1}_u - \boldsymbol{\mathit{Q}}\mathbf{1}_v\right\|_2^2\]
\label{lem:approx_effective_res}
\end{lemma}

\section{The \textsc{Checker} Data Structure}
\label{sec:checker}

\begin{theorem}[Theorem 3, \cite{gao2021fully}]
There is a \textsc{Checker} data structure supporting the following operations with the given runtimes
against oblivious adversaries, for parameters $0 < \beta_{\textsc{Checker}},\varepsilon < 1$ such that
$\beta_{\textsc{Checker}} \geq \tOm{\varepsilon^{-1/2}/m^{1/4}}$.
\begin{itemize}
\item{\textsc{Initialize}$(\boldsymbol{\mathit{f}}, \varepsilon, \beta_{\textsc{Checker}})$:
Initializes the data structure with slacks
$\ss^+ = \boldsymbol{\mathit{u}} - \boldsymbol{\mathit{f}}$,
$\ss^- = \boldsymbol{\mathit{f}}$,
and resistances $\boldsymbol{\mathit{r}} = \frac{1}{(\ss^+)^2} + \frac{1}{(\ss^-)^2}$.
Runtime: $\tO{m\beta_{\textsc{Checker}}^{-4} \varepsilon^{-4}}$.
}
\item{\textsc{Update}$(e,\boldsymbol{\mathit{f}}')$:
Set $s_e^+ = u_e - f_e'$, $s_e^- = f_e'$, and $r_e = \frac{1}{(s_e^+)^2} + \frac{1}{(s_e^-)^2}$.
Runtime: Amortized $\tO{\beta_{\textsc{Checker}}^{-2} \varepsilon^{-2}}$.
}
\item{\textsc{TemporaryUpdate}$(e,\boldsymbol{\mathit{f}}')$:
Set $s_e^+ = u_e - f_e'$, $s_e^- = f_e'$, and $r_e = \frac{1}{(s_e^+)^2} + \frac{1}{(s_e^-)^2}$.
Runtime: Worst case $\tO{(K \beta_{\textsc{Checker}}^{-2} \varepsilon^{-2})^2}$, where $K$
is the number of $\textsc{TemporaryUpdate}$s that have not been rolled back
using $\textsc{Rollback}$. All $\textsc{TemporaryUpdate}$s should be rolled back
before the next call to $\textsc{Update}$.
}
\item{\textsc{Rollback}$()$: Rolls back the last $\textsc{TemporaryUpdate}$ if it
exists. The runtime is the same as the original operation.
}
\item{\textsc{Check}$(e, \boldsymbol{\mathit{\pi}}_{old})$:
Returns $\widetilde{f}_e$ such that $\sqrt{r_e}\left|\widetilde{f}_e - \widetilde{f}_e^*\right| \leq \varepsilon$, where
\[ \boldsymbol{\mathit{\widetilde{f}}}^* = \delta g(\ss) - \delta \boldsymbol{\mathit{R}}^{-1} \boldsymbol{\mathit{B}} \left(\boldsymbol{\mathit{B}}^\top \boldsymbol{\mathit{R}}^{-1} \boldsymbol{\mathit{B}} \right)^+ \boldsymbol{\mathit{B}}^\top g(\ss)\,, \]
for $\delta = 1/\sqrt{m}$. Additionally, a vector $\boldsymbol{\mathit{\pi}}_{old}$ that is supported
on $C$ such that
\[ \mathcal{E}_{\boldsymbol{\mathit{r}}}\left(
 \boldsymbol{\mathit{\pi}}_{old} - \boldsymbol{\mathit{\pi}}^{C} \left(\boldsymbol{\mathit{B}}^\top g(\ss)\right) \right) \leq \varepsilon^2 m / 4 \]
is provided, where $C$ is the vertex set of the dynamic sparsifier
in the $\textsc{DynamicSC}$ that is maintained internally.
Runtime: Worst case $\tO{\left(\beta_{\textsc{Checker}} m + (K\beta_{\textsc{Checker}}^{-2} \varepsilon^{-2})^2\right) \varepsilon^{-2} }$, where $K$
is the number of $\textsc{TemporaryUpdate}$s that have not been rolled back.
Additionally, the output of \textsc{Check}$(e)$ is independent of any previous calls to
\textsc{Check}.
}
\end{itemize}
Finally, all calls to $\textsc{Check}$ return valid outputs with high probability.
The total number of \textsc{Update}s and \textsc{TemporaryUpdate}s that have not been
rolled back should always be $O(\beta_{\textsc{Checker}} m)$.
\label{thm:checker}
\end{theorem}

This theorem is from~\cite{gao2021fully}. The only difference is in the guarantee of $\textsc{Check}$. We will now show how it can be implemented.
Let
\[ \boldsymbol{\mathit{\widetilde{f}}}^* = \delta g(\ss) - \delta \boldsymbol{\mathit{R}}^{-1} \boldsymbol{\mathit{B}} \boldsymbol{\mathit{L}}^+ \boldsymbol{\mathit{B}}^\top g(\ss)\,. \]
Let $\textsc{DynamicSC}$ be the underlying Schur complement data structure.
We first add the endpoints $u,w$ of $e$ as terminals by calling
\[ \textsc{DynamicSC}.\textsc{TemporaryAddTerminals}(\{u,w\}) \]
so that the new Schur complement is on the vertex set $C' = C\cup\{u,w\}$.
Then, we set
\[ \boldsymbol{\mathit{\phi}} = -\widetilde{SC}^+ \boldsymbol{\mathit{\pi}}_{old}\]
and $\widetilde{f}_e = (\phi_u - \phi_w) / \sqrt{r_e}$, where $\widetilde{SC}$ is the output of
$\textsc{DynamicSC}.\widetilde{SC}()$. Equivalently, note that
\[ \widetilde{f}_e = \delta \cdot \mathbf{1}_e^\top \boldsymbol{\mathit{R}}^{-1} \boldsymbol{\mathit{B}} \boldsymbol{\mathit{L}}^+ \boldsymbol{\mathit{\pi}}_{old}\,.\]
We will show that $\sqrt{r_e}\left|\widetilde{f}_e - \widetilde{f}_e^*\right| \leq \varepsilon$.

We write
\begin{align*}
&  \sqrt{r_e} \left|\widetilde{f}_e - \widetilde{f}_e^*\right| \\
& \leq \left\|\delta \sqrt{\boldsymbol{\mathit{r}}} g(\ss)\right\|_\infty
+ \left\|\delta \boldsymbol{\mathit{R}}^{-1/2} \boldsymbol{\mathit{B}} \boldsymbol{\mathit{L}}^+ \left(\boldsymbol{\mathit{B}}^\top g(\ss) - \boldsymbol{\mathit{\pi}}^{C'}\left(\boldsymbol{\mathit{B}}^\top g(\ss)\right)\right)\right\|_\infty\\
& + \left\|\delta \boldsymbol{\mathit{R}}^{-1/2} \boldsymbol{\mathit{B}} \boldsymbol{\mathit{L}}^+ \left(
\boldsymbol{\mathit{\pi}}^{C'}\left(\boldsymbol{\mathit{B}}^\top g(\ss)\right)
- \boldsymbol{\mathit{\pi}}^C\left(\boldsymbol{\mathit{B}}^\top g(\ss)\right)
\right)\right\|_\infty
+ \left\|\delta \boldsymbol{\mathit{R}}^{-1/2} \boldsymbol{\mathit{B}} \boldsymbol{\mathit{L}}^+ \left(\boldsymbol{\mathit{\pi}}^C\left(\boldsymbol{\mathit{B}}^\top g(\ss)\right) - \boldsymbol{\mathit{\pi}}_{old}\right)\right\|_\infty\,.
\end{align*}
For the first term,
\[ \left\|\delta \sqrt{\boldsymbol{\mathit{r}}} g(\ss)\right\|_\infty = \left\|\delta \frac{\frac{1}{\ss^+} - \frac{1}{\ss^-}}{\sqrt{\frac{1}{(\ss^+)^2} + \frac{1}{(\ss^-)^2}}}\right\|_\infty \leq \delta \leq \varepsilon / 10\,.\]
Now, by the fact that $C'$ is a $\beta_{\textsc{Checker}}$-congestion reduction subset by definition in $\textsc{DynamicSC}$,
Lemma~\ref{lem:non-projected-demand-contrib} immediately implies that the second term is
$\leq \delta \cdot \tO{\beta_{\textsc{Checker}}^{-2}} \leq \varepsilon/10$.

For the third term, we apply Lemma~\ref{lem:old_projection_approximate}, which shows that
\begin{align*}
& \left\|\delta \boldsymbol{\mathit{R}}^{-1/2} \boldsymbol{\mathit{B}} \boldsymbol{\mathit{L}}^+ \left(
\boldsymbol{\mathit{\pi}}^{C'}\left(\boldsymbol{\mathit{B}}^\top g(\ss)\right)
- \boldsymbol{\mathit{\pi}}^C\left(\boldsymbol{\mathit{B}}^\top g(\ss)\right)
\right)\right\|_\infty\\
& \leq
\delta \cdot \sqrt{\mathcal{E}_{\boldsymbol{\mathit{r}}}\left(
\boldsymbol{\mathit{\pi}}^{C'}\left(\boldsymbol{\mathit{B}}^\top g(\ss)\right)
- \boldsymbol{\mathit{\pi}}^C\left(\boldsymbol{\mathit{B}}^\top g(\ss)\right)
\right)}\\
& \leq \delta \cdot \tO{\beta_{\textsc{Checker}}^{-2}}\\
& \leq \varepsilon / 10\,,
\end{align*}
as the resistances don't change and we only have two terminal insertions from $C$ to $C'$.

Finally, the fourth term is
\[\left\|\delta \boldsymbol{\mathit{R}}^{-1/2} \boldsymbol{\mathit{B}} \boldsymbol{\mathit{L}}^+ \left(\boldsymbol{\mathit{\pi}}^C\left(\boldsymbol{\mathit{B}}^\top g(\ss)\right) - \boldsymbol{\mathit{\pi}}_{old}\right)\right\|_\infty
\leq \delta \cdot \sqrt{\mathcal{E}_{\boldsymbol{\mathit{r}}}
\left(\boldsymbol{\mathit{\pi}}^C\left(\boldsymbol{\mathit{B}}^\top g(\ss)\right) - \boldsymbol{\mathit{\pi}}_{old}\right)}
\leq \delta \cdot \varepsilon \sqrt{m} / 2
= \varepsilon / 2\,.
\]

We conclude that $\sqrt{r_e}\left|\widetilde{f}_e - \widetilde{f}_e^*\right| \leq \varepsilon$.
Finally, we call $\textsc{DynamicSC}.\textsc{Rollback}$ to undo the terminal insertions.

The runtime of this operation is dominated by the call to
$\textsc{DynamicSC}.\widetilde{SC}()$, which takes time
$\tO{(\beta_{\textsc{Checker}} m + (K\beta_{\textsc{Checker}}^{-2} \varepsilon^{-2})^2)\varepsilon^{-2}}$.

\section{The Demand Projection Data Structure}
\label{sec:demand_projection}

The main goal of this section is to construct an $(\alpha,\beta,\varepsilon)$-\textsc{DemandProjector},
as defined in Definition~\ref{def:demand_projector}, and thus prove Lemma~\ref{lem:ds}.
The most important operation that needs to be implemented in order to prove Lemma~\ref{lem:ds} is
to maintain the demand projection after inserting a vertex $v\in V\backslash C$ to $C$.
In order to do this, we use the following identity from~\cite{gao2021fully}:
\begin{align}
\boldsymbol{\mathit{\pi}}^{C\cup\{v\}}\left(\boldsymbol{\mathit{d}}\right)
= \boldsymbol{\mathit{\pi}}^C\left(\boldsymbol{\mathit{d}}\right)
+ \pi_v^{C\cup\{v\}}\left(\boldsymbol{\mathit{d}}\right) \cdot \left(\mathbf{1}_v - \boldsymbol{\mathit{\pi}}^C(\mathbf{1}_v)\right)\,,
\label{eq:projection_update}
\end{align}
where $\boldsymbol{\mathit{d}}$ is any demand (in our case, we have
$\boldsymbol{\mathit{d}} = \boldsymbol{\mathit{B}}^\top \frac{\boldsymbol{\mathit{q}}_S}{\sqrt{\boldsymbol{\mathit{r}}}}$ for some $S\subseteq E$).
For this, we need to compute approximations to
$\pi_v^{C\cup\{v\}}\left(\boldsymbol{\mathit{B}}^\top \frac{\boldsymbol{\mathit{q}}_S}{\sqrt{\boldsymbol{\mathit{r}}}}\right)$
and $\boldsymbol{\mathit{\pi}}^C\left(\mathbf{1}_v\right)$.

In Section~\ref{sec:approx1}, we will show
that if $S$ is a subset of $\gamma$-important edges, we can efficiently
estimate
$\pi_v^{C\cup\{v\}}\left(\boldsymbol{\mathit{B}}^\top \frac{\boldsymbol{\mathit{q}}_S}{\sqrt{\boldsymbol{\mathit{r}}}}\right)$ up to
additive accuracy $\frac{\widehat{\eps}}{R_{eff}(C,v)}$ by sampling random walks
to $C$ starting only from edges with relatively high resistance.
For the remaining edges, the $\gamma$-importance property will imply that
we are not losing much by ignoring them.

Then, in Section~\ref{sec:approx2} we will show how to approximate $\mathbf{1}_v - \boldsymbol{\mathit{\pi}}^C(\mathbf{1}_v)$.
This is equivalent to estimating the hitting probabilities from $v$ to $C$.
The guarantee that we would ideally like to get is on the error to route
\begin{align}
\mathcal{E}_{\boldsymbol{\mathit{r}}}\left(\widetilde{\boldsymbol{\mathit{\pi}}}^C(\mathbf{1}_v) - \boldsymbol{\mathit{\pi}}^C(\mathbf{1}_v)\right) \leq \widehat{\eps}^2 R_{eff}(C,v)\,.
\label{eq:ideal_energy_bound}
\end{align}
Note that this is not possible to do efficiently for general $C$. For example, suppose that
the hitting distribution is uniform. In this case, $\Omega(|C|)$ random walks are required
to get a bound similar to (\ref{eq:ideal_energy_bound}). However, it might still be possible
to guarantee it by using the structure of $C$, and this would simplify some parts of our analysis.
Instead, we are going to work with the following weaker approximation bound:
For any fixed potential vector $\boldsymbol{\mathit{\phi}}\in\mathbb{R}^n$ with $E_{\boldsymbol{\mathit{r}}}(\boldsymbol{\mathit{\phi}}) \leq 1$, we have w.h.p.
\begin{align}
\left|\left\langle \widetilde{\boldsymbol{\mathit{\pi}}}^C(\mathbf{1}_v) - \boldsymbol{\mathit{\pi}}^C(\mathbf{1}_v), \boldsymbol{\mathit{\phi}}\right\rangle\right| \leq \widehat{\eps} \sqrt{R_{eff}(C,v)}\,.
\label{eq:less_than_ideal_energy_bound}
\end{align}

Now, using these estimation lemmas, we will bound how our demand projection
degrades when inserting a new vertex into $C$.
This is stated in the following lemma and proved in Appendix~\ref{proof_lem_insert1}.
\begin{lemma}[Inserting a new vertex to $C$]
Consider a graph $G(V,E)$ with resistances $\boldsymbol{\mathit{r}}$, $\boldsymbol{\mathit{q}}\in[-1,1]^m$,
a $\beta$-congestion reduction subset $C$,
and $v\in V\backslash C$.
We also suppose that we
have an estimate of the $C-v$ effective resistance
such that ${\widetilde{R}}_{eff}(C,v) \approx_{2} R_{eff}(C,v)$, as well as to
independent random walks
$\mathcal{P}^{u,e,i}$ for each $u\in V\backslash C$, $e\in E\backslash E(C)$ with $u\in e$, $i\in[h]$,
where each random walk starts from $u$ and ends at $C$.

If we let $S$ be a subset of
$\gamma$-important edges
for $\gamma > 0$,
then for any error parameter $\widehat{\eps} > 0$ we can compute
$\widetilde{\mathit{\pi}}_v^{C\cup\{v\}}\left(\boldsymbol{\mathit{B}}^\top \frac{\boldsymbol{\mathit{q}}_S}{\sqrt{\boldsymbol{\mathit{r}}}}\right)\in\mathbb{R}$
and
$\widetilde{\mathit{\pi}}^{C\cup\{v\}}\left(\boldsymbol{\mathit{B}}^\top \frac{\boldsymbol{\mathit{q}}_S}{\sqrt{\boldsymbol{\mathit{r}}}}\right)\in\mathbb{R} \in \mathbb{R}^n$
such that with high probability
\begin{align*}
\left|\widetilde{\mathit{\pi}}_{v}^{C\cup\{v\}}\left(\boldsymbol{\mathit{B}}^\top \frac{\boldsymbol{\mathit{q}}_S}{\sqrt{\boldsymbol{\mathit{r}}}}\right)
- \pi_{v}^{C\cup\{v\}}\left(\boldsymbol{\mathit{B}}^\top \frac{\boldsymbol{\mathit{q}}_S}{\sqrt{\boldsymbol{\mathit{r}}}}\right)\right|
\leq \frac{\widehat{\eps}}{ \sqrt{R_{eff}(C,v)}}\,,
\end{align*}
as long as $h=\tOm{\widehat{\eps}^{-4}\beta^{-6}+\widehat{\eps}^{-2}\beta^{-2}\gamma^{-2}}$.
Furthermore, for any fixed $\boldsymbol{\mathit{\phi}}$, $E_{\boldsymbol{\mathit{r}}}(\boldsymbol{\mathit{\phi}}) \leq 1$, after $T$ insertions after the last call to $\textsc{Initialize}$, with high probability
\begin{align*}\label{eq:insert_error}
\left|\left\langle
 \widetilde{\boldsymbol{\mathit{\pi}}}^{C\cup\{v\}}\left(\boldsymbol{\mathit{B}}^\top \frac{\boldsymbol{\mathit{q}}_S}{\sqrt{\boldsymbol{\mathit{r}}}}\right)
 -
\boldsymbol{\mathit{\pi}}^{C\cup\{v\}}\left(\boldsymbol{\mathit{B}}^\top \frac{\boldsymbol{\mathit{q}}_S}{\sqrt{\boldsymbol{\mathit{r}}}}\right)
, \boldsymbol{\mathit{\phi}}\right\rangle\right| \leq \widehat{\eps} T\,,
\end{align*}
as long as
$h = \tOm{\widehat{\eps}^{-2} \beta^{-4} \gamma^{-2}}$.

\label{lem:insert1}
\end{lemma}
\begin{algorithm} %
\begin{algorithmic}[1]
\caption{\textsc{DemandProjector} \textsc{DP}.\textsc{AddTerminal}}
\Procedure{\textsc{DP}.\textsc{AddTerminal}}{$v,{\widetilde{R}}_{eff}(C,v)$}
\If {$v\in C$}
\State \Return
\EndIf
\State $t = t + 1$
\State $\widetilde{\mathit{\pi}}_v^{C\cup\{v\}}\left(\boldsymbol{\mathit{B}}^\top \frac{\boldsymbol{\mathit{q}}_S}{\sqrt{\boldsymbol{\mathit{r}}}}\right) = 0$
\For {$u,e\in S,i$ such that $\mathcal{P}^{u,e,i} \ni v$ and ${\widetilde{R}}_{eff}(C,v) \leq
\frac{1}{\left( \min\{\widehat{\eps} / \tO{\beta^{-2}}, \gamma / 4\} \right)^2} r_e$}
	\If {$e = (u,*)$}
		\State $\widetilde{\mathit{\pi}}_v^{C\cup\{v\}}\left(\boldsymbol{\mathit{B}}^\top \frac{\boldsymbol{\mathit{q}}_S}{\sqrt{\boldsymbol{\mathit{r}}}}\right)
		 = \widetilde{\mathit{\pi}}_v^{C\cup\{v\}}\left(\boldsymbol{\mathit{B}}^\top \frac{\boldsymbol{\mathit{q}}_S}{\sqrt{\boldsymbol{\mathit{r}}}}\right) + \frac{1}{h} \frac{q_e}{\sqrt{r_e}}$
	\Else
		\State $\widetilde{\mathit{\pi}}_v^{C\cup\{v\}}\left(\boldsymbol{\mathit{B}}^\top \frac{\boldsymbol{\mathit{q}}_S}{\sqrt{\boldsymbol{\mathit{r}}}}\right)
		 = \widetilde{\mathit{\pi}}_v^{C\cup\{v\}}\left(\boldsymbol{\mathit{B}}^\top \frac{\boldsymbol{\mathit{q}}_S}{\sqrt{\boldsymbol{\mathit{r}}}}\right) - \frac{1}{h} \frac{q_e}{\sqrt{r_e}}$
	\EndIf
	\State Shortcut $\mathcal{P}^{u,e,i}$ at $v$
\EndFor
\State $h' = \tO{\widehat{\eps}^{-2}\beta^{-4}\gamma^{-2}} $ %
\State $\widetilde{\boldsymbol{\mathit{\pi}}}^{C}\left(\mathbf{1}_v\right) = \mathbf{0}$
\For {$i=1,\dots h'$}
	\State Run random walk from $v$ to $C$ with probabilities prop. to $\boldsymbol{\mathit{r}}^{-1}$, let $u$ be the last vertex
	\State $\widetilde{\mathit{\pi}}_u^{C}\left(\mathbf{1}_v\right) = \widetilde{\mathit{\pi}}_u^{C}\left(\mathbf{1}_v\right) + \frac{1}{h'}$
\EndFor
\State $\widetilde{\boldsymbol{\mathit{\pi}}}^{C \cup \{v\}}(\boldsymbol{\mathit{B}}^\top \frac{\boldsymbol{\mathit{q}}_S}{\sqrt{\boldsymbol{\mathit{r}}}}) =\widetilde{\boldsymbol{\mathit{\pi}}}^{C}(\boldsymbol{\mathit{B}}^\top \frac{\boldsymbol{\mathit{q}}_S}{\sqrt{\boldsymbol{\mathit{r}}}}) +  \widetilde{\mathit{\pi}}_v^{C \cup \{v\}}(\boldsymbol{\mathit{B}}^\top \frac{\boldsymbol{\mathit{q}}_S}{\sqrt{\boldsymbol{\mathit{r}}}}) \cdot (\mathbf{1}_v - \widetilde{\mathit{\pi}}^C(\mathbf{1}_v))$
\State $C = C\cup\{v\}$, $F = F\backslash \{v\}$
\EndProcedure
\end{algorithmic}
\end{algorithm}

\subsection{Estimating $\pi_v^{C\cup\{v\}}\left(\boldsymbol{\mathit{B}}^\top \frac{\boldsymbol{\mathit{q}}_S}{\sqrt{\boldsymbol{\mathit{r}}}}\right)$}
\label{sec:approx1}

There is a straightforward algorithm to estimate
$\pi_v^{C\cup\{v\}}\left(\boldsymbol{\mathit{B}}^\top \frac{\boldsymbol{\mathit{q}}_S}{\sqrt{\boldsymbol{\mathit{r}}}}\right)$.
For each edge $e=(u,w)\in E\backslash E(C)$, sample a number of random walks from $u$ and $w$
until they hit $C\cup\{v\}$. Then, add to the estimate $\frac{q_e}{\sqrt{r_e}}$ times the
fraction of the random walks starting from $u$
that contain $v$,
minus $\frac{q_e}{\sqrt{r_e}}$ times the fraction of the
random walks starting from $w$ that contain $v$.
\cite{gao2021fully} uses this sampling method together with
the following concentration bound, to get a good estimate if the resistances
of all congested edges are sufficiently large.

\begin{lemma}[Concentration inequality 1~\cite{gao2021fully}]
Let $S = X_1 + \dots + X_n$ be the sum of $n$ independent random variables. The range of $X_i$ is $\{0,a_i\}$ for $a_i\in[-M,M]$. Let $t,E$ be positive numbers such
that $t \leq E$ and $\sum\limits_{i=1}^n \left|\mathbb{E}[X_i]\right| \leq E$. Then
\[ \Pr\left[|S - \mathbb{E}[S]| > t\right] \leq 2 \exp\left(-\frac{t^2}{6EM}\right) \,.\]
\label{conc1}
\end{lemma}
Unfortunately, in our setting there is no reason to expect
these resistances to be large, so the variance of this estimate might be too high.
We have already introduced the concept of important edges in order to alleviate this problem,
and proved that we only need to look at important edges.
Even if all edges of which the demand projection is estimated
are important (i.e. close to $C$), however, %
$v$ can still be far from $C$. This is an issue, since we don't directly estimate projections
onto $C$, but instead estimate the projection
onto $C\cup\{v\}$ and then from $v$ onto $C$.

Intuitively, however, if $v$ is far from $C$,
it should also be far from the set of important edges, so the insertion of $v$ should
not affect their demand projection too much.
As the distance upper bound between an important edge and $C$ is relative to the scale of
the resistance of that edge, this statement needs be more
fine-grained in order to take the resistances of important edges into account.

More concretely, in the following lemma,
which is proved in Appendix~\ref{proof_estimate1},
we show that if we only compute
demand projection estimates for edges $e$
such that
$r_e \geq c^2 R_{eff}(C,v)$
for some appropriately chosen $c > 0$,
then we can guarantee a good bound on the number of random walks we need to sample.

For the remaining edges, we will show
that the energy of their contributions to the projection is
negligible, so that we can reach to our desired statement in Lemma~\ref{estimate1_final}.

\begin{lemma} %
Consider a graph $G(V,E)$ with resistances $\boldsymbol{\mathit{r}}$, $\boldsymbol{\mathit{q}}\in[-1,1]^n$,
a $\beta$-congestion reduction subset $C$,
as well as $v\in V\backslash C$.
If for some $c>0$ we are given a set of edges
\[ S' \subseteq
\left\{e\in E\backslash E(C)\ |\  \text{$R_{eff}(C,v) \leq \frac{1}{c^2} r_e$}\right\} \,, \]
then for any $\delta_1' > 0$
we can compute
$\widetilde{\mathit{\pi}}_v^{C\cup\{v\}}\left(\boldsymbol{\mathit{B}}^\top \frac{\boldsymbol{\mathit{q}}_{S'}}{\sqrt{\boldsymbol{\mathit{r}}}}\right)\in\mathbb{R}$ such that
with high probability
\[ \left|\widetilde{\mathit{\pi}}_v^{C\cup\{v\}}\left(\boldsymbol{\mathit{B}}^\top \frac{\boldsymbol{\mathit{q}}_{S'}}{\sqrt{\boldsymbol{\mathit{r}}}}\right) - \pi_{v}^{C\cup\{v\}}\left(\boldsymbol{\mathit{B}}^\top \frac{\boldsymbol{\mathit{q}}_{S'}}{\sqrt{\boldsymbol{\mathit{r}}}}\right)\right| \leq \frac{\delta_1'}{\beta c\sqrt{R_{eff}(C,v)}} \,.\]
The algorithm requires access to
$\tO{\delta_1'^{-2} \log n \log \frac{1}{\beta}}$
independent random walks from $u$ to $C$ for each $u\in V\backslash C$ and $e\in E\backslash E(C)$ with $u\in e$.
\label{estimate1}
\end{lemma}

This leads us to the desired statement for this section,
whose proof appears in Appendix~\ref{proof_estimate1_final}.
\begin{lemma}[Estimating $\pi_v^{C\cup\{v\}}\left(\boldsymbol{\mathit{B}}^\top \frac{\boldsymbol{\mathit{q}}}{\sqrt{\boldsymbol{\mathit{r}}}}\right)$]
Consider a graph $G(V,E)$ with resistances $\boldsymbol{\mathit{r}}$, $\boldsymbol{\mathit{q}}\in[-1,1]^n$,
a $\beta$-congestion reduction subset $C$,
as well as $v\in V\backslash C$.
If we are given a set
$S$ of $\gamma$-important edges for some $\gamma \in (0,1)$
and an estimate ${\widetilde{R}}_{eff}(C,v)\approx_{2} R_{eff}(C,v)$,
then for any $\delta_1 \in(0,1)$
we can compute
$\widetilde{\mathit{\pi}}_v^{C\cup\{v\}}\left(\boldsymbol{\mathit{B}}^\top \frac{\boldsymbol{\mathit{q}}_{S}}{\sqrt{\boldsymbol{\mathit{r}}}}\right)\in\mathbb{R}$
such that with high probability
\begin{align}
\left|\widetilde{\mathit{\pi}}_v^{C\cup\{v\}}\left(\boldsymbol{\mathit{B}}^\top \frac{\boldsymbol{\mathit{q}}_{S}}{\sqrt{\boldsymbol{\mathit{r}}}}\right) - \pi_{v}^{C\cup\{v\}}\left(\boldsymbol{\mathit{B}}^\top \frac{\boldsymbol{\mathit{q}}_{S}}{\sqrt{\boldsymbol{\mathit{r}}}}\right)\right|
\leq \frac{\delta_1}{\sqrt{R_{eff}(C,v)}} \,.
\end{align}
The algorithm requires
$\tO{\delta_1^{-4} \beta^{-6} + \delta_1^{-2} \beta^{-2} \gamma^{-2}}$
independent random walks from $u$ to $C$ for each $u\in V\backslash C$
and $e\in E\backslash E(C)$ with $u\in e$.

Additionally, we have
\[ \left|\pi_{v}^{C\cup\{v\}}\left(\boldsymbol{\mathit{B}}^\top \frac{\boldsymbol{\mathit{q}}_{S}}{\sqrt{\boldsymbol{\mathit{r}}}}\right)\right|
\leq \frac{1}{\gamma \sqrt{R_{eff}(C,v)}} \cdot \tO{\frac{1}{\beta^2}} \,.\]
\label{estimate1_final}
\end{lemma}

\subsection{Estimating $\boldsymbol{\mathit{\pi}}^{C}(\mathbf{1}_v)$}
\label{sec:approx2}

In contrast to the quantity
$\pi_v^{C\cup\{v\}}\left(\boldsymbol{\mathit{B}}^\top \frac{\boldsymbol{\mathit{q}}}{\sqrt{\boldsymbol{\mathit{r}}}}\right)$,
where there are cancellations between its two components
$\pi_v^{C\cup\{v\}}\left(\sum\limits_{e=(u,w)\in E}\frac{q_e}{\sqrt{r_e}} \mathbf{1}_u\right)$
and
$\pi_v^{C\cup\{v\}}\left(\sum\limits_{e=(u,w)\in E}-\frac{q_e}{\sqrt{r_e}} \mathbf{1}_w\right)$
(as $\boldsymbol{\mathit{B}}^\top \frac{\boldsymbol{\mathit{q}}}{\sqrt{\boldsymbol{\mathit{r}}}}$ sums up to $\mathbf{0}$),
in $\boldsymbol{\mathit{\pi}}^C\left(\mathbf{1}_v\right)$ there are no cancellations.
The goal is to simply
estimate the hitting probabilities from $v$ to the vertices of $C$,
which can be done by sampling a number of random walks from $v$ to $C$.

As discussed before, even though ideally we would like to have an error bound of the form
$\sqrt{\mathcal{E}_{\boldsymbol{\mathit{r}}}(\widetilde{\boldsymbol{\mathit{\pi}}}^C(\mathbf{1}_v) - \boldsymbol{\mathit{\pi}}^C(\mathbf{1}_v))} \leq \delta_2 \sqrt{R_{eff}(C,v)}$, our analysis is only able to guarantee that for any fixed potential vector $\boldsymbol{\mathit{\phi}}$
with $E_{\boldsymbol{\mathit{r}}}(\boldsymbol{\mathit{\phi}}) \leq 1$, with high probability
$\left|\langle \boldsymbol{\mathit{\phi}}, \widetilde{\boldsymbol{\mathit{\pi}}}^C(\mathbf{1}_v) - \boldsymbol{\mathit{\pi}}^C(\mathbf{1}_v)\rangle\right| \leq \delta_2
\sqrt{R_{eff}(C,v)}$.
However, this is still sufficient for our purposes.

In Appendix~\ref{proof_conc2}
we prove the following general concentration inequality, which basically states that we can estimate the desired hitting
probabilities as long as we have a bound on the $\ell_2$ norm
of the potentials $\boldsymbol{\mathit{\phi}}$ weighted by the hitting probabilities.

\begin{lemma}[Concentration inequality 2]
Let $\boldsymbol{\mathit{\pi}}$ be a probability distribution over $[n]$
and $\widetilde{\boldsymbol{\mathit{\pi}}}$ an empirical distribution of $Z$ samples from $\boldsymbol{\mathit{\pi}}$.
For any $\boldsymbol{\mathit{\bar{\phi}}}\in\mathbb{R}^n$ with $\left\|\boldsymbol{\mathit{\bar{\phi}}}\right\|_{\boldsymbol{\mathit{\pi}},2}^2 \leq \mathcal{V}$, we have
\[\Pr\left[\left|\langle \widetilde{\boldsymbol{\mathit{\pi}}} - \boldsymbol{\mathit{\pi}}, \boldsymbol{\mathit{\bar{\phi}}}\rangle\right| > t\right] \leq \frac{1}{n^{100}} + \tO{\log \left(n \cdot \mathcal{V} / t\right)}\exp\left(- \frac{Z t^2}{\tO{\mathcal{V} \log^2 n}} \right) \,.\]
\label{conc2}
\end{lemma}

We will apply it for $\boldsymbol{\mathit{\bar{\phi}}} = \boldsymbol{\mathit{\phi}} - \phi_v\cdot \mathbf{1}$, and it is important
to note that $\mathcal{E}_{\boldsymbol{\mathit{r}}}(\boldsymbol{\mathit{\bar{\phi}}}) = \mathcal{E}_{\boldsymbol{\mathit{r}}}(\boldsymbol{\mathit{\phi}})$.
In order to get a bound on $\left\|\boldsymbol{\mathit{\bar{\phi}}}\right\|_{\boldsymbol{\mathit{\pi}}^C\left(\mathbf{1}_v\right),2}^2$,
we use the following lemma,
which is proved in Appendix~\ref{proof_lem_variance}.
\begin{lemma}[Bounding the second moment of potentials]
For any graph $G$, resistances $\boldsymbol{\mathit{r}}$, potentials $\boldsymbol{\mathit{\phi}}$ with
$E_{\boldsymbol{\mathit{r}}}(\boldsymbol{\mathit{\phi}}) \leq 1$,
$C \subseteq V$ and $v\in V\backslash C$ we have
$
\left\|\boldsymbol{\mathit{\phi}} - \phi_v \mathbf{1}\right\|_{\boldsymbol{\mathit{\pi}}^C(\mathbf{1}_v),2}^2
\leq 8 \cdot R_{eff}(C,v)$.
\label{lem:variance}
\end{lemma}
To give some intuition on this, consider the case when $V = C\cup\{v\} = \{1,\dots,k\}\cup\{v\}$,
and there are edges $e_1,\dots,e_k$ between $C$ and $v$, one for each vertex of $C$.
Then, we have
$\pi_i^C(\mathbf{1}_v) = (r_{e_i})^{-1} / \sum\limits_{i=1}^k (r_{e_i})^{-1}$, and so
\[
\left\|\boldsymbol{\mathit{\bar{\phi}}}\right\|_{\boldsymbol{\mathit{\pi}}^C\left(\mathbf{1}_v\right),2}^2
= \sum\limits_{i=1}^k \frac{(\phi_i - \phi_v)^2}{r_{e_i}} \cdot \left(\sum\limits_{i=1}^k (r_{e_i})^{-1}\right)^{-1}
\leq \mathcal{E}_{\boldsymbol{\mathit{r}}}(\boldsymbol{\mathit{\bar{\phi}}}) \cdot R_{eff}(C,v)
\leq R_{eff}(C,v)\,.
\]
We finally arrive at the desired statement about estimating $\boldsymbol{\mathit{\pi}}^C(\mathbf{1}_v)$.
\begin{lemma}[Estimating $\boldsymbol{\mathit{\pi}}^C(\mathbf{1}_v)$]
Consider a graph $G(V,E)$ with resistances $\boldsymbol{\mathit{r}}$,
a $\beta$-congestion reduction subset $C$, as well as $v\in V\backslash C$.
Then, for any $\delta_2 > 0$,
we can compute $\widetilde{\boldsymbol{\mathit{\pi}}}^{C}\left(\mathbf{1}_v\right)\in\mathbb{R}^n$ such that with high probability
\begin{align}
    \left|\langle \boldsymbol{\mathit{\phi}}, \widetilde{\boldsymbol{\mathit{\pi}}}^{C}\left(\mathbf{1}_{v}\right) - \boldsymbol{\mathit{\pi}}^{C}\left(\mathbf{1}_{v}\right)\rangle\right| \leq \delta_2 \cdot \sqrt{R_{eff}(C,v)}\,,
    \label{eq:inner_product_bound}
\end{align}
where $\boldsymbol{\mathit{\phi}}\in\mathbb{R}^n$ is a fixed vector with $E_{\boldsymbol{\mathit{r}}}(\boldsymbol{\mathit{\phi}}) \leq 1$.
The algorithm computes $\tO{\frac{\log n}{\delta_2^2}}$ random walks from $v$ to $C$.
\label{estimate2}
\end{lemma}
\begin{proof}
Because both $\widetilde{\boldsymbol{\mathit{\pi}}}^C(\mathbf{1}_v)$ and $\boldsymbol{\mathit{\pi}}^C(\mathbf{1}_v)$
are probability distributions, the quantity (\ref{eq:inner_product_bound}) doesn't
change when a multiple of $\mathbf{1}$ is added to $\boldsymbol{\mathit{\phi}}$,
and so we can replace it by $\boldsymbol{\mathit{\bar{\phi}}} = \boldsymbol{\mathit{\phi}} - \phi_v \mathbf{1}$.

Now, $\widetilde{\boldsymbol{\mathit{\pi}}}^C\left(\mathbf{1}_v\right)$ will be defined as the empirical hitting distribution
that results from sampling $Z$ random walks from $v$ to $C$.
Directly applying the concentration bound in Lemma~\ref{conc2} and setting
$Z = \tO{\frac{\log n}{\delta_2^2}}$,
together with the fact that
$\left\|\boldsymbol{\mathit{\bar{\phi}}}\right\|_{\boldsymbol{\mathit{\pi}}^C(\mathbf{1}_v),2}^2
\leq 8\cdot R_{eff}(C,v)$ by Lemma~\ref{lem:variance} and
$\log \log R_{eff}(C,v) \leq O(\log\log n)$,
we get
\begin{align*}
& \Pr\left[\left|\langle \widetilde{\boldsymbol{\mathit{\pi}}}^C(\mathbf{1}_v) - \boldsymbol{\mathit{\pi}}^{C}(\mathbf{1}_v), \boldsymbol{\mathit{\bar{\phi}}}\rangle\right| >
\delta_2 \cdot \sqrt{R_{eff}(C,v)}\right] < \frac{1}{n^{10}}\,.
\end{align*}
\end{proof}

\subsection{Proof of Lemma~\ref{lem:ds}}

We are now ready for the proof of Lemma~\ref{lem:ds}.
\begin{proof}[Proof of Lemma~\ref{lem:ds}]
Let $\textsc{DP}$ be a demand projection data structure. We analyze its operations one by one.

\begin{algorithm} %
\begin{algorithmic}[1]
\caption{\textsc{DemandProjector} \textsc{DP}.\textsc{Initialize} }
\Procedure{\textsc{DP}.\textsc{Initialize}}{$C,\boldsymbol{\mathit{r}},\boldsymbol{\mathit{q}},S,\mathcal{P}$}
\State Initialize $C,\boldsymbol{\mathit{r}},\boldsymbol{\mathit{q}},S,\mathcal{P}$
\State $F = V\backslash C$
\State %
$h = \tO{\widehat{\eps}^{-4}\beta^{-6}+\widehat{\eps}^{-2}  \beta^{-4} \gamma^{-2}}$
\Comment{\#random walks for each pair $u\in V$, $e\in E$ with $u\in e$}
\State $t = 0$ \Comment{\#calls to \textsc{AddTerminal} since last call to $\textsc{UpdateFull}$}

\State $\boldsymbol{\mathit{\phi}} = \boldsymbol{\mathit{L}}_{FF}^+ \left[\boldsymbol{\mathit{B}}^\top \frac{\boldsymbol{\mathit{q}}_S}{\sqrt{\boldsymbol{\mathit{r}}}}\right]_F$
 \State $\widetilde{\boldsymbol{\mathit{\pi}}}^C\left(\boldsymbol{\mathit{B}}^\top \frac{\boldsymbol{\mathit{q}}_S}{\sqrt{\boldsymbol{\mathit{r}}}}\right) = \left[\boldsymbol{\mathit{B}}^\top \frac{\boldsymbol{\mathit{q}}_S}{\sqrt{\boldsymbol{\mathit{r}}}}\right]_C - \boldsymbol{\mathit{L}}_{CF}\boldsymbol{\mathit{\phi}}$
\EndProcedure
\end{algorithmic}
\end{algorithm}
\noindent {\bf \textsc{DP}.$\textsc{Initialize}(C,\boldsymbol{\mathit{r}},\boldsymbol{\mathit{q}},S,\mathcal{P})$:}
We initialize the values of $C,\boldsymbol{\mathit{r}},\boldsymbol{\mathit{q}},S,\mathcal{P}$.

Then we exactly compute
the demand projection, i.e. $\widetilde{\boldsymbol{\mathit{\pi}}}^C\left(\boldsymbol{\mathit{B}}^\top \frac{\boldsymbol{\mathit{q}}_S}{\sqrt{\boldsymbol{\mathit{r}}}}\right) =
\boldsymbol{\mathit{\pi}}^C\left(\boldsymbol{\mathit{B}}^\top \frac{\boldsymbol{\mathit{q}}_S}{\sqrt{\boldsymbol{\mathit{r}}}}\right)$,
which takes time $\tO{m}$ as shown in~\cite{gao2021fully}.
More specifically, we have
$
\boldsymbol{\mathit{\pi}}^C\left(\boldsymbol{\mathit{B}}^\top \frac{\boldsymbol{\mathit{q}}_S}{\sqrt{\boldsymbol{\mathit{r}}}}\right)
=
\begin{pmatrix}\boldsymbol{\mathit{I}} & \boldsymbol{\mathit{L}}_{CF} \boldsymbol{\mathit{L}}_{FF}^{-1}\end{pmatrix} \boldsymbol{\mathit{B}}^\top \frac{\boldsymbol{\mathit{q}}_S}{\sqrt{\boldsymbol{\mathit{r}}}}
$
which only requires applying the operators $\boldsymbol{\mathit{L}}_{FF}^{-1}$ and $\boldsymbol{\mathit{L}}_{CF}$.

\noindent{\bf \textsc{DP}.\textsc{AddTerminal}($v$, ${\widetilde{R}}_{eff}(C,v)$):}
We will serve this operation by applying Lemma~\ref{lem:insert1}.
It is important to note that the error guarantee for the $\textsc{Output}$ procedure
increases with every call to $\textsc{AddTerminal}$, so in general we have a bounded budget
for the number of calls to thus procedure before having to call again $\textsc{Initialize}$.

We apply Lemma~\ref{lem:insert1} to obtain
$\widetilde{\mathit{\pi}}_v^{C\cup\{v\}}(\boldsymbol{\mathit{B}}^\top \frac{\boldsymbol{\mathit{q}}_S}{\sqrt{\boldsymbol{\mathit{r}}}})$,
and update the estimate  $\widetilde{\boldsymbol{\mathit{\pi}}}_v^{C\cup\{v\}}\left(\boldsymbol{\mathit{B}}^\top \frac{\boldsymbol{\mathit{q}}_S}{\sqrt{\boldsymbol{\mathit{r}}}}\right)$.
The former can be achieved with $h = \widetilde{O}\left( \widehat{\eps}^{-4} \beta^{-6} + \widehat{\eps}^{-2} \beta^{-2} \gamma^{-2} \right)$
random walks.
Note that these random walks are already stored in $\mathcal{P}$, so accessing each of them takes time $\tO{1}$. Using the congestion reduction property of $C$, we see that the running time of the procedure, which is dominated by shortcutting the random  walks is $\tO{h\beta^{-2}}$, which gives the claimed bound.
The latter can be achieved with $h' =  \widetilde{O}\left( \widehat{\eps}^{-2} \beta^{-4} \gamma^{-2} \right)$ fresh random walks. Due to the congestion reduction
property, simulating each of these requires $\tO{\beta^{-2}}$ time.

\begin{algorithm} %
\begin{algorithmic}[1]
\caption{\textsc{DemandProjector} \textsc{DP}.\textsc{Update} and \textsc{DP}.\textsc{Output}}
\Procedure{\textsc{DP}.\textsc{Update}}{$e,\boldsymbol{\mathit{r}}',\boldsymbol{\mathit{q}}'$}
\If {$e\in S$}
	\State $\widetilde{\boldsymbol{\mathit{\pi}}}^C\left(\boldsymbol{\mathit{B}}^\top \frac{\boldsymbol{\mathit{q}}_S}{\sqrt{\boldsymbol{\mathit{r}}}}\right)
	= \widetilde{\boldsymbol{\mathit{\pi}}}^C\left(\boldsymbol{\mathit{B}}^\top \frac{\boldsymbol{\mathit{q}}_S}{\sqrt{\boldsymbol{\mathit{r}}}}\right)
	+ \left(\frac{q_e'}{\sqrt{r_e'}} - \frac{q_e}{\sqrt{r_e}}\right)\cdot\boldsymbol{\mathit{B}}^\top \mathbf{1}_e$
\EndIf
\State $q_e = q_e'$, $r_e = r_e'$
\EndProcedure
\Procedure{\textsc{DP}.\textsc{Output}}{$ $}
\State \Return $\widetilde{\boldsymbol{\mathit{\pi}}}^C\left(\boldsymbol{\mathit{B}}^\top \frac{\boldsymbol{\mathit{q}}_S}{\sqrt{\boldsymbol{\mathit{r}}}}\right)$ %
\EndProcedure
\end{algorithmic}
\end{algorithm}
\noindent{\bf \textsc{DP}.\textsc{Update}($e,\boldsymbol{\mathit{r}}',\boldsymbol{\mathit{q}}'$):}
We update the values of $r_e,q_e$. We also update the projection, by noting that since $e\in E(C)$,
\begin{align*}
\boldsymbol{\mathit{\pi}}^C\left(\boldsymbol{\mathit{B}}^\top \frac{\boldsymbol{\mathit{q}}'}{\sqrt{\boldsymbol{\mathit{r}}'}}\right)
=\boldsymbol{\mathit{\pi}}^C\left(\boldsymbol{\mathit{B}}^\top \frac{\boldsymbol{\mathit{q}}}{\sqrt{\boldsymbol{\mathit{r}}}}\right)
+ \left(\frac{q_e'}{\sqrt{r_e'}}
- \frac{q_e}{\sqrt{r_e}}\right) \boldsymbol{\mathit{B}}^\top \mathbf{1}_e\,,
\end{align*}
so we change
$\widetilde{\boldsymbol{\mathit{\pi}}}^C\left(\boldsymbol{\mathit{B}}^\top \frac{\boldsymbol{\mathit{q}}}{\sqrt{\boldsymbol{\mathit{r}}}}\right)$ by the same amount,
which takes time $O(1)$ and does not introduce any additional error in our estimate.

\noindent{\bf \textsc{DP}.\textsc{Output}():}
We output our estimate
$\widetilde{\boldsymbol{\mathit{\pi}}}^C\left(\boldsymbol{\mathit{B}}^\top \frac{\boldsymbol{\mathit{q}}_S}{\sqrt{\boldsymbol{\mathit{r}}}}\right)$.
Per Lemma~\ref{lem:insert1} we see that each of the previous $T$ calls to $\textsc{AddTerminal}$
add an error to our estimate of at most $\widehat{\eps}$ in the sense that if $\boldsymbol{\mathit{\Delta}}^t$ were the true change in the demand projection at the $t^{th}$ insertion, and $\boldsymbol{\mathit{\widetilde{\Delta}}}^t$ were the update made to our estimate, then
\[
\left| \left\langle
\boldsymbol{\mathit{\widetilde{\Delta}}}^t - \boldsymbol{\mathit{\Delta}}^t, \boldsymbol{\mathit{\phi}}
\right\rangle \right| \leq\widehat{\eps}\,,
\]
w.h.p. for any fixed $\boldsymbol{\mathit{\phi}}$ such that $E_{\boldsymbol{\mathit{r}}^t}(\boldsymbol{\mathit{\phi}}) \leq 1$, where $\boldsymbol{\mathit{r}}^t$ represents the resistances when $t^{th}$ call to $\textsc{AddTerminal}$ is made. Equivalently, for any nonzero $\boldsymbol{\mathit{\phi}}$,
\[
\frac{1}{\sqrt{E_{\boldsymbol{\mathit{r}}^t}(\boldsymbol{\mathit{\phi}})}} \left| \left\langle
\boldsymbol{\mathit{\widetilde{\Delta}}}^t - \boldsymbol{\mathit{\Delta}}^t, \boldsymbol{\mathit{\phi}}
\right\rangle \right| \leq\widehat{\eps}\,,
\]

By the invariant satisfied by the resistances passed as parameters to the $\textsc{AddTerminal}$ routine, we have that
$\boldsymbol{\mathit{r}}^t \leq \alpha \cdot \boldsymbol{\mathit{r}}^T$ for all $t$. Therefore $1/E_{\boldsymbol{\mathit{r}}^T}(\boldsymbol{\mathit{\phi}}) \leq \alpha/E_{\boldsymbol{\mathit{r}}^t}(\boldsymbol{\mathit{\phi}})$.
So we have that
\[
\frac{1}{\sqrt{E_{\boldsymbol{\mathit{r}}^T}(\boldsymbol{\mathit{\phi}})}}\left| \left\langle
\boldsymbol{\mathit{\widetilde{\Delta}}}^t - \boldsymbol{\mathit{\Delta}}^t, \boldsymbol{\mathit{\phi}}
\right\rangle \right| \leq\widehat{\eps} \cdot \sqrt{\alpha} \,.
\]
Summing up over $T$ insertions, we obtain the desired error bound.
Furthermore, note that returning the estimate takes time proportional to $\vert C \vert$, which is $\tO{\beta m + T}$.

\end{proof}

\section{An Efficient $(\alpha,\beta,\varepsilon)$-\textsc{Locator}}
\label{sec:locator}

In this section we will show how to implement an
$(\alpha,\beta,\varepsilon)$-\textsc{Locator}, as defined in Definition~\ref{def:locator}.
In order to maintain the approximate electrical flow $\boldsymbol{\mathit{\widetilde{f}}}$
required by Lemma~\ref{lem:locator}
we will keep a vertex sparsifier in the form of a sparsified Schur complement onto
some vertex set $C$. As in~\cite{gao2021fully}, we choose $C$ to be a \emph{congestion reduction subset}.
\begin{definition}[Congestion reduction subset~\cite{gao2021fully}]\label{def:cong_red}
Given a graph $G(V,E)$ with resistances $\boldsymbol{\mathit{r}}$ and any parameter $\beta\in(0,1)$,
a vertex subset $C\subseteq V$ is called a
\emph{$\beta$-congestion reduction subset} (or just \emph{congestion reduction subset}) if:
\begin{itemize}
\item{$|C| \leq O(\beta m)$}
\item{For any $u\in V$, a random walk starting from $u$ that visits $\tOm{\beta^{-1} \log n}$ distinct vertices
hits $C$ with high probability}
\item{
If we generate $\mathrm{deg}(u)$ random walks from each $u\in V\backslash C$, the expected number of
these that hit some fixed $v\in V\backslash C$ before $C$ is $\tO{1/\beta^2}$. Concretely:
\begin{align}
\sum\limits_{u\in V} \mathrm{deg}(u) \cdot p_v^{C\cup\{v\}}(u) \leq \tO{1/\beta^2}\,.
\label{eq:cong_red}
\end{align}
}
\end{itemize}
\end{definition}
The following lemma shows that such a vertex subset can be constructed efficiently:
\begin{lemma}[Construction of congestion reduction subset~\cite{gao2021fully}]
Given a graph $G(V,E)$ with resistances $\boldsymbol{\mathit{r}}$ and a parameter $\beta\in(0,1)$,
there is an algorithm that generates a $\beta$-congestion reduction subset
in time $\tO{m/\beta^2}$.
\label{lem:cong_red}
\end{lemma}

Intuitively, (\ref{eq:cong_red}) says that ``not too many'' random walks go through a given
vertex before reaching $C$.
This property is crucial for
ensuring that when inserting a new vertex into $C$, the data structure
will not have to change too much.
As we will see in Section~\ref{sec:Fsystem}, this property plays an even more central role
when general demands are introduced, as
it allows us to show that the demands outside $C$
can be pushed to $C$.
Additionally, in Section~\ref{sec:important} we will use it to show that
edges that are too far from $C$ in effective resistance metric are not \emph{important},
in the sense that neither can they get congested, nor can their demand congest anything else.

\input{Fsystem}

\input{important_edges}

\subsection{Proving Lemma~\ref{lem:locator}}
\label{sec:proof_lem_locator}

Before moving to the description of how $\textsc{Locator}$
works and its proof, we will provide a lemma which
bounds how fast a demand projection changes.

We will use the following observation, which states that if our
congestion reduction subset $C$ contains an $\beta m$-sized
uniformly random edge subset, then with high probability, effective resistance
neighborhoods that are disjoint from $C$ only have $\tO{\beta^{-1}}$ edges.
Note that this is will be true throughout the algorithm as long as the resistances
do not depend on the randomness of $C$. This is true, as resistance updates
are only ever given as inputs to $\textsc{Locator}$.

\begin{lemma}[Few edges in a small neighborhood]
\label{lem:small-neighborhood2}
Let $\beta\in(0,1)$ be a parameter and $C$ be a vertex set which contains a subset of $\beta m$ edges sampled at random.
Then with high probability, for any $v \in V\backslash C$ we have that
$\vert N_E(v, R_{eff}(C,v) / 2) \vert \leq 10\beta^{-1} \ln m$,
where
\[ N_E(v,R) := \{e\in E\ |\ R_{eff}(e,v) \leq R\} \,. \]
\end{lemma}
\begin{proof}
Suppose that for some vertex $v\in V\backslash C$, $\vert N_E(u,R_{eff}(C,v) / 2) \vert \geq 10 \beta^{-1} \ln m$.
Since by construction $C$ contains a random edge subset of size $\beta m$, with high probability
$N_E(u,R_{eff}(C,u)/2)  \cap C \neq \emptyset$, so there exists $u\in C$ such that $R_{eff}(u,v) \leq R_{eff}(C,v) / 2$.
This is a contradiction since $u\in C$ implies $R_{eff}(C,v) \leq R_{eff}(u,v)$.
Union bounding over all $v$ yields the claim.
\end{proof}

Using this fact, we can now show that
the change of the demand projection (measured in energy) is quite mild.
The proof of the following
lemma can be found in Appendix~\ref{proof_lem_projection_change_energy}.
\begin{lemma}[Projection change]
Consider a graph $G(V,E)$ with resistances $\boldsymbol{\mathit{r}}$, $\boldsymbol{\mathit{q}}\in[-1,1]^m$,
and a $\beta$-congestion reduction subset $C$.
Then, with high probability,
\[ \sqrt{\mathcal{E}_{\boldsymbol{\mathit{r}}}\left(
\boldsymbol{\mathit{\pi}}^{C\cup\{v\}}\left(\boldsymbol{\mathit{B}}^\top \frac{\boldsymbol{\mathit{q}}}{\sqrt{\boldsymbol{\mathit{r}}}}\right)
-  \boldsymbol{\mathit{\pi}}^{C}\left(\boldsymbol{\mathit{B}}^\top \frac{\boldsymbol{\mathit{q}}}{\sqrt{\boldsymbol{\mathit{r}}}}\right)\right)}
\leq \tO{\beta^{-2}} \,.
\]
\label{lem:projection_change_energy}
\end{lemma}

The above lemma can be applied over multiple vertex
insertions and resistance changes, to bound
the overall energy change. This is shown in the following lemma, which is proved in
Appendix~\ref{sec:proof_old_projection_approximate}:

\begin{lemma}
Consider a graph $G(V,E)$ with resistances $\boldsymbol{\mathit{r}}^0$, $\boldsymbol{\mathit{q}}^0\in[-1,1]^m$, a $\beta$-congestion
reduction subset $C^0$, %
and a fixed sequence of updates,
where the $i$-th update $i\in\{0,\dots,T-1\}$ is of the following form:
\begin{itemize}
    \item {\textsc{AddTerminal}($v^i$): Set $C^{i+1} = C^{i} \cup \{v^i\}$ for some $v^i\in V\backslash C^i$, $q_e^{i+1} = q_e^{i}, r_e^{i+1} = r_e^{i}$}
    \item {\textsc{Update}($e^i,\boldsymbol{\mathit{q}},\boldsymbol{\mathit{r}}$) Set $C^{i+1} = C^{i}$, $q_e^{i+1} = q_e$ $r_e^{i+1} = r_e$, where $e^i\in E(C^{i})$}
\end{itemize}
Then, with high probability,
\[
\sqrt{\mathcal{E}_{\boldsymbol{\mathit{r}}^T} \left(\boldsymbol{\mathit{\pi}}^{C^0,\boldsymbol{\mathit{r}}^0}\left(\boldsymbol{\mathit{B}}^\top \frac{\boldsymbol{\mathit{q}}_S^0}{\sqrt{\boldsymbol{\mathit{r}}^0}}\right) - \boldsymbol{\mathit{\pi}}^{C^T,\boldsymbol{\mathit{r}}^T}\left(\boldsymbol{\mathit{B}}^\top \frac{\boldsymbol{\mathit{q}}_S^T}{\sqrt{\boldsymbol{\mathit{r}}^T}}\right)\right)}
\leq \tO{\max_{i\in\{0,\dots,T-1\}} \left\|\frac{\boldsymbol{\mathit{r}}^T}{\boldsymbol{\mathit{r}}^i}\right\|_\infty^{1/2} \beta^{-2}} \cdot T\,.
\]

\label{lem:old_projection_approximate}
\end{lemma}

We are now ready to describe the $\textsc{Locator}$ data structure.
We will give an outline here, and defer the full proof
to Appendix~\ref{sec:full_proof_lem_locator}.
The goal of an $(\alpha,\beta,\varepsilon)$-\textsc{Locator} is, given some flow $\boldsymbol{\mathit{f}}$ with
slacks $\ss$ and resistances $\boldsymbol{\mathit{r}}$, to compute all $e\in E$ such that
$\sqrt{r_e} \left|\widetilde{f}_e^*\right| \geq \varepsilon$, where
\[ \boldsymbol{\mathit{\widetilde{f}}}^* = \delta g(\ss) - \delta \boldsymbol{\mathit{R}}^{-1} \boldsymbol{\mathit{B}} \boldsymbol{\mathit{L}}^+ \boldsymbol{\mathit{B}}^\top g(\ss)\]
($\boldsymbol{\mathit{L}} = \boldsymbol{\mathit{B}}^\top \boldsymbol{\mathit{R}}^{-1} \boldsymbol{\mathit{B}}$),
where $\delta = 1/\sqrt{m}$.

If we set
$\rho_e^* = \sqrt{r_e} \widetilde{f}_e^*$, we can equivalently write
\[ \boldsymbol{\mathit{\rho}}^* = \delta \sqrt{\boldsymbol{\mathit{r}}} g(\ss) - \delta \boldsymbol{\mathit{R}}^{-1/2} \boldsymbol{\mathit{B}} \boldsymbol{\mathit{L}}^+ \boldsymbol{\mathit{B}}^\top g(\ss)\,,\]
and require to find all the entries of $\boldsymbol{\mathit{\rho}}^*$ with magnitude at least $\varepsilon$.
As $\delta\left\|\sqrt{\boldsymbol{\mathit{r}}} g(\ss)\right\|_\infty \leq \delta \leq \varepsilon / 100$,
we can concentrate on the second
term, and denote
\[ \boldsymbol{\mathit{\rho}}'^* = \delta \boldsymbol{\mathit{R}}^{-1/2} \boldsymbol{\mathit{B}} \boldsymbol{\mathit{L}}^+ \boldsymbol{\mathit{B}}^\top g(\ss)\]
for convenience.

First, we use Lemma~\ref{lem:non-projected-demand-contrib}
to show that
\[ \delta \left\|\boldsymbol{\mathit{R}}^{-1/2} \boldsymbol{\mathit{B}} \boldsymbol{\mathit{L}}^+
\left(g(\ss) - \boldsymbol{\mathit{\pi}}^{C}(g(\ss))\right)\right\|_\infty
\leq \delta \cdot \tO{\beta^{-2}} \leq \varepsilon / 100 \,. \]
Now, let's set $\boldsymbol{\mathit{\pi}}_{old} = \boldsymbol{\mathit{\pi}}^{C^0}\left(g(\ss^0)\right)$, where
$C^0$ was the vertex set of the sparsifier and $\ss^0$ the slacks after the last
call to $\textsc{BatchUpdate}$. As we will be calling $\textsc{BatchUpdate}$ at least
every $T$ calls to
$\textsc{Update}$ for some $T\geq 1$, Lemma~\ref{lem:old_projection_approximate} implies that
\[ \delta \left\|\boldsymbol{\mathit{R}}^{-1/2} \boldsymbol{\mathit{B}} \boldsymbol{\mathit{L}}^+
\left(\boldsymbol{\mathit{\pi}}^{C}(g(\ss)) - \boldsymbol{\mathit{\pi}}_{old}\right)\right\|_\infty
\leq \delta \cdot \tO{\alpha \beta^{-2}} T \leq \varepsilon / 100 \,, \]
as long as $T \leq \varepsilon \sqrt{m} / \tO{\alpha \beta^{-2}}$.

Importantly, we will never be \emph{removing} vertices from $C$, so $C^0\subseteq C$.
This implies that it suffices to find the large entries of
\[ \delta \boldsymbol{\mathit{R}}^{-1/2} \boldsymbol{\mathit{B}} \boldsymbol{\mathit{L}}^+ \boldsymbol{\mathit{\pi}}_{old}\,. \]

Now, note that for any edge $e$ that was
\emph{not} $\varepsilon / (100\alpha)$-important for $C^0$ and corresponding resistances $\boldsymbol{\mathit{r}}^0$,
we have
\begin{align*}
& \delta \left|\boldsymbol{\mathit{R}}^{-1/2} \boldsymbol{\mathit{B}} \boldsymbol{\mathit{L}}^+ \boldsymbol{\mathit{\pi}}_{old}\right|_e\\
& \leq \delta \sqrt{\mathcal{E}_{\boldsymbol{\mathit{r}}}(\boldsymbol{\mathit{\pi}}^{C^0}(\boldsymbol{\mathit{B}}^\top \frac{\mathbf{1}_e}{\sqrt{\boldsymbol{\mathit{r}}}}))}\sqrt{\mathcal{E}_{\boldsymbol{\mathit{r}}}(\boldsymbol{\mathit{\pi}}_{old})}\\
& \leq \delta \cdot \sqrt{\alpha} \frac{\varepsilon}{100\alpha} \cdot \sqrt{2\alpha m}\\
& = \varepsilon / 50\,,
\end{align*}
where we used Lemma~\ref{st_projection1_energy} and the fact that
$\mathcal{E}_{\boldsymbol{\mathit{r}}}(\boldsymbol{\mathit{\pi}}^{C^0}(g(\ss^0))) \leq 2 \mathcal{E}_{\boldsymbol{\mathit{r}}}(g(\ss^0)) \leq 2 \alpha m$.
Therefore it suffices to approximate
\[ \delta \boldsymbol{\mathit{I}}_S \boldsymbol{\mathit{R}}^{-1/2} \boldsymbol{\mathit{B}} \boldsymbol{\mathit{L}}^+ \boldsymbol{\mathit{\pi}}_{old} \,,\]
where $S$ was the set of $\frac{\varepsilon}{100\alpha}$-important edges last computed during the
last call to $\textsc{BatchUpdate}$.

Now, we will use the sketching lemma from (Lemma 5.1, \cite{gao2021fully} v2),
which shows that in order to find all $\Omega(\varepsilon)$ large
entries of this vector, it suffices to compute the inner
products
\begin{align*}
& \delta \left\langle \boldsymbol{\mathit{\pi}}^C\left(\boldsymbol{\mathit{B}}^\top \frac{\boldsymbol{\mathit{q}}_S^i}{\sqrt{\boldsymbol{\mathit{r}}}}\right),
SC^+ \boldsymbol{\mathit{\pi}}_{old} \right\rangle
\end{align*}
for $i\in[\tO{\varepsilon^{-2}}]$ up to $O(\varepsilon)$ accuracy.
Here $SC$ is the Schur complement onto $C$.

Based on this, there are two types of quantities that we will maintain:
\begin{itemize}
\item $\tO{1/\varepsilon^2}$ approximate demand projections
$\widetilde{\boldsymbol{\mathit{\pi}}}^C\left(\boldsymbol{\mathit{B}}^\top \frac{\boldsymbol{\mathit{q}}_S^i}{\sqrt{\boldsymbol{\mathit{r}}}}\right)$, and
\item an approximate Schur complement $\widetilde{SC}$ of $G$ onto $C$.
\end{itemize}
For the latter, we will directly use the dynamic Schur complement data structure
$\textsc{DynamicSC}$ that was also used
by~\cite{gao2021fully} and is based on~\cite{durfee2019fully}. For completeness, we present this data structure in Appendix~\ref{sec:maintain_schur}.

For the former, we will need $\tO{1/\varepsilon^2}$ data structures for maintaining demand projections onto $C$, under vertex insertions to $C$.
The guarantees of each such a data structure,
that we call an $(\alpha,\beta,\varepsilon)$-\textsc{DemandProjector}, are as follows.
\begin{definition}[$(\alpha,\beta,\varepsilon)$-\textsc{DemandProjector}]
Let $\widehat{\eps}\in(0,\varepsilon)$ be a tradeoff parameter.
Given a graph $G(V,E)$, resistances $\boldsymbol{\mathit{r}}$, and a vector $\boldsymbol{\mathit{q}}\in[-1,1]^m$,
an $(\alpha,\beta,\varepsilon)$-\textsc{DemandProjector} is a data structure that maintains a vertex subset $C\subseteq V$ and an approximation
to the demand projection $\boldsymbol{\mathit{\pi}}^C\left(\boldsymbol{\mathit{B}}^\top \frac{\boldsymbol{\mathit{q}}}{\sqrt{\boldsymbol{\mathit{r}}}}\right)$, with high probability under
oblivious adversaries. The following operations are supported:
\begin{itemize}
\item{$\textsc{Initialize}(C,\boldsymbol{\mathit{r}},\boldsymbol{\mathit{q}},S,\mathcal{P})$: Initialize
the data structure in order to maintain
an approximation of $\boldsymbol{\mathit{\pi}}^C\left(\boldsymbol{\mathit{B}}^\top \frac{\boldsymbol{\mathit{q}}_S}{\sqrt{\boldsymbol{\mathit{r}}}}\right)$,
where $C\subseteq V$ is a $\beta$-congestion reduction subset,
$\boldsymbol{\mathit{r}}$ are resistances,
$\boldsymbol{\mathit{q}}\in[-1,1]^m$, and
$S\subseteq E$ is a subset of
$\gamma$-important edges.
$\mathcal{P} = \{\mathcal{P}^{u,e,i}
\ |\ u\in V, e\in E, u\in e, i\in[h]\}$
for some $h\in\mathbb{Z}_{\geq 1}$,
is a set of independent random walks from $u$ to $C$ for any $u$.
}
\item{$\textsc{AddTerminal}(v,{\widetilde{R}}_{eff}(C,v))$: Insert $v$ into $C$.
Also, ${\widetilde{R}}_{eff}(C,v)$ is an estimate of $R_{eff}(C,v)$
such that ${\widetilde{R}}_{eff}(C,v)\approx_2 R_{eff}(C,v)$.
Returns an estimate
\[
\widetilde{\mathit{\pi}}_v^{C\cup\{v\}}\left(\boldsymbol{\mathit{B}}^\top \frac{\boldsymbol{\mathit{q}}}{\sqrt{\boldsymbol{\mathit{r}}}}\right)
\] for the demand projection of $\boldsymbol{\mathit{q}}$ onto $C\cup \{v\}$ at coordinate $v$
such that
\[
\left| \widetilde{\mathit{\pi}}_v^{C\cup\{v\}}\left(\boldsymbol{\mathit{B}}^\top \frac{\boldsymbol{\mathit{q}}}{\sqrt{\boldsymbol{\mathit{r}}}}\right) - \pi_v^{C\cup\{v\}}\left(\boldsymbol{\mathit{B}}^\top \frac{\boldsymbol{\mathit{q}}}{\sqrt{\boldsymbol{\mathit{r}}}}\right) \right| \leq \frac{\widehat{\eps}}{\sqrt{R_{eff}(v,C)}}\,.
\]
}
\item{$\textsc{Update}(e,\boldsymbol{\mathit{r}}',\boldsymbol{\mathit{q}}')$: Set $r_e = r_e'$ and $q_e = q_e'$,
where $e\in E(C)$,
and $q_e'\in[-1,1]$. Furthermore, $r_e'$ satisfies the inequality $r_e^{\max} / \alpha \leq r_e' \leq \alpha \cdot r_e^{\min}$, where $r_e^{\min}$ and $r_e^{\max}$ represent the minimum, respectively the maximum values that the resistance of $e$ has had since the last call to $\textsc{Initialize}$.
}
\item{$\textsc{Output}()$: Output
$\widetilde{\boldsymbol{\mathit{\pi}}}^C\left(\boldsymbol{\mathit{B}}^\top \frac{\boldsymbol{\mathit{q}}_S}{\sqrt{\boldsymbol{\mathit{r}}}}\right)$ such that
such that after $T \leq n^{O(1)}$ calls to  $\textsc{AddTerminal}$,
 for any fixed vector $\boldsymbol{\mathit{\phi}}$, $E_{\boldsymbol{\mathit{r}}}(\boldsymbol{\mathit{\phi}}) \leq 1$, with high probability
\[
\left| \left\langle \widetilde{\boldsymbol{\mathit{\pi}}}^C\left(\boldsymbol{\mathit{B}}^\top \frac{\boldsymbol{\mathit{q}}_S}{\sqrt{\boldsymbol{\mathit{r}}}}\right) - \boldsymbol{\mathit{\pi}}^C\left(\boldsymbol{\mathit{B}}^\top \frac{\boldsymbol{\mathit{q}}_S}{\sqrt{\boldsymbol{\mathit{r}}}}\right), \boldsymbol{\mathit{\phi}}\right \rangle   \right| \leq \widehat{\eps} \cdot \sqrt{\alpha} \cdot T \,.
\]
}
\end{itemize}
\label{def:demand_projector}
\end{definition}
We will implement such a data structure in Section~\ref{sec:demand_projection}, where
we will prove the following lemma:
\begin{lemma}[Demand projection data structure]
For any graph $G(V,E)$ and parameters $\widehat{\eps}\in(0,\varepsilon)$, $\beta\in(0,1)$,
there exists an $(\alpha,\beta,\varepsilon)$-\textsc{DemandProjector} for $G$
which, given access to   $h=\widetilde{\Theta}(\widehat{\eps}^{-4}\beta^{-6}+\widehat{\eps}^{-2}\beta^{-2}\gamma^{-2})$ precomputed independent  random walks from $u$ to $C$ for each $e \in E$, $u \in e$,
has the following
runtimes per operation:
\begin{itemize}
\item{\textsc{Initialize}:
$\tO{m}$.
}
\item{\textsc{AddTerminal}:
$\tO{\widehat{\eps}^{-4}\beta^{-8}+\widehat{\eps}^{-2} \beta^{-6} \gamma^{-2}}$.
}
\item{\textsc{Update}:
$O(1)$.}
\item{\textsc{Output}:
$O(\beta m + T)$, where $T$ is the number of calls made to $\textsc{AddTerminal}$ after the last call to $\textsc{Initialize}$.}
\end{itemize}
\label{lem:ds}
\end{lemma}

Now we describe the way we will use the $\textsc{DemandProjector}$s
and $\textsc{DynamicSC}$ to get an $(\alpha,\beta,\varepsilon)$-\textsc{Locator} $\mathcal{L}$.
\begin{algorithm} %
\begin{algorithmic}[1]
\caption{\textsc{Locator} $\mathcal{L}$.\textsc{Initialize}}
\Procedure{$\mathcal{L}$.\textsc{Initialize}}{$\boldsymbol{\mathit{f}}$}
\State $\ss^+ = \boldsymbol{\mathit{u}} - \boldsymbol{\mathit{f}}$, $\ss^- = \boldsymbol{\mathit{f}}$,
$\boldsymbol{\mathit{r}} = \frac{1}{(\ss^+)^2} + \frac{1}{(\ss^-)^2}$
\State $\boldsymbol{\mathit{Q}} =$ Sketching matrix produced by (Lemma 5.1, \cite{gao2021fully} v2)
\State $\textsc{DynamicSC} = \textsc{DynamicSC}.\textsc{Initialize}(\boldsymbol{\mathit{G}},\emptyset,\boldsymbol{\mathit{r}},\varepsilon,\beta)$
\State $C = \textsc{DynamicSC}.C$ \Comment{$\beta$-congestion reduction subset}
\State Estimate ${\widetilde{R}}_{eff}(C,e) \approx_{4} R_{eff}(C,e)$ using Lemma~\ref{lem:approx_effective_res}
\State $S = \left\{e\in E\ |\ {\widetilde{R}}_{eff}(C,e) \leq r_e \cdot \left(\frac{100\alpha}{\varepsilon}\right)^2\right\}$
\State $h = \widetilde{\Theta}\left( \widehat{\eps}^{-4} \beta^{-6} +  \widehat{\eps}^{-2} \varepsilon^{-2}\alpha^2 \beta^{-2}  \right)$
\State Sample walks $\mathcal{P}^{u,e,i}$ from $u$ to $C$ for $e \in E\setminus E(C)$, $u \in e$, $i \in [h]$ (Lemma 5.15, \cite{gao2021fully} v2)
\State $\textsc{DP}^i = \textsc{DemandProjector}.\textsc{Initialize}(C,\boldsymbol{\mathit{r}},\boldsymbol{\mathit{q}}^i,S,\mathcal{P})$ for all rows $\boldsymbol{\mathit{q}}^i$ of $\boldsymbol{\mathit{Q}}$
\State $\mathcal{L}.\textsc{BatchUpdate}(\emptyset)$
\EndProcedure
\end{algorithmic}
\end{algorithm}

{\bf $\mathcal{L}$.\textsc{Initialize}}: Every time
$\mathcal{L}.\textsc{Initialize}$ is called, we first generate a $\beta$-congestion reduction
subset $C$ based on Lemma~\ref{lem:cong_red} (takes time
$\tO{m/\beta^2}$),
then a sketching matrix $\boldsymbol{\mathit{Q}}$ and its rows $\boldsymbol{\mathit{q}}^i$ for $i\in\left[\tO{1/\varepsilon^2}\right]$
as in~(Lemma 5.1, \cite{gao2021fully} v2)
(takes time $\tO{m/\varepsilon^2}$),
and finally random walks $\mathcal{P}^{u,e,i}$
from $u$ to $C$ for each $u\in V$,
$e\in E\backslash E(C)$ with $u\in e$, and $i\in [h]$, where
$h = \tO{ \widehat{\eps}^{-4} \beta^{-6} +  \widehat{\eps}^{-2} \varepsilon^{-2}\alpha^2 \beta^{-2}  }$
as in (Lemma 5.15, \cite{gao2021fully} v2)
(takes time $\tO{h/\beta^2}$ for each $(u,e)$).

We also compute ${\widetilde{R}}_{eff}(C,u) \approx_{2} R_{eff}(C,u)$ for all $u\in V$ as described
in Lemma~\ref{lem:approx_effective_res}
so that we can let
$S$ be a subset of $\varepsilon/(100\alpha)$-important edges that
contains all $\varepsilon/(200\alpha)$-important edges.
This takes time $\tO{m}$.
Then, we
call \textsc{DynamicSC}.\textsc{Initialize}$(G,C,\boldsymbol{\mathit{r}}, O(\varepsilon),\beta)$
(from Appendix~\ref{sec:maintain_schur})
to initialize the dynamic Schur complement onto $C$,
with error tolerance $O(\varepsilon)$,
which takes time $\tO{m \cdot \frac{1}{\varepsilon^4\beta^4}}$,
as well as $\textsc{DemandProjector}.\textsc{Initialize}(C,\boldsymbol{\mathit{r}},\boldsymbol{\mathit{q}},S,\mathcal{P})$
for the $\tO{1/\varepsilon^2}$
$\textsc{DemandProjector}$s, i.e. one for each $\boldsymbol{\mathit{q}} \in \{\boldsymbol{\mathit{q}}^i\ |\ i\in[\tO{1/\varepsilon^2}]\}$.
Also, we compute
\[ \boldsymbol{\mathit{\pi}}^{old} = \boldsymbol{\mathit{\pi}}^C\left(\boldsymbol{\mathit{B}}^\top g(\ss)\right)\,, \]
which takes $\tO{m}$ as in $\textsc{DemandProjector}.\textsc{Initialize}$.
All of this takes
$\tO{m\cdot \left(\frac{1}{\widehat{\eps}^4\beta^8} + \frac{\alpha^2}{\widehat{\eps}^2 \varepsilon^2 \beta^4}\right)}$.

\begin{algorithm} %
\begin{algorithmic}[1]
\caption{\textsc{Locator} $\mathcal{L}$.\textsc{Update} and $\mathcal{L}$.\textsc{BatchUpdate}}
\Procedure{\textsc{Update}}{$e = (u,w),\boldsymbol{\mathit{f}}$}
\State $s_e^+ = u_e - f_e$, $s_e^- = f_e$, $r_e = \frac{1}{(s_e^+)^2} + \frac{1}{(s_e^-)^2}$
\State ${\widetilde{R}}_{eff}(C,u) = \textsc{DynamicSC}.\textsc{AddTerminal}(u)$
\State ${\widetilde{R}}_{eff}(C\cup\{u\},w) = \textsc{DynamicSC}.\textsc{AddTerminal}(w)$
\State $C = C\cup\{u,w\}$

\For {$i=1,\dots,\tO{1/\varepsilon^2}$}
		\State
		$\textsc{DP}^i.\textsc{AddTerminal}(u, {\widetilde{R}}_{eff}(C,u))$
    	\State
		$\textsc{DP}^i.\textsc{AddTerminal}(w, {\widetilde{R}}_{eff}(C\cup\{u\},w))$
\EndFor
\State $\textsc{DynamicSC}.\textsc{Update}(e,r_e)$
\For {$i=1\dots \tO{1/\varepsilon^2}$}
	\State $\textsc{DP}^i.\textsc{Update}(e,\boldsymbol{\mathit{r}},\boldsymbol{\mathit{q}}^i)$
\EndFor
\EndProcedure
\Procedure{\textsc{BatchUpdate}}{$Z,\boldsymbol{\mathit{f}}$}
\State $\ss^+ = \boldsymbol{\mathit{u}} - \boldsymbol{\mathit{f}}$, $\ss^- = \boldsymbol{\mathit{f}}$, $\boldsymbol{\mathit{r}} = \frac{1}{(\ss^+)^2} + \frac{1}{(\ss^-)^2}$
\State Estimate ${\widetilde{R}}_{eff}(C,e) \approx_{4} R_{eff}(C,e)$ using Lemma~\ref{lem:approx_effective_res}
\State $S = \left\{e\in E\ |\ {\widetilde{R}}_{eff}(C,e) \leq r_e \cdot  \left(\frac{100\alpha}{\varepsilon}\right)^2\right\}$
\Comment{$\frac{\varepsilon}{100\alpha}$-important edges}
\For {$e=(u,w)\in Z$}
	\State $\textsc{DynamicSC}.\textsc{AddTerminal}(u)$
	\State $\textsc{DynamicSC}.\textsc{AddTerminal}(w)$
	\State $C = C\cup\{u,w\}$
	\State $\textsc{DynamicSC}.\textsc{Update}(e,r_e)$
\EndFor
\For {$i=\left[\tO{1/\epsilon^2}\right]$}
	\State $\textsc{DP}^i.\textsc{Initialize}(C,\boldsymbol{\mathit{r}}, \boldsymbol{\mathit{q}}^i, S, \mathcal{P})$
\EndFor
\State $\boldsymbol{\mathit{\pi}}_{old} = \frac{1}{\sqrt{m}} \cdot \boldsymbol{\mathit{\pi}}^C\left(\boldsymbol{\mathit{B}}^\top \frac{\frac{1}{\ss^+} - \frac{1}{\ss^-}}{\boldsymbol{\mathit{r}}}\right)$ \Comment{Compute exactly using Laplacian solve}
\EndProcedure
\end{algorithmic}
\end{algorithm}
{\bf $\mathcal{L}$.\textsc{Update}}: Now, whenever $\mathcal{L}.\textsc{Update}$ is called on an edge $e$, either $e\in E(C)$ or $e\notin E(C)$.
In the first case we simply call $\textsc{Update}$ on
$\textsc{DynamicSC}$ and all \textsc{DemandProjector}s.

In the second case, we first call $\textsc{DynamicSC}.\textsc{AddTerminal}$
on one endpoint $v$ of $e$. After doing this we can also get an
estimate ${\widetilde{R}}_{eff}(C,v)\approx_{2} R_{eff}(C,v)$
by looking at the edges between $C$ and $v$ in the sparsified
Schur complement. By the guarantees of the
expander decomposition used inside $\textsc{DynamicSC}$~\cite{gao2021fully}, the
number of expanders containing $v$,
amortized over all calls to $\textsc{DynamicSC}.\textsc{AddTerminal}$,
is $O(\mathrm{poly}\log(n))$. As
the sparsified Schur complement contains
$\tO{1/\varepsilon^2}$ neighbors of $v$ from each expander, the amortized number of neighbors of $v$
in the sparsified Schur complement is $\tO{1/\varepsilon^2}$, and the amortized
runtime to generate them (by random sampling) is $\tO{1/\varepsilon^2}$.

Given the resistances $r_1,\dots,r_l$ of these edges,
setting ${\widetilde{R}}_{eff}(C,v) = \left(\sum\limits_{i=1}^l r_i^{-1}\right)^{-1}$ we guarantee
that ${\widetilde{R}}_{eff}(C,v) \approx_{1+O(\varepsilon)} R_{eff}(C,v)$,
by the fact that $\textsc{DynamicSC}$ maintains an $(1+O(\varepsilon))$-approximate sparsifier
of the Schur complement.
Then, we call $\textsc{AddTerminal}(v,{\widetilde{R}}_{eff}(C,v))$ on all
\textsc{DemandProjector}s.

After repeating the same process for the other endpoint of $e$,
we finally call $\textsc{Update}$ on
$\textsc{DynamicSC}$ and all \textsc{DemandProjector}s.
This takes time $\tO{\frac{1}{\varepsilon^2 \beta^2}}$ because of the Schur complement and amortized
$\tO{m\cdot \frac{\widehat{\eps} \alpha^{1/2}}{\varepsilon} + \frac{1}{\widehat{\eps}^4\beta^{8}} + \frac{\alpha^2}{\widehat{\eps}^2\varepsilon^2\beta^{-6}}}$ for each of the
demand projectors, so  the total amortized runtime is
$\tO{m\cdot \frac{\widehat{\eps} \alpha^{1/2}}{\varepsilon^3} + \frac{1}{\widehat{\eps}^4\varepsilon^2\beta^{8}} + \frac{\alpha^2}{\widehat{\eps}^2\varepsilon^4\beta^6}}$.

{\bf $\mathcal{L}$.\textsc{BatchUpdate}}: When $\mathcal{L}.\textsc{BatchUpdate}$ is called on a set of edges $Z$,
we add them one by one in the $\textsc{DynamicSC}$ data structure following
the same process as in $\mathcal{L}.\textsc{Update}$. For the demand projectors,
we first manually insert the endpoints of these edges
into $C$ and then re-initialize all \textsc{DemandProjector}s,
by calling $\textsc{Initialize}$ with a new subset
 $S$
of $\frac{\varepsilon}{200\alpha}$-important edges that
contains all $\frac{\varepsilon}{100\alpha}$-important edges.
Such a set can be computed by estimating $R_{eff}(C,u)$ for all $u\in V\backslash C$
up to a constant factor
and, by Lemma~\ref{lem:approx_effective_res}, takes time $\tO{m}$.
Also, we compute
\[ \boldsymbol{\mathit{\pi}}^{old} = \boldsymbol{\mathit{\pi}}^C\left(\boldsymbol{\mathit{B}}^\top g(\ss)\right)\,, \]
which takes $\tO{m}$ as in $\textsc{DemandProjector}.\textsc{Initialize}$.
The total runtime of this is $\tO{ m / \varepsilon^2 + |Z| / (\beta^2\varepsilon^2) }$.

\begin{algorithm} %
\begin{algorithmic}[1]
\caption{\textsc{Locator} $\mathcal{L}$.\textsc{Solve}}
\Procedure{\textsc{Solve}}{$ $}
\State $\widetilde{SC} = \textsc{DynamicSC}.\widetilde{SC}()$
\State $\boldsymbol{\mathit{\phi}}_{old} = \widetilde{SC}^+ \boldsymbol{\mathit{\pi}}_{old}$ %
\State $\boldsymbol{\mathit{v}} = \mathbf{0}$
\For {$i=1,\dots,\tO{1/\varepsilon^2}$}
    \State %
$\widetilde{\boldsymbol{\mathit{\pi}}}^i
= \textsc{DP}^i.\textsc{Output}()$
\State $v_i = \langle \widetilde{\boldsymbol{\mathit{\pi}}}^i , \boldsymbol{\mathit{\phi}}_{old} \rangle$
\EndFor
\State $Z = \textsc{Recover}(\boldsymbol{\mathit{v}}, \varepsilon/100)$ \Comment{Recovers all $\varepsilon/2$-congested edges
(Lemma 5.1, \cite{gao2021fully} v2)}
\State \Return $Z$

\EndProcedure
\end{algorithmic}
\end{algorithm}

{\bf $\mathcal{L}$.\textsc{Solve}}: When $\mathcal{L}.\textsc{Solve}$ is called, we set $\widetilde{SC} = \textsc{DynamicSC}.SC()$,
call $\textsc{Output}$ on all \textsc{DemandProjector}s
to obtain vectors $\widetilde{\boldsymbol{\mathit{\pi}}}^i$ which are estimators for $\boldsymbol{\mathit{\pi}}^C(\boldsymbol{\mathit{B}}^\top \frac{\boldsymbol{\mathit{q}}^i_S}{\sqrt{\boldsymbol{\mathit{r}}}})$ in the sense of Definition~\ref{def:demand_projector}.
Then we compute $v_i = \langle  \widetilde{\boldsymbol{\mathit{\pi}}}^i , \widetilde{SC}^+ \boldsymbol{\mathit{\pi}}_{old}\rangle$ where $\boldsymbol{\mathit{\pi}}_{old}$ is the demand projection that was computed exactly the last time $\textsc{BatchUpdate}$ was called.
These computed terms represent an approximation to the update in $(\boldsymbol{\mathit{Q}}\boldsymbol{\mathit{\rho}})_i$ between two consecutive calls of $\mathcal{L}.\textsc{Solve}$.
As we will show in the appendix, $\langle  \widetilde{\boldsymbol{\mathit{\pi}}}^i , \widetilde{SC}^+ \boldsymbol{\mathit{\pi}}_{old}\rangle$
 is an $\varepsilon$-additive approximation of
$\langle \boldsymbol{\mathit{\pi}}^{C}(\boldsymbol{\mathit{B}}^\top \frac{\boldsymbol{\mathit{q}}^i}{\sqrt{\boldsymbol{\mathit{r}}}}), \boldsymbol{\mathit{L}}^+ \boldsymbol{\mathit{\pi}}^{C}(\boldsymbol{\mathit{B}}^\top g(\ss)) \rangle$
for all $i\in\left[\tO{1/\varepsilon^2}\right]$.
The key fact that makes this approximation feasible is that although updates to the demand projection are hard to approximate with few samples, when hitting them with the deterministic vector $\boldsymbol{\mathit{\pi}}_{old}$, the resulting inner products strongly concentrate.
The runtime of this is $\tO{\beta m / \varepsilon^2}$.

Using these computed values with the $\ell_2$ heavy hitter data structure (Lemma 5.1, \cite{gao2021fully} v2)
we get all edges with congestion more than $\varepsilon$.

The total runtime is $\tO{\beta m / \varepsilon^2}$.

\subsection{$\varepsilon$-Important edges}
\label{sec:important}

In this section we will show that the effect of edges that are ``far'' from the congestion reduction subset $C$
is negligible, as both their congestion and the congestion incurred because of their demands are small.
More specifically, given a demand
$\boldsymbol{\mathit{d}}$ supported on $C$ with energy $\leq 1$, i.e. $\mathcal{E}_{\boldsymbol{\mathit{r}}}\left(\boldsymbol{\mathit{d}}\right) \leq 1$,
the congestion $\boldsymbol{\mathit{\rho}} = \boldsymbol{\mathit{R}}^{-1/2} \boldsymbol{\mathit{B}}\boldsymbol{\mathit{L}}^+ \boldsymbol{\mathit{d}}_C$ that it induces satisfies:
\begin{align*}
\left|\rho_e\right|
&= \left|\left\langle \mathbf{1}_e, \boldsymbol{\mathit{R}}^{-1/2}\boldsymbol{\mathit{B}} \boldsymbol{\mathit{L}}^+ \boldsymbol{\mathit{d}} \right\rangle\right| \\
& = \left|\left\langle\boldsymbol{\mathit{B}}^\top \frac{\mathbf{1}_e}{\sqrt{\boldsymbol{\mathit{r}}}}, \boldsymbol{\mathit{L}}^+ \boldsymbol{\mathit{d}}\right\rangle\right|\\
& = \left|\left\langle\boldsymbol{\mathit{\pi}}^C\left(\boldsymbol{\mathit{B}}^\top \frac{\mathbf{1}_e}{\sqrt{\boldsymbol{\mathit{r}}}}\right), SC^+ \boldsymbol{\mathit{d}}_C\right\rangle\right|\\
&\leq \sqrt{\mathcal{E}_{\boldsymbol{\mathit{r}}}\left(\boldsymbol{\mathit{\pi}}^C\left(\boldsymbol{\mathit{B}}^\top \frac{\mathbf{1}_e}{\sqrt{\boldsymbol{\mathit{r}}}}\right)\right) \mathcal{E}_{\boldsymbol{\mathit{r}}}\left(\boldsymbol{\mathit{d}}\right)} \\
& \leq \sqrt{\mathcal{E}_{\boldsymbol{\mathit{r}}}\left(\boldsymbol{\mathit{\pi}}^C\left(\boldsymbol{\mathit{B}}^\top \frac{\mathbf{1}_e}{\sqrt{\boldsymbol{\mathit{r}}}}\right)\right)}\,.
\end{align*}
For the last equality we used Fact~\ref{fact:demand_proj},
for the first inequality we applied Cauchy-Schwarz,
and for the second one we used the upper bound on the energy required to route $\boldsymbol{\mathit{d}}$.
Therefore, if we bound the energy of the projection of $\boldsymbol{\mathit{B}}^\top\frac{\mathbf{1}_e}{\sqrt{\boldsymbol{\mathit{r}}}}$ onto $C$, we can
also bound the congestion of $e$. This is done in the following lemma, whose proof appears
in Appendix~\ref{proof_st_projection1_energy}.

\begin{lemma}
Consider a graph $G(V,E)$ with resistances $\boldsymbol{\mathit{r}}$ and $C\subseteq V$. %
Then, for all $e\in E\backslash E(C)$ we have
\[ \sqrt{\mathcal{E}_r\left(\boldsymbol{\mathit{\pi}}^C\left(\boldsymbol{\mathit{B}}^\top \frac{\mathbf{1}_e}{\sqrt{r_e}}\right)\right)} \leq
6\cdot \sqrt{\frac{r_e}{R_{eff}(C,e)}}\,. \]
\label{st_projection1_energy}
\end{lemma}
This is the consequence of the following lemma, which bounds the magnitude of the projection
on a specific vertex, based on its effective resistance distance from $e$, as well as hitting
probabilities from $e$ to $C$.
The proof appears in Appendix~\ref{proof_st_projection1}.
\begin{lemma}
Consider a graph $G(V,E)$ with resistances $\boldsymbol{\mathit{r}}$ and a subset of vertices $C\subseteq V$.
For any vertex $v\in V\backslash C$
we have that
\begin{align*}
\left|\pi_v^{C\cup\{v\}}\left(\boldsymbol{\mathit{B}}^\top \frac{\mathbf{1}_e}{\sqrt{\boldsymbol{\mathit{r}}}}\right)\right| \leq (p_v^{C\cup\{v\}}(u) + p_v^{C\cup\{v\}}(w)) \cdot \frac{\sqrt{r_e}}{R_{eff}(v,e)} \,.
\end{align*}
\label{st_projection1}
\end{lemma}
This lemma is complementary to the more immediate property
\[ \left|\pi_v^{C\cup\{v\}}\left(\boldsymbol{\mathit{B}}^\top \frac{\mathbf{1}_e}{\sqrt{\boldsymbol{\mathit{r}}}}\right)\right| \leq (p_v^{C\cup\{v\}}(u) + p_v^{C\cup\{v\}}(w)) \cdot \frac{1}{\sqrt{r_e}}\,, \]
and they are both used in Section~\ref{sec:demand_projection}
in order to estimate demand projections.
In fact, the just by multiplying these two, we get the following
lemma, which is nice because it doesn't depend on $r_e$:
\begin{lemma}
Consider a graph $G(V,E)$ with resistances $\boldsymbol{\mathit{r}}$ and a subset of vertices $C\subseteq V$.
For any vertex $v\in V\backslash C$
we have that
\begin{align*}
\left|\pi_v^{C\cup\{v\}}\left(\boldsymbol{\mathit{B}}^\top \frac{\mathbf{1}_e}{\sqrt{\boldsymbol{\mathit{r}}}}\right)\right| \leq (p_v^{C\cup\{v\}}(u) + p_v^{C\cup\{v\}}(w)) \cdot \frac{1}{\sqrt{R_{eff}(v,e)}} \,.
\end{align*}
\label{st_projection_combined}
\end{lemma}

By the previous discussion, Lemma~\ref{st_projection1}
implies that if $\left|\rho_e\right| \geq \varepsilon$, then
$R_{eff}(C,e) \leq r_e\cdot \frac{36}{\varepsilon^2}$.
This motivates the following definition of $\varepsilon$-\emph{important edges}.

\begin{definition}[Important edges]
An edge $e\in E$ is called $\varepsilon$-\emph{important} (or just \emph{important}) if
$R_{eff}(C,e) \leq r_e / \varepsilon^2$.
\end{definition}

Now it is time for the main lemma of this section, which uses Lemma~\ref{st_projection1_energy}
to show that if our goal is to detect edges with congestion $\geq \varepsilon$,
it is sufficient to restrict to computing demand projections of
$\Omega(\varepsilon)$-important edges.
Its proof appears in Appendix~\ref{proof_lem_important_edges}.
\begin{lemma}[Localization lemma]
Let $\boldsymbol{\mathit{\phi}}^*$ be any solution of
\begin{align*}
\boldsymbol{\mathit{L}} \boldsymbol{\mathit{\phi}}^* = \delta \cdot \boldsymbol{\mathit{\pi}}^C\left(\boldsymbol{\mathit{B}}^\top \frac{\boldsymbol{\mathit{p}}}{\sqrt{\boldsymbol{\mathit{r}}}} \right)\,,
\end{align*}
where $\boldsymbol{\mathit{r}}$ are any resistances, $\boldsymbol{\mathit{p}}\in[-1,1]^m$, and $C\subseteq V$.
Then,
for any $e\in E$ that is not $\varepsilon$-important
we have
$\left|\frac{\boldsymbol{\mathit{B}}\boldsymbol{\mathit{\phi}}^*}{\sqrt{\boldsymbol{\mathit{r}}}}\right|_e \leq 6\varepsilon$.
\label{lem:important_edges}
\end{lemma}

\section{Introduction}
In the last decade, continuous optimization has proved to be an invaluable tool for designing graph algorithms, often leading to significant
improvements over the best known combinatorial algorithms. This has been particularly true in the context of flow problems---arguably, some of the most prominent graph problems~\cite{daitch2008faster, christiano2011electrical,lee2013new, madry2013navigating, sherman2013nearly, kelner2014almost, lee2014path,peng2016approximate, madry2016computing, cmsv17,sherman2017generalized, sherman2017area, sidford2018coordinate, liu2019faster, liu2020faster, axiotis2020circulation, van2020bipartite, van2021minimum}. %
Indeed, these developments have brought a host of remarkable improvements in a variety of regimes, such as when seeking only approximate solutions, or when the underlying graph is dense. However, most of these improvements did not fully address the challenge of seeking \emph{exact} solutions in \emph{sparse} graphs. Fortunately, the improvements for that  regime eventually emerged~\cite{madry2013navigating,madry2016computing,cmsv17,liu2019faster,liu2020faster,axiotis2020circulation}. They still suffered though from an important shortcoming: they all had a polynomial running time dependency in the graph's capacities, and hence---in contrast to the classical combinatorial algorithms---they did not yield efficient algorithms in the presence of arbitrary capacities.
Recently, Gao, Liu and Peng \cite{gao2021fully} have finally changed this state of affairs by providing the first \emph{exact} maximum flow algorithm to break the $\tO{m^{3/2}\log^{O(1)} U}$ barrier for sparse graphs with \emph{general} capacities (bounded by $U$). Their approach, however, crucially relies on a preconditioning technique that is specific to the maximum flow problem and, in particular, having an $s$-$t$ demand---rather than a general one. As a result, the corresponding improvement held only for that particular problem.

In this paper, we demonstrate how to circumvent these limitations and provide the first algorithm that breaks the
$\tO{m^{3/2}\log^{O(1)} (U+W)}$ barrier for the \emph{minimum cost flow} problem
in \emph{sparse} graphs with general demands, capacities (bounded by $U$), and costs (bounded by $W$).
This algorithm runs in time $\tO{m^{3/2 - 1/762}\log (U+W)}$.

\subsection{Previous work}
In 2013, M\k{a}dry~\cite{madry2013navigating}
presented the first running time improvement to the maximum flow problem
since the $\tO{m\sqrt{n} \log U}$ algorithm of~\cite{goldberg1998beyond} in the regime of sparse graphs with small capacities. To this end, he presented an algorithm that runs in time
$\tO{m^{10/7}\mathrm{poly}(U)}$,
where $U$ is a bound on edge capacities, breaking past the $\tO{m^{3/2}}$ running time barrier that has for decades resisted improvement attempts. The main idea in that work was to use an interior point method with
an improved number of iterations guarantee that was delivered via use of an adaptive re-weighting of
the central path and careful perturbations of the problem instance.
Building on this framework, a series of subsequent works~\cite{madry2016computing,liu2019faster,liu2020faster}
has brought the runtime of sparse max flow down to $\tO{m^{4/3}\mathrm{poly}(U)}$. (With the most recent of these works crucially relying on nearly-linear time $\ell_p$ flows~\cite{kyng2019flows}.)
In parallel~\cite{cmsv17,axiotis2020circulation}, the running time of the
more general minimum cost flow problem was reduced to $\tO{m^{4/3}\mathrm{poly}(U)\log W}$,
where $W$ is a bound on edge costs.

However, even though these algorithms offer a significant improvement when
$U$ is relatively small, the question of whether there exists an algorithm
faster than $\tO{m^{3/2} \log^{O(1)} U}$ for sparse graphs with general  capacities remained open. In fact,
a polynomial dependence on capacities or costs seems inherent in the
central path re-weighting technique used in all the aforementioned works.
Recently, \cite{gao2021fully} finally made progress on this question by developing an algorithm for the maximum flow problem that
runs in time $\tO{m^{3/2 - 1/328}\log U}$. The source of improvement here was different
from previous works, in the sense that it was not based on decreasing the number of iterations
of the interior point method. Instead,
it was based on devising a data structure
to solve the dynamically changing Laplacian system required by the interior point method in sublinear
time per iteration.

The new approach put forth by \cite{gao2021fully}, despite being quite different to the prior ones, still leaned on
the preconditioning approach of~\cite{madry2016computing}, as well as on other properties that
are specific to the maximum flow problem. For this reason, this improvement did not extend
to the minimum cost flow problem with general capacities, for which the fastest known runtime
was still
$\tO{m \log(U+W)+ n^{1.5} \log^2 (U+ W)}$~\cite{van2021minimum} and $\widetilde{O}({m^{3/2} \log^{O(1)} (U+W)})$~\cite{daitch2008faster} in the sparse regime.

\subsection{Our result}

In this work, we give an algorithm for the minimum cost flow problem with a running time of $\tO{m^{3/2 - 1/762}\log (U+W)}$. This is the first improvement for sparse graphs with general capacities
over~\cite{daitch2008faster},
which runs in time $\tO{m^{3/2}\log^{O(1)} (U+W)}$.
Specifically, we prove that:

\begin{theorem}
\sloppy Given a graph $G(V,E)$ with edge costs $\boldsymbol{\mathit{c}}\in\mathbb{Z}_{[-W,W]}^m$,
a demand $\boldsymbol{\mathit{d}}\in\mathbb{R}^n$, and capacities $\boldsymbol{\mathit{u}}\in\mathbb{Z}_{(0,U]}^m$,
there exists an algorithm that with high probability
runs in time $\widetilde{O}\left(m^{3/2-1/762}\log (U+W)\right)$ and
returns a flow $\boldsymbol{\mathit{f}}\in[\mathbf{0},\boldsymbol{\mathit{u}}]$ in $G$ such that
$\boldsymbol{\mathit{f}}$ routes the demand $\boldsymbol{\mathit{d}}$
and the cost $\langle \boldsymbol{\mathit{c}}, \boldsymbol{\mathit{f}}\rangle$ is minimized.

\label{thm:main}
\end{theorem}

\subsection{High level overview of our approach}
As we build on the approach presented in~\cite{gao2021fully},
we first briefly overview some of the key ideas introduced there that will also be relevant for our discussion.
The maximum flow interior point method by \cite{madry2016computing} works by, repeatedly
over $\tO{\sqrt{m}}$ steps,
taking an
electrical flow step that is a multiple of
\[ \boldsymbol{\mathit{\widetilde{f}}} = \boldsymbol{\mathit{R}}^{-1} \boldsymbol{\mathit{B}} \boldsymbol{\mathit{L}}^+ \boldsymbol{\mathit{B}}^\top \mathbf{1}_{st}\,, \]
where $\boldsymbol{\mathit{L}} = \boldsymbol{\mathit{B}}^\top \boldsymbol{\mathit{R}}^{-1} \boldsymbol{\mathit{B}}$ is a Laplacian matrix and $\boldsymbol{\mathit{r}}$ are resistances that
change per step.
However, $\boldsymbol{\mathit{\widetilde{f}}}$ has $m$ entries and takes $\tO{m}$ to compute, which gives the standard $\tO{m^{3/2}}$
bound. To go beyond this,
\cite{gao2021fully} show that it suffices to compute $\boldsymbol{\mathit{\widetilde{f}}}$ for only a \emph{sublinear} number
of high-congestion entries of $\boldsymbol{\mathit{\widetilde{f}}}$, where congestion is defined as $\boldsymbol{\mathit{\rho}}=\sqrt{\boldsymbol{\mathit{r}}}\boldsymbol{\mathit{\widetilde{f}}}$. By known
linear sketching
results, these edges can be detected by computing the inner product $\langle\boldsymbol{\mathit{q}},\boldsymbol{\mathit{\rho}}\rangle$
for a small number of randomly chosen vectors $\boldsymbol{\mathit{q}}\in\mathbb{R}^m$. Crucially,
given a vertex subset $C\subseteq V$ of sublinear size
that contains $s$ and $t$,
this inner product can be equivalently
written as the following sublinear-sized inner product
\begin{align}
\left\langle \boldsymbol{\mathit{q}},\boldsymbol{\mathit{\rho}}\right\rangle = \left\langle \boldsymbol{\mathit{\pi}}^C\left(\boldsymbol{\mathit{B}}^\top \frac{\boldsymbol{\mathit{q}}}{\sqrt{\boldsymbol{\mathit{r}}}}\right),
SC^+ \boldsymbol{\mathit{d}}\right\rangle \,, \label{eq:identity}
\end{align}
where $SC := SC(G,C)$ is the \emph{Schur complement} of $G$ onto $C$,
$\boldsymbol{\mathit{d}}$ is equal to $\boldsymbol{\mathit{B}}^\top \mathbf{1}_{st}$, and
$\boldsymbol{\mathit{\pi}}^C\left(\cdot\right)$ is a \emph{demand projection} onto $C$.
Therefore, the problem is reduced to maintaining two
quantities: $\boldsymbol{\mathit{\pi}}^C\left(\boldsymbol{\mathit{B}}^\top \frac{\boldsymbol{\mathit{q}}}{\sqrt{\boldsymbol{\mathit{r}}}}\right)$
and $(SC(G,C))^+ \boldsymbol{\mathit{d}}$ in sublinear time per operation. The latter is computed by
using the dynamic Schur complement data structure of~\cite{durfee2019fully},
and the former can be maintained by a careful use of random walks.

We now describe our approach. Instead of using the
interior point method formulation of~\cite{madry2016computing} which only applies to the
maximum flow problem,
we use the one by~\cite{axiotis2020circulation} for the, more general, minimum cost flow problem.

There are now several obstacles to making this approach work
by maintaining the quantity $\langle \boldsymbol{\mathit{q}},\boldsymbol{\mathit{\rho}}\rangle$:

\paragraph{Preconditioning}
A significant difference between~\cite{madry2016computing} and~\cite{axiotis2020circulation} is that while the former is able to guarantee
that the magnitude of the electrical potentials computed in each step is inversely proportional to the duality gap,
meaning that a large duality gap implies potential embeddings of low stretch,
no such preconditioning method is known for minimum cost flow. In fact, \cite{axiotis2020circulation} used demand perturbations to show that
a \emph{weaker} bound on the potentials can be achieved, which was still sufficient for their purposes.
Unfortunately, this bound is not strong enough to be used in the analysis of~\cite{gao2021fully}.

In order to alleviate this issue, we completely remove preconditioning from the picture by only requiring a bound on the \emph{energy} of the
electrical potentials (instead of their magnitude).
In particular, given an approximate demand projection ${\widetilde{\boldsymbol{\mathit{\pi}}}}^{C}\left(\boldsymbol{\mathit{B}}^\top \frac{\boldsymbol{\mathit{q}}}{\sqrt{\boldsymbol{\mathit{r}}}}\right)$,
identity
\eqref{eq:identity} is used to detect congested edges.
In~\cite{gao2021fully}, there is a uniform upper bound on
the entries of the potential embedding
$\boldsymbol{\mathit{\phi}} = SC^+ \boldsymbol{\mathit{d}}$
because of preconditioning, thus the error in $(\ref{eq:identity})$ can be bounded by
\begin{align*}
\left\|\widetilde{\boldsymbol{\mathit{\pi}}}^C\left(\boldsymbol{\mathit{B}}^\top \frac{\boldsymbol{\mathit{q}}}{\sqrt{\boldsymbol{\mathit{r}}}}\right) - \boldsymbol{\mathit{\pi}}^C\left(\boldsymbol{\mathit{B}}^\top \frac{\boldsymbol{\mathit{q}}}{\sqrt{\boldsymbol{\mathit{r}}}}\right)\right\|_1 \left\|\boldsymbol{\mathit{\phi}}\right\|_\infty\,.
\end{align*}
As we do not have a good bound on $\left\|\boldsymbol{\mathit{\phi}}\right\|_\infty$,
we instead use an alternative upper bound on the error:
\begin{align*}
\sqrt{\mathcal{E}_{\boldsymbol{\mathit{r}}}\left(\widetilde{\boldsymbol{\mathit{\pi}}}^C\left(\boldsymbol{\mathit{B}}^\top \frac{\boldsymbol{\mathit{q}}}{\sqrt{\boldsymbol{\mathit{r}}}}\right) - \boldsymbol{\mathit{\pi}}^C\left(\boldsymbol{\mathit{B}}^\top \frac{\boldsymbol{\mathit{q}}}{\sqrt{\boldsymbol{\mathit{r}}}}\right)\right)} \sqrt{E_{\boldsymbol{\mathit{r}}}\left(\boldsymbol{\mathit{\phi}}\right)}\,,
\end{align*}
where $\mathcal{E}_{\boldsymbol{\mathit{r}}}(\cdot)$ gives the energy to route a demand with resistances $\boldsymbol{\mathit{r}}$,
and $E_{\boldsymbol{\mathit{r}}}(\cdot)$ gives the energy of a potential embedding with resistances $\boldsymbol{\mathit{r}}$.
As the standard interior point method step
satisfies $E_{\boldsymbol{\mathit{r}}}(\boldsymbol{\mathit{\phi}}) \leq 1$, all our efforts focus on ensuring that
\begin{align}
\sqrt{\mathcal{E}_{\boldsymbol{\mathit{r}}}\left(\widetilde{\boldsymbol{\mathit{\pi}}}^C\left(\boldsymbol{\mathit{B}}^\top \frac{\boldsymbol{\mathit{q}}}{\sqrt{\boldsymbol{\mathit{r}}}}\right) - \boldsymbol{\mathit{\pi}}^C\left(\boldsymbol{\mathit{B}}^\top \frac{\boldsymbol{\mathit{q}}}{\sqrt{\boldsymbol{\mathit{r}}}}\right)\right)} \leq \varepsilon
\label{eq:energy_error}
\end{align}
for some error parameter $\varepsilon$.
One issue is the fact that the energy depends on the current resistances,
therefore even if at some point the error of the demand projection is low,
after a few iterations it might increase because of resistance changes.
We deal with this issue by taking the stability of resistances along the central path
into account.
This allows us to upper bound how much this error increases after a number of iterations.
The resistance stability lemma is a generalization of the one used in~\cite{gao2021fully}.

Unfortunately, even though (\ref{eq:energy_error}) seems like the right type of guarantee,
it is unclear how to ensure that it is always true.
Specifically, it involves efficiently computing the hitting probabilities from some vertex
$v$ to $C$ in an appropriate norm, which ends up being non-trivial.
Instead, we show that the following \emph{weaker} error bound can be ensured with high probability:
\begin{align}
\left|\left\langle \widetilde{\boldsymbol{\mathit{\pi}}}^C\left(\boldsymbol{\mathit{B}}^\top \frac{\boldsymbol{\mathit{q}}}{\sqrt{\boldsymbol{\mathit{r}}}}\right) - \boldsymbol{\mathit{\pi}}^C\left(\boldsymbol{\mathit{B}}^\top \frac{\boldsymbol{\mathit{q}}}{\sqrt{\boldsymbol{\mathit{r}}}}\right), \boldsymbol{\mathit{\phi}}\right\rangle\right| \leq \varepsilon\,,
\label{eq:potential_error}
\end{align}
where $\boldsymbol{\mathit{\phi}}$ is a \emph{fixed} potential vector with $E_{\boldsymbol{\mathit{r}}}(\boldsymbol{\mathit{\phi}}) \leq 1$.
Interestingly, this guarantee is still sufficient for our purposes.

\paragraph{Costs and general demand}
There is a fundamental obstacle to using the approach of~\cite{gao2021fully} once edge costs are introduced. In particular, for the maximum flow
problem, the demand pushed by the electrical flow in each iteration is an $s$-$t$ demand, so---up to scaling---it is always constant.
In minimum cost flow on the other hand, the augmenting flow is a multiple of
$\boldsymbol{\mathit{c}} - \boldsymbol{\mathit{R}}^{-1} \boldsymbol{\mathit{B}} \boldsymbol{\mathit{L}}^+ \boldsymbol{\mathit{B}}^\top \boldsymbol{\mathit{c}}$. Here it is not possible to locate a sublinear number of congested edges just by looking at
the electrical flow term $\boldsymbol{\mathit{R}}^{-1} \boldsymbol{\mathit{B}} \boldsymbol{\mathit{L}}^+ \boldsymbol{\mathit{B}}^\top \boldsymbol{\mathit{c}}$, as there might be significant cancellations with $\boldsymbol{\mathit{c}}$.
We instead use the following equivalent form:
$\frac{\frac{1}{\ss^+} - \frac{1}{\ss^-}}{\boldsymbol{\mathit{r}}} - \boldsymbol{\mathit{R}}^{-1} \boldsymbol{\mathit{B}} \boldsymbol{\mathit{L}}^+ \boldsymbol{\mathit{B}}^\top \frac{\frac{1}{\ss^+} - \frac{1}{\ss^-}}{\boldsymbol{\mathit{r}}}$,
which allows us to ignore the first term
because it is small and concentrate on the electrical flow term.
One issue that arises is the fact that the demand vector $\boldsymbol{\mathit{B}}^\top \frac{\frac{1}{\ss^+}-\frac{1}{\ss^-}}{\boldsymbol{\mathit{r}}}$ now depends on slacks, and as a result changes
throughout the interior point method. This issue can be handled relatively easily.

A more significant issue concerns the vertex sparsifier. In fact, the vertex sparsifier framework around which~\cite{gao2021fully} is based only
accepts demands that are supported on the vertex set $C$ of the sparsifier. As $|C|$ is sublinear in $n$, this only captures demands with sublinear support,
one such example being max flow with support $2$. However, our demand vector $\boldsymbol{\mathit{B}}^\top \frac{\frac{1}{\ss^+} - \frac{1}{\ss^-}}{\boldsymbol{\mathit{r}}}$ in general will be supported
on $n$ vertices. Even though it might seem impossible to get around this issue, we show that the special structure of $C$ allows us to
push the demand to a small number of vertices. More specifically, we show that
if one projects all of the demand onto $C$, the flow induced by this new demand will not differ much from the one with the original demand.
Concretely, given a Laplacian system $\boldsymbol{\mathit{L}} \boldsymbol{\mathit{\phi}} = \boldsymbol{\mathit{d}}$, we decompose it into two systems
$\boldsymbol{\mathit{L}} \boldsymbol{\mathit{\phi}}^{(1)} = \boldsymbol{\mathit{\pi}}^C(\boldsymbol{\mathit{d}})$ and
$\boldsymbol{\mathit{L}} \boldsymbol{\mathit{\phi}}^{(2)} = \boldsymbol{\mathit{d}} - \boldsymbol{\mathit{\pi}}^C(\boldsymbol{\mathit{d}})$, where $\boldsymbol{\mathit{\pi}}^C(\boldsymbol{\mathit{d}})$ is the projection of $\boldsymbol{\mathit{d}}$ onto $C$.
Intuitively, the latter system computes the electrical flow to push all demands to $C$, and the former to serve this $C$-supported demand.
We show that, as long as $C$ is a \emph{congestion reduction subset} (as it is also the case in~\cite{gao2021fully}),
$\boldsymbol{\mathit{\phi}}^{(2)}$ has negligible contribution in the electrical flow, thus it can be ignored.
More specifically, in Section~\ref{sec:Fsystem} we prove the following lemma:
\begin{replemma}{lem:non-projected-demand-contrib}
Consider a graph $G(V,E)$ with resistances $\boldsymbol{\mathit{r}}$ and Laplacian $\boldsymbol{\mathit{L}}$, a $\beta$-congestion reduction subset $C$,
and a demand $\boldsymbol{\mathit{d}} = \delta \boldsymbol{\mathit{B}}^\top \frac{\boldsymbol{\mathit{q}}}{\sqrt{\boldsymbol{\mathit{r}}}}$ for some $\delta > 0$ and
$\boldsymbol{\mathit{q}} \in[-1,1]^m$.
Then, the potential embedding defined as
\begin{align*}
\boldsymbol{\mathit{\phi}} = \boldsymbol{\mathit{L}}^+ \left(\boldsymbol{\mathit{d}} - \boldsymbol{\mathit{\pi}}^C\left(\boldsymbol{\mathit{d}}\right)\right)
\end{align*}
has congestion $\delta \cdot \tO{1/\beta^2}$, i.e. %
$\left\|\frac{\boldsymbol{\mathit{B}} \boldsymbol{\mathit{\phi}}}{\sqrt{\boldsymbol{\mathit{r}}}}\right\|_\infty \leq \delta \cdot \tO{1/\beta^2}$. %
\end{replemma}
Now, for computing $\boldsymbol{\mathit{\phi}}^{(1)}$, we need to get an approximate estimate of $\boldsymbol{\mathit{\pi}}^C(\boldsymbol{\mathit{d}})$.
Even though the most natural approach would be to try to maintain $\boldsymbol{\mathit{\pi}}^C(\boldsymbol{\mathit{d}})$ under
vertex insertions to $C$, this approach has issues related to the fact
that our error guarantee is based
on a \emph{fixed} potential vector. In particular, if we used an estimate of $\boldsymbol{\mathit{\pi}}^C(\boldsymbol{\mathit{d}})$, then
the potential vector in (\ref{eq:potential_error}) would depend on the randomness of this
estimate, and as a result the high probability guarantee would not work.

Instead, we show that it is not even neccessary to maintain $\boldsymbol{\mathit{\pi}}^C(\boldsymbol{\mathit{d}})$ very accurately.
In fact, it suffices to \emph{exactly} compute it only every few iterations of the algorithm,
and use this estimate for the calculation. What allows us to do this is the following lemma,
which bounds the change of $\boldsymbol{\mathit{\pi}}^C(\boldsymbol{\mathit{d}})$ measured in energy, after a sequence of
vertex insertions and resistance changes.
\begin{replemma}{lem:old_projection_approximate}
Consider a graph $G(V,E)$ with resistances $\boldsymbol{\mathit{r}}^0$, $\boldsymbol{\mathit{q}}^0\in[-1,1]^m$, a $\beta$-congestion
reduction subset $C^0$, %
and a fixed sequence of updates,
where the $i$-th update $i\in\{0,T-1\}$ is of the following form:
\begin{itemize}
    \item {\textsc{AddTerminal}($v^i$): Set $C^{i+1} = C^{i} \cup \{v^i\}$ for some $v^i\in V\backslash C^i$, $q_e^{i+1} = q_e^{i}, r_e^{i+1} = r_e^{i}$}
    \item {\textsc{Update}($e^i,\boldsymbol{\mathit{q}},\boldsymbol{\mathit{r}}$): Set $C^{i+1} = C^{i}$, $q_e^{i+1} = q_e$ $r_e^{i+1} = r_e$, where $e^i\in E(C^{i})$}
\end{itemize}
Then, with high probability,
\[
\sqrt{\mathcal{E}_{\boldsymbol{\mathit{r}}^T} \left(\boldsymbol{\mathit{\pi}}^{C^0,\boldsymbol{\mathit{r}}^0}\left(\boldsymbol{\mathit{B}}^\top \frac{\boldsymbol{\mathit{q}}_S^0}{\sqrt{\boldsymbol{\mathit{r}}^0}}\right) - \boldsymbol{\mathit{\pi}}^{C^T,\boldsymbol{\mathit{r}}^T}\left(\boldsymbol{\mathit{B}}^\top \frac{\boldsymbol{\mathit{q}}_S^T}{\sqrt{\boldsymbol{\mathit{r}}^T}}\right)\right)}
\leq \tO{\max_{i\in\{0,\dots,T-1\}} \left\|\frac{\boldsymbol{\mathit{r}}^T}{\boldsymbol{\mathit{r}}^i}\right\|_\infty^{1/2} \beta^{-2}} \cdot T\,.
\]
\end{replemma}

If we call this demand projection estimate $\boldsymbol{\mathit{\pi}}_{old}$,
the quantity that we would like to maintain (\ref{eq:identity})
now becomes
\begin{align*}
\left\langle\boldsymbol{\mathit{q}},\boldsymbol{\mathit{\rho}}\right\rangle \approx \left\langle \boldsymbol{\mathit{\pi}}^C\left(\boldsymbol{\mathit{B}}^\top \frac{\boldsymbol{\mathit{q}}}{\sqrt{\boldsymbol{\mathit{r}}}}\right), SC^+ \boldsymbol{\mathit{\pi}}_{old}\right\rangle \,.
\end{align*}
Therefore all that's left is to efficiently maintain approximations to demand projections of the form
$\boldsymbol{\mathit{\pi}}^C\left(\boldsymbol{\mathit{B}}^\top \frac{\boldsymbol{\mathit{q}}}{\sqrt{\boldsymbol{\mathit{r}}}}\right)$.

\paragraph{Bounding demand projections.}
An important component for showing that demand projections can be updated efficiently
is bounding the magnitude of an entry
$\pi_v^{C\cup\{v\}}(\boldsymbol{\mathit{B}}^\top \frac{\mathbf{1}_{e}}{\sqrt{r_e}})$
of the projection, for some fixed edge $e=(u,w)$.
This is apparent in the following identity which shows how a demand
projection changes after inserting a vertex:
 \begin{align}
 \boldsymbol{\mathit{\pi}}^{C\cup\{v\}}\left(\boldsymbol{\mathit{d}}\right) = \boldsymbol{\mathit{\pi}}^C\left(\boldsymbol{\mathit{d}}\right) + \pi_v^{C\cup\{v\}}\left(\boldsymbol{\mathit{d}}\right)\cdot \left(\mathbf{1}_v - \boldsymbol{\mathit{\pi}}^C(\mathbf{1}_v)\right)\,.
 \label{eq:addonevertex}
 \end{align}
In~\cite{gao2021fully}
this projection entry is upper bounded by
$(p_v^{C\cup\{v\}}(u)+p_v^{C\cup\{v\}}(w)) \cdot \frac{1}{\sqrt{r_e}}$, where
$p_v^{C\cup\{v\}}(u)$ is the probability that a random walk starting at $u$ hits
$v$ before $C$.
This bound can be very bad as $r_e$ can be arbitrarily small, although in the particular
case of max flow it is possible to show that such low-resistance edges
cannot get congested and thus are not of interest.

In order to overcome this issue, we provide a different bound, which
in contrast works best when $r_e$ is small.

\begin{replemma}{st_projection1}
Consider a graph $G(V,E)$ with resistances $\boldsymbol{\mathit{r}}$ and a subset of vertices $C\subseteq V$.
For any vertex $v\in V\backslash C$
we have that
\begin{align*}
\left|\pi_v^{C\cup\{v\}}\left(\boldsymbol{\mathit{B}}^\top \frac{\mathbf{1}_e}{\sqrt{\boldsymbol{\mathit{r}}}}\right)\right| \leq (p_v^{C\cup\{v\}}(u) + p_v^{C\cup\{v\}}(w)) \cdot \frac{\sqrt{r_e}}{R_{eff}(v,e)} \,.
\end{align*}
\end{replemma}

Here $R_{eff}(v,e)$ is the effective resistance between $v$ and $e$.
In fact, together with the other upper bound mentioned above, this implies that
\[
\left|\pi_v^{C\cup\{v\}}\left(\boldsymbol{\mathit{B}}^\top \frac{\mathbf{1}_e}{\sqrt{\boldsymbol{\mathit{r}}}}\right)\right| \leq (p_v^{C\cup\{v\}}(u) + p_v^{C\cup\{v\}}(w)) \cdot \frac{1}{\sqrt{R_{eff}(v,e)}} \,,
\]
which no longer depends on the value of the resistance $r_e$.

As we will see, it suffices to approximate
$\pi_v^{C\cup\{v\}}\left(\boldsymbol{\mathit{B}}^\top \frac{\mathbf{1}_e}{\sqrt{\boldsymbol{\mathit{r}}}}\right)$ up
to additive accuracy roughly
$\widehat{\eps} \cdot (p_v^{C\cup\{v\}}(u) + p_v^{C\cup\{v\}}(w)) / \sqrt{R_{eff}(C,v)}$
for some error parameter $\widehat{\eps} > 0$.
Thus, Lemma~\ref{st_projection1} immediately implies that for any edge $e$ such that
$R_{eff}(v,e) \gg R_{eff}(C,v)$, this term is small enough to begin with,
and thus can be ignored.

\paragraph{Important edges.}

In order to ensure that the demand projection can be updated efficiently, we focus
only on the demand coming from a special set of edges, which we call
\emph{important}. These are the edges
that are close (in effective resistance metric) to $C$ relative to their own resistance $r_e$.
In fact, the farther an edge is from $C$ in this sense,
the smaller its worst-case congestion, and so non-important edges
do not influence the set of congested edges that we are looking for.
At a high level, %
this is because parts of the graph that are very far
in the potential embedding have minimal interactions with each other.

\begin{definition}[Important edges]
An edge $e\in E$ is called $\varepsilon$-\emph{important} (or just \emph{important}) if
$R_{eff}(C,e) \leq r_e / \varepsilon^2$.
\end{definition}
Based on the above discussion, we seek to find congested edges \emph{only} among important edges.
\begin{replemma}{lem:important_edges}[Localization lemma]
Let $\boldsymbol{\mathit{\phi}}^*$ be any solution of
\begin{align*}
\boldsymbol{\mathit{L}} \boldsymbol{\mathit{\phi}}^* = \delta \cdot \boldsymbol{\mathit{\pi}}^C\left(\boldsymbol{\mathit{B}}^\top \frac{\boldsymbol{\mathit{p}}}{\sqrt{\boldsymbol{\mathit{r}}}} \right)\,,
\end{align*}
where $\boldsymbol{\mathit{r}}$ are any resistances, $\boldsymbol{\mathit{p}}\in[-1,1]^m$, and $C\subseteq V$.
Then,
for any $e\in E$ that is not $\varepsilon$-important
we have
$\left|\frac{\boldsymbol{\mathit{B}}\boldsymbol{\mathit{\phi}}^*}{\sqrt{\boldsymbol{\mathit{r}}}}\right|_e \leq 12\varepsilon$.
\end{replemma}
One issue is that the set of important edges changes whenever $C$ changes. However, we show that,
because of the stability of resistances along the central path, the set of important edges only
needs to be updated once every few iterations.

\section{Interior Point Method with Dynamic Data Structures}
\label{sec:ipm}
The goal of this section is to show that, given a data structure for approximating
electrical flows in sublinear time,
we can execute the min cost flow interior point method with total runtime faster than
$\tO{m^{3/2}}$.

\subsection{LP formulation and background}
We present the interior point method setup that we will use, which is from~\cite{axiotis2020circulation}.
Our goal is to solve the following minimum cost flow
linear program:
\begin{align*}
& \min\, \left\langle \boldsymbol{\mathit{c}}, \boldsymbol{\mathit{C}}\boldsymbol{\mathit{x}}\right\rangle\\
& \mathbf{0} \leq \boldsymbol{\mathit{f}}^0 + \boldsymbol{\mathit{C}} \boldsymbol{\mathit{x}} \leq \boldsymbol{\mathit{u}}\,,
\end{align*}
where $\boldsymbol{\mathit{f}}^0$ is a flow with $\boldsymbol{\mathit{B}}^\top \boldsymbol{\mathit{f}}^0= \boldsymbol{\mathit{d}}$ and
$\boldsymbol{\mathit{C}}$ is an $m\times (m-n+1)$ matrix whose image is the set of circulations in $G$.

In order to use an interior point method,
the following log barrier objective is defined:
\begin{align}
\underset{\boldsymbol{\mathit{x}}}{\min}\, F_{\mu}(\boldsymbol{\mathit{x}}) = \left\langle \frac{\boldsymbol{\mathit{c}}}{\mu}, \boldsymbol{\mathit{C}}\boldsymbol{\mathit{x}} \right\rangle -\sum\limits_{e\in E}\left(\log\left(\boldsymbol{\mathit{f}}^0 + \boldsymbol{\mathit{C}}\boldsymbol{\mathit{x}}\right)_e
+ \log\left(\boldsymbol{\mathit{u}} - (\boldsymbol{\mathit{f}}^0 + \boldsymbol{\mathit{C}}\boldsymbol{\mathit{x}})\right)_e
\right)\,.
\label{eq:logbarrier}
\end{align}
For any parameter $\mu > 0$,
the optimality condition of (\ref{eq:logbarrier}) is called the \emph{centrality condition}
and is given by
\begin{align}
\boldsymbol{\mathit{C}}^\top \left(\frac{\boldsymbol{\mathit{c}}}{\mu} + \frac{1}{\ss^+} - \frac{1}{\ss^-}\right) = \mathbf{0}\,,
\label{eq:centrality}
\end{align}
where $\boldsymbol{\mathit{f}} = \boldsymbol{\mathit{f}}^0 + \boldsymbol{\mathit{C}}\boldsymbol{\mathit{x}}$, and
$\ss^+ = \boldsymbol{\mathit{u}} - \boldsymbol{\mathit{f}}$, $\ss^- = \boldsymbol{\mathit{f}}$ are called the \emph{positive} and \emph{negative} slacks of $\boldsymbol{\mathit{f}}$
respectively.

This leads us to the following definitions.
\begin{definition}[$\mu$-central flow]
Given a minimum cost flow instance with costs $\boldsymbol{\mathit{c}}$, demands $\boldsymbol{\mathit{d}}$ and capacities $\boldsymbol{\mathit{u}}$,
as well as a parameter $\mu > 0$,
we will say that a flow $\boldsymbol{\mathit{f}}$ (and its corresponding slacks $\ss$ and resistances $\boldsymbol{\mathit{r}}$)
is $\mu$-central if
$\boldsymbol{\mathit{B}}^\top \boldsymbol{\mathit{f}} = \boldsymbol{\mathit{d}}$, $\ss > \mathbf{0}$, and
it satisfies the centrality condition (\ref{eq:centrality}), i.e.
\begin{align*}
\boldsymbol{\mathit{C}}^\top \left(\frac{\boldsymbol{\mathit{c}}}{\mu} + \frac{1}{\ss^+} - \frac{1}{\ss^-}\right) = \mathbf{0}\,.
\end{align*}
Additionally, we will denote such flow by $\boldsymbol{\mathit{f}}(\mu)$ (and its corresponding slacks
and resistances by $\ss(\mu)$ and $\boldsymbol{\mathit{r}}(\mu)$, respectively).
\end{definition}
\begin{definition}[$(\mu,\alpha)$-central flow]
Given parameters $\mu > 0$ and $\alpha\geq 1$,
we will say that a flow $\boldsymbol{\mathit{f}}$ with resistances $\boldsymbol{\mathit{r}} > \mathbf{0}$
is $(\mu,\alpha)$-central
if $\boldsymbol{\mathit{r}} \approx_{\alpha} \boldsymbol{\mathit{r}}(\mu)$. We will also call its corresponding slacks $\ss$ and
resistances $\boldsymbol{\mathit{r}}$ $(\mu,\alpha)$-central.
\end{definition}

Given a $\mu$-central flow $\boldsymbol{\mathit{f}}$
and some step size $\delta > 0$, the standard (Newton) step
to obtain an approximately $\mu/(1+\delta)$-central flow $\boldsymbol{\mathit{f}}' = \boldsymbol{\mathit{f}} + \boldsymbol{\mathit{\widetilde{f}}}$
is given by
\begin{align*}
\boldsymbol{\mathit{\widetilde{f}}} =
&
-\frac{\delta}{\mu} \frac{\boldsymbol{\mathit{c}}}{\boldsymbol{\mathit{r}}} + \frac{\delta}{\mu} \boldsymbol{\mathit{R}}^{-1}\boldsymbol{\mathit{B}}\boldsymbol{\mathit{L}}^+ \boldsymbol{\mathit{B}}^\top \frac{\boldsymbol{\mathit{c}}}{\boldsymbol{\mathit{r}}}\\
& =
\delta \frac{\frac{1}{\ss^+} - \frac{1}{\ss^-}}{\boldsymbol{\mathit{r}}}
- \delta \boldsymbol{\mathit{R}}^{-1}\boldsymbol{\mathit{B}}\boldsymbol{\mathit{L}}^+ \boldsymbol{\mathit{B}}^\top \frac{\frac{1}{\ss^+} - \frac{1}{\ss^-}}{\boldsymbol{\mathit{r}}}\\
& =
\delta \cdot g(\ss)
- \delta \boldsymbol{\mathit{R}}^{-1}\boldsymbol{\mathit{B}}\boldsymbol{\mathit{L}}^+ \boldsymbol{\mathit{B}}^\top g(\ss)
\end{align*}
where $\boldsymbol{\mathit{r}} = \frac{1}{(\ss^+)^2} + \frac{1}{(\ss^-)^2}$ and
we have denoted $g(\ss) = \frac{\frac{1}{\ss^+} - \frac{1}{\ss^-}}{\boldsymbol{\mathit{r}}}$.

\begin{fact}
Using known scaling arguments, can assume that costs and capacities
are bounded by $\mathrm{poly}(m)$, while only incurring an extra logarithmic dependence in the largest network parameter~\cite{gabow1983scaling}.
\end{fact}

We also use the fact that the resistances in the interior point
method are never too large, which is proved in
Appendix~\ref{sec:aux}.
\begin{fact}
For any $\mu\in(1/\mathrm{poly}(m),\mathrm{poly}(m))$, we have
$\left\|\boldsymbol{\mathit{r}}(\mu)\right\|_\infty \leq m^{\tO{\log m}}$.
\end{fact}

\subsection{Making progress with approximate electrical flows}

The following lemma shows that we can make $k$
steps of the interior point method by
computing $O(k^4)$ $(1+O(k^{-6}))$-\emph{approximate} electrical flows.
The proof is essentially the same as in~\cite{gao2021fully}, but we provide it for
completeness in Appendix~\ref{sec:proof_lem_approx_central}.

\begin{lemma}
Let $\boldsymbol{\mathit{f}}^1,\dots,\boldsymbol{\mathit{f}}^{T+1}$ be flows with
slacks $\ss^t$ and resistances $\boldsymbol{\mathit{r}}^t$ for $t\in[T+1]$,
where $T = \frac{k}{\epsilon_{\mathrm{step}}}$ for some $k\leq \sqrt{m}/10$
and $\epsilon_{\mathrm{step}} = 10^{-5}k^{-3}$, %
such that
\begin{itemize}
\item $\boldsymbol{\mathit{f}}^1$ is $(\mu,1+\epsilon_{\mathrm{solve}}/8)$-central for $\epsilon_{\mathrm{solve}} = 10^{-5} k^{-3}$ %
\item {For all $t\in[T]$ and $e\in E$,
$f_e^{t+1} = \begin{cases}
f_e(\mu) + \epsilon_{\mathrm{step}} \sum\limits_{i=1}^{t} \widetilde{f}_e^i & \text{if $\exists i\in[t]:\widetilde{f}_e^{i} \neq 0$}\\
f_e^1 & \text{otherwise}
\end{cases}$, where
\[
\boldsymbol{\mathit{\widetilde{f}}}^{*t} = \delta g(\ss^t) - \delta (\boldsymbol{\mathit{R}}^t)^{-1} \boldsymbol{\mathit{B}}\left(\boldsymbol{\mathit{B}}^\top (\boldsymbol{\mathit{R}}^t)^{-1} \boldsymbol{\mathit{B}}\right)^+ \boldsymbol{\mathit{B}}^\top g(\ss^t) \]
for $\delta = \frac{1}{\sqrt{m}}$ and
\[ \left\|\sqrt{\boldsymbol{\mathit{r}}^t}\left(\boldsymbol{\mathit{\widetilde{f}}}^{*t} - \boldsymbol{\mathit{\widetilde{f}}}^{t}\right) \right\|_\infty \leq \varepsilon \]
for $\varepsilon = 10^{-6} k^{-6}$.
}
\end{itemize}
Then, setting $\epsilon_{\mathrm{step}} = \epsilon_{\mathrm{solve}} = 10^{-5} k^{-3}$ and
$\varepsilon = 10^{-6} k^{-6}$
we get that
$\ss^{T+1} \approx_{1.1} \ss\left(\mu/(1+\epsilon_{\mathrm{step}}\delta)^{k\epsilon_{\mathrm{step}}^{-1}}\right)$.
\label{lem:approx_central}
\end{lemma}
From now and for the rest of Section~\ref{sec:ipm}
we fix the values of $\epsilon_{\mathrm{step}}, \epsilon_{\mathrm{solve}}, \varepsilon$ based on this lemma.
Using this lemma together with the following recentering procedure also used in~\cite{gao2021fully}, we can
exactly compute a $\left({\mu}/{(1+\epsilon_{\mathrm{step}}/\sqrt{m})^{k\epsilon_{\mathrm{step}}^{-1}}}\right)$-central flow.
\begin{lemma}
Given a flow $\boldsymbol{\mathit{f}}$ with slacks $\ss$
such that $\ss\approx_{1.1} \ss(\mu)$ for some $\mu > 0$,
we can compute $\boldsymbol{\mathit{f}}(\mu)$ in $\tO{m}$.
\label{lem:recenter}
\end{lemma}

\subsection{The \textsc{Locator} data structure}
\label{sec:locator_def}

From the previous lemma it becomes obvious that the only thing left is to maintain
in sublinear time an approximation to
\[ \delta g(\ss^t) - \delta (\boldsymbol{\mathit{R}}^t)^{-1} \boldsymbol{\mathit{B}}(\boldsymbol{\mathit{B}}^\top (\boldsymbol{\mathit{R}}^t)^{-1} \boldsymbol{\mathit{B}})^+ \boldsymbol{\mathit{B}}^\top g(\ss^t)\,. \]
for $\delta = 1 / \sqrt{m}$.
This is the job of the $(\alpha,\beta,\varepsilon)$-\textsc{Locator}
data structure, which computes all the entries of this vector that have magnitude $\geq \varepsilon$.
We note that the guarantees of this data structure
are similar to the ones in~\cite{gao2021fully}, but our locator requires
an extra parameter $\alpha$ which is a measure of how much resistances
can deviate before a full recomputation has to be made.

\begin{definition}[$(\alpha,\beta,\varepsilon)$-\textsc{Locator}]
An $(\alpha,\beta,\varepsilon)$-\textsc{Locator} is a data structure that maintains valid slacks $\ss$
and resistances $\boldsymbol{\mathit{r}}$, and can support the following operations against oblivious
adversaries with high probability:
\begin{itemize}
\item{$\textsc{Initialize}(\boldsymbol{\mathit{f}})$:
Set $\ss^+ = \boldsymbol{\mathit{u}}-\boldsymbol{\mathit{f}}$, $\ss^-=\boldsymbol{\mathit{f}}$,
$\boldsymbol{\mathit{r}} = \frac{1}{(\ss^+)^2} + \frac{1}{(\ss^-)^2}$.
}
\item{$\textsc{Update}(e,\boldsymbol{\mathit{f}})$:
Set $s_e^+ = u_e-f_e$, $s_e^-=f_e$,
$r_e = \frac{1}{(s_e^+)^2} + \frac{1}{(s_e^-)^2}$.
Works under the condition
that
\[ r_e^{\max} / \alpha \leq r_e \leq \alpha \cdot r_e^{\min}\,, \]
where $r_e^{\max}$ and $r_e^{\min}$ are the maximum and minimum
resistance values that edge $e$ has had since the last call to
$\textsc{BatchUpdate}$.}
\item{$\textsc{BatchUpdate}(Z,\boldsymbol{\mathit{f}})$:
Set $s_e^+ = u_e - f_e, s_e^- = f_e, r_e = \frac{1}{(s_e^+)^2} + \frac{1}{(s_e^-)^2}$ for all $e \in Z$.

}
\item{$\textsc{Solve}()$:
Let
\begin{align}
\boldsymbol{\mathit{\widetilde{f}}}^* = \delta g(\ss) - \delta \boldsymbol{\mathit{R}}^{-1} \boldsymbol{\mathit{B}}(\boldsymbol{\mathit{B}}^\top \boldsymbol{\mathit{R}}^{-1} \boldsymbol{\mathit{B}})^+ \boldsymbol{\mathit{B}}^\top g(\ss)\,,
\label{def:ele}
\end{align}
where $\delta = \frac{1}{\sqrt{m}}$.
Returns an edge set $Z$ of size $\tO{\varepsilon^{-2}}$ that with high probability contains
all $e$ such that $\sqrt{r_e} \left|\widetilde{f}_e^*\right| \geq \varepsilon$.
}
\end{itemize}
The data structure works as long as
the total number of calls to
$\textsc{Update}$, plus the sum of $|Z|$ for all
calls to $\textsc{BatchUpdate}$ is $O(\beta m)$.
\label{def:locator}
\end{definition}

In Section~\ref{sec:locator} we will prove the following lemma, which constructs an
$(\alpha,\beta,\varepsilon)$-\textsc{Locator} and outlines its runtime guarantees:
\begin{lemma}[Efficient $(\alpha,\beta,\varepsilon)$-\textsc{Locator}]
For any graph $G(V,E)$ and
parameters $\alpha \geq 1$, $\beta \in(0,1)$, $\varepsilon \geq \tOm{\beta^{-2} m^{-1/2}}$,
and
$\widehat{\eps} \in \left(\tOm{\beta^{-2} m^{-1/2}},\varepsilon\right)$,
there exists an $(\alpha,\beta,\varepsilon)$-\textsc{Locator}
for $G$ with the following runtimes per operation:
\begin{itemize}
\item {$\textsc{Initialize}(\boldsymbol{\mathit{f}})$:
$\tO{m \cdot \left(\widehat{\eps}^{-4} \beta^{-8}
+ \widehat{\eps}^{-2} \varepsilon^{-2} \alpha^2 \beta^{-4}\right)}$.}
\item{$\textsc{Update}(e,\boldsymbol{\mathit{f}})$:
$\tO{m \cdot \frac{\widehat{\eps} \alpha^{1/2}}{\varepsilon^{3}} +
\widehat{\eps}^{-4} \varepsilon^{-2} \beta^{-8} +
\widehat{\eps}^{-2} \varepsilon^{-4} \alpha^2 \beta^{-6}}$ amortized.
}
\item{$\textsc{BatchUpdate}(Z,\boldsymbol{\mathit{f}})$:
$\tO{m \cdot \frac{1}{\varepsilon^2} + |Z|\cdot \frac{1}{\varepsilon^2 \beta^2} }$.
}
\item{$\textsc{Solve}()$:
$\tO{\beta m \cdot \frac{1}{\varepsilon^2}}$.
}
\end{itemize}
\label{lem:locator}
\end{lemma}

Note that even though a $\textsc{Locator}$ computes a set that contains all $\varepsilon$-congested edges, it does not return the actual flow values.
The reason for that is that it only works against oblivious adversaries, and allowing (randomized) flow values to affect future updates
constitutes an adaptive adversary. As in~\cite{gao2021fully}, we resolve this by sanitizing the outputs through a different data structure
called $\textsc{Checker}$, which computes the flow values and works against semi-adaptive adversaries. As
the definition and implementation of $\textsc{Checker}$ is
orthogonal to our contribution and also does not affect
the final runtime, we defer the discussion
to Appendix~\ref{sec:checker}. To simplify the presentation in this section,
we instead define the following
idealized version of it, called $\textsc{PerfectChecker}$.

\begin{definition}[$\varepsilon$-\textsc{PerfectChecker}]
For any error $\varepsilon > 0$, an $\varepsilon$-$\textsc{PerfectChecker}$ is an oracle that
given a graph $G(V,E)$, slacks $\ss$, resistances $\boldsymbol{\mathit{r}}$, supports the following
operations:
\begin{itemize}
\item{\textsc{Update}$(e,\boldsymbol{\mathit{f}})$: Set $s_e^+ = u_e - f_e$, $s_e^- = f_e$,
$r_e = \frac{1}{(s_e^+)^2}
+ \frac{1}{(s_e^-)^2}$.
}
\item{\textsc{Check}$(e)$:
Compute a flow value $\widetilde{f}_e$ such that $\sqrt{r_e} \left|\widetilde{f}_e - \widetilde{f}_e^*\right| \leq \varepsilon$, where
\[ \boldsymbol{\mathit{\widetilde{f}}}^* = \delta g(\ss) - \delta \boldsymbol{\mathit{R}}^{-1} \boldsymbol{\mathit{B}} (\boldsymbol{\mathit{B}}^\top \boldsymbol{\mathit{R}}^{-1} \boldsymbol{\mathit{B}})^+ \boldsymbol{\mathit{B}}^\top g(\ss) \,, \]
with $\delta = 1/\sqrt{m}$.
If $\sqrt{r_e} \left|\widetilde{f}_e\right| < \varepsilon / 2$ return $0$, otherwise return $\widetilde{f}_e$.

}
\end{itemize}
\label{def:perfect_checker}
\end{definition}

\subsection{The minimum cost flow algorithm}
Now, we will show how the data structure defined in
Section~\ref{sec:locator_def} can be used to make progress along the central path.
The main lemma that analyzes the performance of the minimum cost flow
algorithm given access to an $(\alpha,\beta,\varepsilon)$-\textsc{Locator} is Lemma~\ref{lem:mincostflow}.
Also, the skeleton of the algorithm is described in Algorithm~\ref{alg:main}.

\begin{algorithm} %
\begin{algorithmic}[1]
\caption{Minimum Cost Flow}
\Procedure{\textsc{MinCostFlow}}{$G,\boldsymbol{\mathit{c}},\boldsymbol{\mathit{d}},\boldsymbol{\mathit{u}}$}
\State $\boldsymbol{\mathit{\bar{f}}}, \mu = \textsc{Initialize}(G,\boldsymbol{\mathit{c}}, \boldsymbol{\mathit{d}},\boldsymbol{\mathit{u}})$ \Comment{Lemma~\ref{lem:init}. $\boldsymbol{\mathit{\bar{f}}}$ is $\mu$-central at all times.}
\State $i = 0$
\While {$\mu \geq m^{-10}$}
	\If {$i$ is a multiple of $\lfloor\epsilon_{\mathrm{solve}} \sqrt{\beta m} / k\rfloor$} \Comment{Re-initialize when $|C|$ exceeds $O(\beta m)$.}
		\State $\mathcal{L} = \textsc{Locator}.\textsc{Initialize}(\boldsymbol{\mathit{\bar{f}}})$ with error $\varepsilon/2$
	\EndIf
	\If {$i$ is a multiple of $\lfloor\epsilon_{\mathrm{solve}} \sqrt{\beta_{\textsc{Checker}} m} / k\rfloor$}
		\State $\mathcal{C}^i = \textsc{Checker}.\textsc{Initialize}(\boldsymbol{\mathit{\bar{f}}}, \varepsilon, \beta_{\textsc{Checker}})$ for $i\in[k\epsilon_{\mathrm{step}}^{-1}]$
	\EndIf
	\If {$i$ is a multiple of $\lfloor 0.5\alpha^{1/4} / k - 1\rfloor$} \Comment{Update important edges when $\mathcal{L}.\boldsymbol{\mathit{r}}^0$ expires}
		\State $\mathcal{L}.\textsc{BatchUpdate}(\emptyset)$ \label{line:batchupdate1}
	\EndIf
	\State $\boldsymbol{\mathit{\bar{f}}}, \mu = \textsc{MultiStep}(\boldsymbol{\mathit{\bar{f}}}, \mu)$
	\If {$i$ is a multiple of $\widehat{T}$}
		\State $Z = \emptyset$
		\For {$e \in E$}
			\State $\bar{s}_e^+ = u_e - \bar{f}_e$, $\bar{s}_e^- = \bar{f}_e$
			\If {$\bar{s}_e^+ \not\approx_{\epsilon_{\mathrm{solve}} / 16} \mathcal{L}.s_e^+$ or $\bar{s}_e^- \not\approx_{\epsilon_{\mathrm{solve}} / 16} \mathcal{L}.s_e^-$}
				\State $\mathcal{C}^i.\textsc{Update}(e, \boldsymbol{\mathit{\bar{f}}})$ for $i\in[k\epsilon_{\mathrm{step}}^{-1}]$
				\State $Z = Z\cup\{e\}$
			\EndIf
		\EndFor
		\State $\mathcal{L}.\textsc{BatchUpdate}(Z, \boldsymbol{\mathit{\bar{f}}})$ \label{line:batchupdate2}
	\Else
		\For {$e \in E$}
			\State $\bar{s}_e^+ = u_e - \bar{f}_e$, $\bar{s}_e^- = \bar{f}_e$
			\If {$\bar{s}_e^+ \not\approx_{\epsilon_{\mathrm{solve}} / 8} \mathcal{L}.s_e^+$ or $\bar{s}_e^- \not\approx_{\epsilon_{\mathrm{solve}} / 8} \mathcal{L}.s_e^-$}
				\State $\mathcal{C}^i.\textsc{Update}(e, \boldsymbol{\mathit{\bar{f}}})$ for $i\in[k\epsilon_{\mathrm{step}}^{-1}]$
				\State $\mathcal{L}.\textsc{Update}(e, \boldsymbol{\mathit{\bar{f}}})$
			\EndIf
		\EndFor
	\EndIf
	\State $i = i + 1$
\EndWhile
\State \Return $\textsc{Round}(G,\boldsymbol{\mathit{c}},\boldsymbol{\mathit{d}},\boldsymbol{\mathit{u}},\boldsymbol{\mathit{\bar{f}}})$ \Comment{Lemma~\ref{lem:rounding}}
\EndProcedure
\label{alg:main}
\end{algorithmic}
\end{algorithm}

\begin{lemma}[\textsc{MinCostFlow}]
Let $\mathcal{L}$ be an $(\alpha,\beta,\varepsilon)-\textsc{Locator}$,
$\boldsymbol{\mathit{f}}$ be a $\mu$-central flow
where $\mu = \mathrm{poly}(m)$, and $k\in\left[m^{1/316}\right]$,
$\beta \geq \tOm{k^3 / m^{1/4}}$,
$\widehat{T} \in\left[\tO{m^{1/2} / k}\right]$
be some parameters.
There is an algorithm that with high probability computes a $\mu'$-central flow $\boldsymbol{\mathit{f}}'$, where
$\mu' \leq m^{-10}$. Additionally, the algorithm runs in time $\tO{m^{3/2} / k}$, plus
\begin{itemize}
\item $\tO{k^3 \beta^{-1/2}}$ calls to $\mathcal{L}.\textsc{Initialize}$,
\item $\tO{m^{1/2} k^3}$ calls to $\mathcal{L}.\textsc{Solve}$,
\item $\tO{m^{1/2} \left(k^6\widehat{T} + k^{15}\right)}$ calls to $\mathcal{L}.\textsc{Update}$,
\item $\tO{m^{1/2} \alpha^{-1/4}}$ calls to $\mathcal{L}.\textsc{BatchUpdate}(\emptyset)$, and
\item {
$\tO{m^{1/2} k^{-1} \widehat{T}^{-1}}$ calls to
$\mathcal{L}.\textsc{BatchUpdate}(Z,\boldsymbol{\mathit{\bar{f}}})$ for some $Z\neq \emptyset,\boldsymbol{\mathit{\bar{f}}}$. Additionally,
the sum of $|Z|$ over all such calls is $\tO{mk^3\beta^{1/2}}$.}
\end{itemize}
\label{lem:mincostflow}
\end{lemma}
The proof appears in Appendix~\ref{proof_lem_mincostflow}.
Its main ingredient is the following lemma, which easily follows from Lemma~\ref{lem:approx_central}
and essentially shows how $k$ steps of the interior point method can be performed in
$\tO{m}$ instead of $\tO{m k}$. Its proof appears in Appendix~\ref{proof_lem_multistep}.

\begin{lemma}[\textsc{MultiStep}]
Let $k\in\{1,\dots,\sqrt{m}/10\}$.
We are given $\boldsymbol{\mathit{f}}(\mu)$, an $(\alpha,\beta,\varepsilon/2)$-\textsc{Locator} $\mathcal{L}$,
and an $\varepsilon$-\textsc{PerfectChecker} $\mathcal{C}$,
such that
\begin{itemize}
\item{
$\mathcal{L}.\boldsymbol{\mathit{r}} = \mathcal{C}.\boldsymbol{\mathit{r}}$ are $(\mu,1+\epsilon_{\mathrm{solve}}/8)$-central resistances, and
}
\item{
$\mathcal{L}.\boldsymbol{\mathit{r}}^0$ are
$(\mu^0,1+\epsilon_{\mathrm{solve}}/8)$-central resistances, where
$\mu^0 \leq \mu \cdot (1 + \epsilon_{\mathrm{step}}/\sqrt{m})^{\widehat{T}}$ and $\widehat{T} = (0.5\alpha^{1/4} - k)\epsilon_{\mathrm{step}}^{-1}$.
Additionally, for any resistances $\boldsymbol{\mathit{\widehat{r}}}$ that $\mathcal{L}$ had at any point
since the last call to $\mathcal{L}.\textsc{BatchUpdate}$,
$\boldsymbol{\mathit{\widehat{r}}}$ are $(\hat{\mu}, 1.1)$-central for some $\hat{\mu}\in[\mu,\mu^0]$.
}
\end{itemize}

Then, %
there is an algorithm that with high probability computes $\boldsymbol{\mathit{f}}(\mu')$, %
where $\mu' = \mu / (1+\epsilon_{\mathrm{step}}/\sqrt{m})^{k\epsilon_{\mathrm{step}}^{-1}}$. The algorithm runs in time $\tO{m}$,
plus $O(k^{16})$ calls to $\mathcal{L}.\textsc{Update}$, $O(k^4)$ calls to $\mathcal{L}.\textsc{Solve}$,
and $O(k^{16})$ calls to $\mathcal{C}.\textsc{Update}$ and $\mathcal{C}.\textsc{Check}$.
Additionally, $\mathcal{L}.\boldsymbol{\mathit{r}}$ and $\mathcal{C}$ are unmodified.
\label{lem:multistep}
\end{lemma}

\begin{algorithm} %
\begin{algorithmic}[1]
\caption{MultiStep}
\Procedure{\textsc{MultiStep}}{$\boldsymbol{\mathit{f}}, \mu$}
\Comment{Makes equivalent progress to $k$ interior point method steps}
\State $\boldsymbol{\mathit{\widehat{r}}} = \mathcal{L}.\boldsymbol{\mathit{r}}$ \Comment{Save resistances to restore later}
\For{$i=1,\dots, k\epsilon_{\mathrm{step}}^{-1}$}
	\State $Z = \mathcal{L}.\textsc{Solve}()$
	\For {$e\in Z$} \Comment{$Z$: Set of edges with sufficiently changed flow}
		\State $\widetilde{f}_e = \mathcal{C}^i.\textsc{Check}(e)$
		\If {$\widetilde{f}_e \neq 0$}
			\State $f_e = f_e + \epsilon_{\mathrm{step}} \widetilde{f}_e$
			\State $\mathcal{L}.\textsc{Update}(e, \boldsymbol{\mathit{f}})$
			\State $\mathcal{C}^j.\textsc{TemporaryUpdate}(e, \boldsymbol{\mathit{f}})$ for $j \in \left[i+1,k\epsilon_{\mathrm{step}}^{-1}\right]$
		\EndIf
	\EndFor
\EndFor
\State $\mu = \mu / (1 + \epsilon_{\mathrm{step}}/\sqrt{m})^{k\epsilon_{\mathrm{step}}^{-1}}$
\State $\boldsymbol{\mathit{f}} = \textsc{Recenter}(\boldsymbol{\mathit{f}}, \mu)$ \Comment{Lemma~\ref{lem:recenter}}
\For {$e\in E$}
	\If {$\mathcal{L}.r_e \neq \widehat{r}_e$}
		\State $\mathcal{L}.\textsc{Update}(e,\boldsymbol{\mathit{\widehat{r}}})$ \Comment{Return $\textsc{Locator}$ resistances to their original state}
	\EndIf
\EndFor
\State Call $\mathcal{C}^i.\textsc{Rollback}()$ to undo all $\textsc{TemporaryUpdate}$s for all $\mathcal{C}^i$
\State \Return $\boldsymbol{\mathit{f}}, \mu$
\EndProcedure
\label{alg:multistep}
\end{algorithmic}
\end{algorithm}

\subsection{Proof of Theorem~\ref{thm:main}}

\paragraph{Correctness.}
First of all, we apply capacity and cost scaling~\cite{gabow1983scaling} to make sure that
$\left\|\boldsymbol{\mathit{c}}\right\|_\infty, \left\|\boldsymbol{\mathit{u}}\right\|_\infty = \mathrm{poly}(m)$. These incur
an extra factor of $\log(U+W)$ in the runtime.

We first get an initial solution to the interior point method by using the following lemma:
\begin{lemma}[Interior point method initialization, Appendix A in~\cite{axiotis2020circulation}]
Given a min cost flow instance $\mathcal{I} = \left(G(V,E),\boldsymbol{\mathit{c}},\boldsymbol{\mathit{d}},\boldsymbol{\mathit{u}}\right)$,
there exists an algorithm that
runs in time $O(m)$ and produces a new min cost flow instance
$\mathcal{I}'=\left(G'(V',E'),\boldsymbol{\mathit{c}}',\boldsymbol{\mathit{d}}',\boldsymbol{\mathit{u}}'\right)$,
where $|V'| = O(|V|)$ and $|E'|=O(|E|)$,
as well as a flow $\boldsymbol{\mathit{f}}$ such that
\begin{itemize}
\item{$\boldsymbol{\mathit{f}}$ is $\mu$-central for $\mathcal{I}'$ for some
$\mu = \Theta\left(\left\|\boldsymbol{\mathit{c}}\right\|_2\right)$}
\item{Given an optimal solution for $\mathcal{I}'$,
an optimal minimum cost flow solution for $\mathcal{I}$
can be computed in $O(m)$}
\end{itemize}
\label{lem:init}
\end{lemma}

Therefore we now have a $\mathrm{poly}(m)$-central solution for an instance $\mathcal{I}$.
We can now apply Lemma~\ref{lem:mincostflow} to get a $\mu'$-central solution with $\mu'\leq m^{-10}$.
Then we can apply the following lemma to round the solution, which follows from Lemma 5.4 in~\cite{axiotis2020circulation}.
\begin{lemma}[Interior point method rounding]
Given a min cost flow instance $\mathcal{I}$ and a $\mu$-central flow $\boldsymbol{\mathit{f}}$
for $\mu \leq m^{-10}$, there is an algorithm that runs in time $\widetilde{O}(m)$ and returns an optimal integral flow.
\label{lem:rounding}
\end{lemma}
By Lemma~\ref{lem:init}, this solution can be turned into an exact solution for the original
instance.
As Lemma~\ref{lem:mincostflow} succeeds with high probability, the whole algorithm does too.

\paragraph{Runtime.}

To determine the final runtime, we analyze each operation in Algorithm~\ref{alg:main} separately.

The \textsc{Initialize} (Lemma~\ref{lem:init}) and \textsc{Round} (Lemma~\ref{lem:rounding})
operations take time $\tO{m}$.
Now, the runtime of Lemma~\ref{lem:mincostflow} is $\tO{m^{3/2} / k}$ plus the runtime incurred because of
calls to the locator $\mathcal{L}$.
We will use the runtimes per operation from Lemma~\ref{lem:locator}.

{\bf $\mathcal{L}$.\textsc{Solve}}: This operation is run $\tO{m^{1/2} k^3}$ times, and each of these costs
$\tO{\frac{\beta m}{\varepsilon^2}}
= \tO{m k^{12} \beta}$. Therefore in total
$\tO{m^{3/2} k^{15} \beta}$.

We pick $\beta$ by
$m^{3/2} k^{15} \beta \leq m^{3/2} /k$ as
$\beta = k^{-16}$, so the runtime is
$\tO{m^{3/2} / k}$. Note that this satisfies the constraint
$\beta \geq \tOm{k^3 / m^{1/4}}$ as long as $k\leq \tOm{m^{1/76}}$.

{\bf $\mathcal{L}$.\textsc{BatchUpdate}}: This is run
$\tO{m^{1/2} / \alpha^{1/4}}$ times with empty arguments,
each of which takes time
$\tO{m /\varepsilon^2} = \tO{m k^{12}}$.
The total runtime because of these is
$\tO{m^{3/2} k^{12} \alpha^{-1/4}}$.
As we
need this to be below $\tO{m^{3/2} / k}$, we set
$\alpha = k^{52}$.

This operation is also run
$\tO{m^{1/2} k^{-1} \widehat{T}^{-1}}
$
times with
some non-empty argument $Z$, each of which takes time
$\tO{m/\varepsilon^2 + |Z|/(\varepsilon^2\beta^2)} = \tO{m k^{12} + k^{44}|Z|}$.
As by Lemma~\ref{lem:mincostflow} the total sum
of $|Z|$ %
over all calls is $\tO{mk^3 \beta^{1/2}} = \tO{mk^{-5}}$,
we get a runtime of
\[ \tO{m^{1/2} k^{-1} \widehat{T}^{-1} \cdot mk^{12} + k^{44} \cdot mk^{-5}}
= \tO{m^{3/2} k^{11} \widehat{T}^{-1} + mk^{39}}\,.\]
In order to set the first term to be at most $\tO{m^{3/2} / k}$, we set
$\widehat{T} = k^{12}$.

Therefore the total runtime of this operation is
$\tO{m^{3/2} / k + m k^{39}}$.

{\bf $\mathcal{L}$.\textsc{Update}}:
This is run
$\tO{m^{1/2} \left(k^6 \widehat{T} + k^{15}\right)}
=\tO{m^{1/2} k^{18}}$
times
and the amortized cost per operation is
\begin{align*}
& \tO{m \cdot \frac{\widehat{\eps} \alpha^{1/2}}{\varepsilon^{3}} +
\widehat{\eps}^{-4} \varepsilon^{-2} \beta^{-8} +
\widehat{\eps}^{-2} \varepsilon^{-4} \alpha^2 \beta^{-6}}\\
& =\tO{m \cdot k^{44} \widehat{\eps} + k^{140} \widehat{\eps}^{-4} +
k^{224} \widehat{\eps}^{-2}}\,,
\end{align*}
so in total
\[ m^{3/2} k^{62} \widehat{\eps} + m^{1/2} k^{158} \widehat{\eps}^{-4} + m^{1/2} k^{242} \widehat{\eps}^{-2}\,. \]
As we need the first term to be $\tO{m^{3/2} / k}$, we set
$\widehat{\eps} = k^{-63}$.
Therefore the total runtime is
\[ \tO{m^{3/2} / k + m^{1/2} k^{410} + m^{1/2} k^{368}} = \tO{m^{3/2} / k + m^{1/2} k^{410}}\,. \]

{\bf $\mathcal{L}$.\textsc{Initialize}}: This is run
$\tO{k^{3} \beta^{-1/2}} = k^{11}$ times
in total, and the runtime for each run is
\[ \tO{m \cdot \left(\widehat{\eps}^{-4} \beta^{-8} +
\widehat{\eps}^{-2} \varepsilon^{-2} \alpha^2 \beta^{-4}}\right)
= \tO{m \cdot \left(k^{380} +
k^{306}\right)}
= \tO{m\cdot k^{380}} \,,\]
so in total $\tO{m k^{380}}$.

Therefore, for the whole algorithm, we get
$\tO{m^{3/2} / k + m^{1/2} k^{410} + mk^{380}}$
which after balancing gives $k=m^{1/762}$.

\section{Preliminaries}
\subsection{General}
For any $k\in \mathbb{Z}_{\geq 0}$, we denote
$[k] = \{1,2,\dots,k\}$.

For any $x\in\mathbb{R}^n$ and $C\subseteq [n]$, we
denote by $x_C\in\mathbb{R}^{|C|}$ the restriction of $x$
to the entries in $C$.
Similarly for a matrix $A$, subset of rows $C$, and subset of columns $F$,
we denote by $A_{CF}$ the submatrix that results
from keeping the rows in $C$ and the columns in $F$.

When not ambiguous, we use the corresponding uppercase symbol
to a symbol denoting a vector,
to denote the diagonal matrix of that vector. In other
words $\boldsymbol{\mathit{R}} = \mathrm{diag}(\boldsymbol{\mathit{r}})$.

Given $x,y\in\mathbb{R}$ and $\alpha\in\mathbb{R}_{\geq 1}$,
we say that $x$ and $y$ $\alpha$-approximate each other
and write $x \approx_{\alpha} y$
if
$\alpha^{-1} \leq x/y \leq \alpha$.

When a graph $G(V,E)$ is clear from context, we will
use $n = |V|$ and $m=|E|$.
We use $\boldsymbol{\mathit{B}}\in\mathbb{R}^{m\times n}$ to denote the
edge-vertex incidence matrix of $G$ and, given some resistances
$\boldsymbol{\mathit{r}}$, we use $\boldsymbol{\mathit{L}}\in\mathbb{R}^{n\times n}$
to denote the Laplacian $\boldsymbol{\mathit{L}} = \boldsymbol{\mathit{B}}^\top \boldsymbol{\mathit{R}}^{-1} \boldsymbol{\mathit{B}}$.

\subsection{Minimum cost flow}

Given a directed graph $G(V,E)$ with costs $\boldsymbol{\mathit{c}}\in\mathbb{R}^m$, demands $\boldsymbol{\mathit{d}}\in\mathbb{R}^n$, and capacities
$\boldsymbol{\mathit{u}}\in\mathbb{R}_{> 0}^m$,
the \emph{minimum cost flow problem} asks to compute a flow $\boldsymbol{\mathit{f}}$ that
\begin{itemize}
\item{routes the demand: $\boldsymbol{\mathit{B}}^\top \boldsymbol{\mathit{f}} = \boldsymbol{\mathit{d}}$}
\item{respects the capacities: $\mathbf{0} \leq \boldsymbol{\mathit{f}} \leq \boldsymbol{\mathit{u}}$, and}
\item{minimizes the cost: $\langle \boldsymbol{\mathit{c}}, \boldsymbol{\mathit{f}}\rangle$.}
\end{itemize}
We will denote such an instance of the minimum cost flow by the tuple
$(G(V,E),\boldsymbol{\mathit{c}},\boldsymbol{\mathit{d}},\boldsymbol{\mathit{u}})$.

\subsection{Electrical flows}
\begin{definition}[Energy of a potential embedding]
Consider a graph $G(V,E)$ with resistances $\boldsymbol{\mathit{r}}$
and a potential embedding $\boldsymbol{\mathit{\phi}}$. We denote
by
\[ E_{\boldsymbol{\mathit{r}}}(\boldsymbol{\mathit{\phi}}) = \sum\limits_{e\in E} \frac{(B\boldsymbol{\mathit{\phi}})_e^2}{r_e} \]
the total energy of the electrical flow induced by $\boldsymbol{\mathit{\phi}}$. %
\end{definition}
\begin{definition}[Energy to route a demand]
Consider a graph $G(V,E)$ with resistances $\boldsymbol{\mathit{r}}$, and a vector $\boldsymbol{\mathit{d}}\in\mathbb{R}^n$. %
If $\boldsymbol{\mathit{d}}$ is a demand ($\langle 1,d\rangle = 0$), we denote
by
\[ \mathcal{E}_{\boldsymbol{\mathit{r}}}(\boldsymbol{\mathit{d}}) = \underset{\boldsymbol{\mathit{\phi}}:\, B^\top \frac{B\boldsymbol{\mathit{\phi}}}{\boldsymbol{\mathit{r}}} = \boldsymbol{\mathit{d}}}{\min}\, E_{\boldsymbol{\mathit{r}}}(\boldsymbol{\mathit{\phi}}) \]
the total energy %
that is required to route the demand $\boldsymbol{\mathit{d}}$ with resistances $\boldsymbol{\mathit{r}}$.
We extend this definition for a $\boldsymbol{\mathit{d}}$ that is not a demand vector ($\langle\mathbf{1}, \boldsymbol{\mathit{d}}\rangle \neq 0$), as
$\mathcal{E}_{\boldsymbol{\mathit{r}}}(\boldsymbol{\mathit{d}}) = \mathcal{E}_{\boldsymbol{\mathit{r}}}\left(\boldsymbol{\mathit{d}} - \frac{\langle \mathbf{1}, \boldsymbol{\mathit{d}}\rangle}{n} \cdot \mathbf{1}\right)$.
\end{definition}
\begin{fact}[Energy statements]
Consider a graph $G(V,E)$ with resistances $\boldsymbol{\mathit{r}}$.
\begin{itemize}
\item {For any $x,y\in \mathbb{R}^n$, we have $\sqrt{\mathcal{E}_{\boldsymbol{\mathit{r}}}(x+y)}
\leq \sqrt{\mathcal{E}_{\boldsymbol{\mathit{r}}}(x)}
+ \sqrt{\mathcal{E}_{\boldsymbol{\mathit{r}}}(y)}
$.}
\item{
and a vector $\boldsymbol{\mathit{d}}\in\mathbb{R}^n$.
Then,
\[ \underset{\phi: E_{\boldsymbol{\mathit{r}}}(\boldsymbol{\mathit{\phi}}) \leq 1}{\max}\, \langle \boldsymbol{\mathit{d}}, \boldsymbol{\mathit{\phi}}\rangle =
\sqrt{\mathcal{E}_{\boldsymbol{\mathit{r}}}(\boldsymbol{\mathit{d}})}\,. \]}
\item{
For any resistances $\boldsymbol{\mathit{r}}' \leq \alpha \boldsymbol{\mathit{r}}$ for some $\alpha \geq 1$
and any $\boldsymbol{\mathit{d}}\in\mathbb{R}^n$, we have
$\mathcal{E}_{\boldsymbol{\mathit{r}}'}(\boldsymbol{\mathit{d}}) \leq \alpha \cdot \mathcal{E}_{\boldsymbol{\mathit{r}}}(\boldsymbol{\mathit{d}})$
}
\end{itemize}
\end{fact}
\begin{proof}
We let $\boldsymbol{\mathit{L}} = \boldsymbol{\mathit{B}}^\top \boldsymbol{\mathit{R}}^{-1} \boldsymbol{\mathit{B}}$ be the Laplacian of $G$ with resistances $\boldsymbol{\mathit{r}}$.
For the first one,
we have
$\sqrt{\mathcal{E}_{\boldsymbol{\mathit{r}}}(x+y)}
= \left\|x+y\right\|_{\boldsymbol{\mathit{L}}^+}
\leq \left\|x\right\|_{\boldsymbol{\mathit{L}}^+}+\left\|y\right\|_{\boldsymbol{\mathit{L}}^+}
= \sqrt{\mathcal{E}_{\boldsymbol{\mathit{r}}}(x)}
+ \sqrt{\mathcal{E}_{\boldsymbol{\mathit{r}}}(y)}
$,
where we used the triangle inequality.

The second one
follows since
$E_{\boldsymbol{\mathit{r}}}(\boldsymbol{\mathit{\phi}}) = \left\|\boldsymbol{\mathit{\phi}}\right\|_{\boldsymbol{\mathit{L}}}^2$
and $\mathcal{E}_{\boldsymbol{\mathit{r}}}(\boldsymbol{\mathit{d}}) = \left\|\boldsymbol{\mathit{d}}\right\|_{\boldsymbol{\mathit{L}}^+}^2$
and the norms
$\left\|\cdot\right\|_{\boldsymbol{\mathit{L}}}$ and
$\left\|\cdot\right\|_{\boldsymbol{\mathit{L}}^+}$ are dual.

For the third one, we note that
$\left(\boldsymbol{\mathit{B}}^\top \boldsymbol{\mathit{R}}'^{-1} \boldsymbol{\mathit{B}}\right)^+ \preceq \alpha \cdot \left(\boldsymbol{\mathit{B}}^\top \boldsymbol{\mathit{R}}^{-1} \boldsymbol{\mathit{B}}\right)^+$,
and so
$\mathcal{E}_{\boldsymbol{\mathit{r}}'}(\boldsymbol{\mathit{d}})
 = \left\|\boldsymbol{\mathit{d}}\right\|_{(\boldsymbol{\mathit{B}}^\top \boldsymbol{\mathit{R}}'^{-1} \boldsymbol{\mathit{B}})^+}^2
 \leq \alpha \left\|\boldsymbol{\mathit{d}}\right\|_{(\boldsymbol{\mathit{B}}^\top \boldsymbol{\mathit{R}}^{-1} \boldsymbol{\mathit{B}})^+}^2
 = \alpha \cdot \mathcal{E}_{\boldsymbol{\mathit{r}}}(\boldsymbol{\mathit{d}})$.
\end{proof}

\begin{definition}[Effective resistances]
Consider a graph $G(V,E)$ with resistances $\boldsymbol{\mathit{r}}$
and any pair of vertices $u,v\in V$. We denote by
$R_{eff}(u,v)$ the energy required to route $1$ unit of flow
from $u$ to $v$,
i.e. $R_{eff}(u,v) = \mathcal{E}_{\boldsymbol{\mathit{r}}}\left(\mathbf{1}_u - \mathbf{1}_v\right)$.
This is called the \emph{effective resistance between $u$ and $v$}.
We extend this definition to work with vertex subsets $X,Y\subseteq V$, such that
$R_{eff}(X,Y)$ is the effective resistance between the vertices $x,y$ that result from
contracting $X$ and $Y$. When used as an argument of $R_{eff}$,
an edge $e=(u,v)\in E$ is treated as the vertex subset $\{u,v\}$.
\end{definition}

\begin{definition}[Schur complement]
Given a graph $G(V,E)$ with Laplacian $\boldsymbol{\mathit{L}}\in\mathbb{R}^{n\times n}$ and a vertex subset $C\subseteq V$
as well as $F = V\backslash C$,
$SC(G,C) := \boldsymbol{\mathit{L}}_{CC} - \boldsymbol{\mathit{L}}_{CF}\boldsymbol{\mathit{L}}_{FF}^{-1}\boldsymbol{\mathit{L}}_{FC}$ (or just $SC$) is called
the \emph{Schur complement of $G$ onto $C$}.
\end{definition}

\begin{fact}[Cholesky factorization]
Given a matrix $\boldsymbol{\mathit{L}}\in\mathbb{R}^{n\times n}$, a subset $C\subseteq[n]$,
and $F = [n] \backslash C$, we have
\begin{align*}
\boldsymbol{\mathit{L}}^+ =
\begin{pmatrix}
\boldsymbol{\mathit{I}} & -\boldsymbol{\mathit{L}}_{FF}^{-1} \boldsymbol{\mathit{L}}_{FC}\\
\mathbf{0} & \boldsymbol{\mathit{I}}
\end{pmatrix}
\begin{pmatrix}
\boldsymbol{\mathit{L}}_{FF}^{-1} & \mathbf{0}\\
\mathbf{0} & SC(\boldsymbol{\mathit{L}},C)^+
\end{pmatrix}
\begin{pmatrix}
\boldsymbol{\mathit{I}} & \mathbf{0}\\
-\boldsymbol{\mathit{L}}_{CF} \boldsymbol{\mathit{L}}_{FF}^{-1} & \boldsymbol{\mathit{I}}
\end{pmatrix}\,.
\end{align*}
\end{fact}

\subsection{Random walks}

\begin{definition}[Hitting probabilities]
Consider a graph $G(V,E)$ with resistances $\boldsymbol{\mathit{r}}$. For any
$u,v\in V$, $C\subseteq V$, we denote
by $p_v^{C,\boldsymbol{\mathit{r}}}(u)$ the probability that for random walk that
starts from $u$ and uses edges with probability proportional to $\frac{1}{\boldsymbol{\mathit{r}}}$,
the first vertex of $C$ to be visited is $v$.
When not ambiguous, we will use the notation $p_v^C(u)$.
\label{def:hitting_probabilities}
\end{definition}

\begin{definition}[Demand projection]
Consider a graph $G(V,E)$ and a demand vector $\boldsymbol{\mathit{d}}$.
For any $v\in V$, $C\subseteq V$, we
define $\pi_v^{C,\boldsymbol{\mathit{r}}}(\boldsymbol{\mathit{d}}) = \sum\limits_{u\in V} d_u p_v^{C,\boldsymbol{\mathit{r}}}(u)$ and call
the resulting vector $\boldsymbol{\mathit{\pi}}^{C,\boldsymbol{\mathit{r}}}(\boldsymbol{\mathit{d}})\in\mathbb{R}^{n}$ the
\emph{demand projection of $\boldsymbol{\mathit{d}}$ onto $C$}.
When not ambiguous, we will use the notation $\boldsymbol{\mathit{\pi}}^C(\boldsymbol{\mathit{d}})$.
\label{def:demand_projection}
\end{definition}

For convenience, when we write $\boldsymbol{\mathit{\pi}}^C(\boldsymbol{\mathit{d}})$ we might also
refer to the restriction of this vector to $C$. This will be
clear from the context, and, as $\pi_v^C(\boldsymbol{\mathit{d}}) = 0$ for any $v\notin C$,
no ambiguity is introduced.

\begin{fact}[\cite{gao2021fully}]
Given a graph $G(V,E)$ with Laplacian $\boldsymbol{\mathit{L}}$,
a vertex subset $C\subseteq V$, and
$\boldsymbol{\mathit{d}}\in\mathbb{R}^n$, we have
\[ \boldsymbol{\mathit{\pi}}^C(\boldsymbol{\mathit{d}}) = \boldsymbol{\mathit{d}}_{C} - \boldsymbol{\mathit{L}}_{CF}\boldsymbol{\mathit{L}}_{FF}^{-1} \boldsymbol{\mathit{d}}_{F}\\
\,. \]
Additionally,
\[ \left[\boldsymbol{\mathit{L}}^+\boldsymbol{\mathit{d}}\right]_C =
 SC^+\boldsymbol{\mathit{\pi}}^C(\boldsymbol{\mathit{d}}) \,,\]
 where $SC$ is the Schur complement of $G$ onto $C$.
 \label{fact:demand_proj}
\end{fact}

An important property of the demand projection is that the energy required to route it is upper bounded by the energy required to route the original demand. The proof can be found in Section~\ref{sec:aux}.
\begin{lemma}\label{lem:sc-energy-bd}
Let $\boldsymbol{\mathit{d}}$ be a demand vector,  let $\boldsymbol{\mathit{r}}$ be resistances, and let $C \subseteq V$ be a subset of vertices.
Then
\[
\mathcal{E}_{\boldsymbol{\mathit{r}}}\left( \boldsymbol{\mathit{\pi}}^C(\boldsymbol{\mathit{d}}) \right) \leq \mathcal{E}_{\boldsymbol{\mathit{r}}}\left( \boldsymbol{\mathit{d}} \right) \,.
\]
\end{lemma}

The following lemma relates
the effective resistance between a vertex and a vertex set,
to the energy to route a particular demand, based on a demand
projection.
\begin{lemma}[Effective resistance and hitting probabilities]
Given a graph $G(V,E)$ with resistances $\boldsymbol{\mathit{r}}$, any vertex set $A\subseteq V$ and vertex $u\in V\backslash A$, we have
$R_{eff}(u,A) = \mathcal{E}_{\boldsymbol{\mathit{r}}}(\mathbf{1}_u - \boldsymbol{\mathit{\pi}}^A(\mathbf{1}_u))$.
\label{lem:effective_hitting}
\end{lemma}
\begin{proof}
Let $\boldsymbol{\mathit{L}}$ be the Laplacian of $G$ with resistances $\boldsymbol{\mathit{r}}$ and $F = V\backslash A$.
We first prove that
\[ \mathcal{E}_{\boldsymbol{\mathit{r}}}(\mathbf{1}_u - \boldsymbol{\mathit{\pi}}^A(\mathbf{1}_u)) = \mathbf{1}_u^\top \boldsymbol{\mathit{L}}_{FF}^{-1}\mathbf{1}_u \,.\]
This is because
\begin{align*}
& \mathcal{E}_{\boldsymbol{\mathit{r}}}(\mathbf{1}_u - \boldsymbol{\mathit{\pi}}^A(\mathbf{1}_u)) \\
& = \langle \mathbf{1}_u - \boldsymbol{\mathit{\pi}}^A(\mathbf{1}_u), \boldsymbol{\mathit{L}}^+ (\mathbf{1}_u - \boldsymbol{\mathit{\pi}}^A(\mathbf{1}_u)) \rangle\\
& = \bigg\langle \mathbf{1}_u - \begin{pmatrix}\mathbf{0} & \mathbf{0}\\-\boldsymbol{\mathit{L}}_{AF} \boldsymbol{\mathit{L}}_{FF}^{-1} & \boldsymbol{\mathit{I}}\end{pmatrix} \mathbf{1}_u,
\boldsymbol{\mathit{L}}^+ \left(\mathbf{1}_u - \begin{pmatrix}\mathbf{0} & \mathbf{0} \\ -\boldsymbol{\mathit{L}}_{AF}\boldsymbol{\mathit{L}}_{FF}^{-1} & \boldsymbol{\mathit{I}} \end{pmatrix} \mathbf{1}_u\right) \bigg\rangle\\
& = \bigg\langle\begin{pmatrix}\boldsymbol{\mathit{I}} & \mathbf{0}\\-\boldsymbol{\mathit{L}}_{AF}\boldsymbol{\mathit{L}}_{FF}^{-1} & \boldsymbol{\mathit{I}}\end{pmatrix} \left(\mathbf{1}_u + \begin{pmatrix}\mathbf{0}\\\boldsymbol{\mathit{L}}_{AF} \boldsymbol{\mathit{L}}_{FF}^{-1} \mathbf{1}_u\end{pmatrix}\right),\\
&\quad\quad\,\begin{pmatrix}\boldsymbol{\mathit{L}}_{FF}^{-1} & \mathbf{0} \\ \mathbf{0} & SC(\boldsymbol{\mathit{L}},A)^+\end{pmatrix}
\begin{pmatrix}\boldsymbol{\mathit{I}} & \mathbf{0}\\-\boldsymbol{\mathit{L}}_{AF}\boldsymbol{\mathit{L}}_{FF}^{-1} & \boldsymbol{\mathit{I}}\end{pmatrix} \left(\mathbf{1}_u + \begin{pmatrix}\mathbf{0}\\\boldsymbol{\mathit{L}}_{AF}\boldsymbol{\mathit{L}}_{FF}^{-1} \mathbf{1}_u \end{pmatrix}\right) \bigg\rangle\\
& = \left\langle\mathbf{1}_u,
\begin{pmatrix}\boldsymbol{\mathit{L}}_{FF}^{-1} & \mathbf{0} \\ \mathbf{0} & SC(\boldsymbol{\mathit{L}},A)^+\end{pmatrix} \mathbf{1}_u\right\rangle\\
&=\langle \mathbf{1}_u, \boldsymbol{\mathit{L}}_{FF}^{-1} \mathbf{1}_u\rangle \,.
\end{align*}
On the other hand, note that $R_{eff}(u,A) = {\widehat{R}}_{eff}(u,{\mathit{\widehat{a}}})$, where ${\widehat{R}}$ are the effective resistances in a graph $\widehat{G}$ that results after contracting
$A$ to a new vertex ${\mathit{\widehat{a}}}$. It is easy to see that the Laplacian of this new graph is
\begin{align*}
\widehat{\boldsymbol{\mathit{L}}} = \begin{pmatrix}
\boldsymbol{\mathit{L}}_{FF} & \boldsymbol{\mathit{L}}_{FA} \mathbf{1} \\
\mathbf{1}^\top \boldsymbol{\mathit{L}}_{AF} & \mathbf{1}^\top \boldsymbol{\mathit{L}}_{FA} \mathbf{1}
\end{pmatrix}\,.
\end{align*}
We look at the system
$\widehat{\boldsymbol{\mathit{L}}} \begin{pmatrix}x\\a\end{pmatrix} = \mathbf{1}_u - \mathbf{1}_{{\mathit{\widehat{a}}}}$, where $a$ is a scalar. The solution is given by
\begin{align*}
& \boldsymbol{\mathit{x}} = \boldsymbol{\mathit{L}}_{FF}^{-1} \left(\mathbf{1}_u - a\cdot \boldsymbol{\mathit{L}}_{FA} \mathbf{1}\right)\,.
\end{align*}
However, as $\mathbf{1}\in \ker(\widehat{\boldsymbol{\mathit{L}}})$ by the fact that it is a Laplacian, we can assume that $a=0$ by shifting.
Therefore $\boldsymbol{\mathit{x}} = \boldsymbol{\mathit{L}}_{FF}^{-1} \mathbf{1}_u$, and so we can conclude that
\begin{align*}
R_{eff}(u,A)
& = \langle\mathbf{1}_u - \mathbf{1}_{{\mathit{\widehat{a}}}}, \widehat{\boldsymbol{\mathit{L}}}^+ (\mathbf{1}_u - \mathbf{1}_{{\mathit{\widehat{a}}}})\rangle\\
& = \langle\mathbf{1}_u, \boldsymbol{\mathit{L}}_{FF}^{-1} \mathbf{1}_u\rangle \,.
\end{align*}
So we have proved that $R_{eff}(u,A) = \mathcal{E}_{\boldsymbol{\mathit{r}}}(\mathbf{1}_u - \boldsymbol{\mathit{\pi}}^A(\mathbf{1}_u))$ and we are done.
\end{proof}

Finally, the following lemma relates
the effective resistance between a vertex and a vertex set, to
the effective resistance between vertices.
\begin{lemma}
Given a graph $G(V,E)$ with resistances $\boldsymbol{\mathit{r}}$, any vertex set $A\subseteq V$ and vertex $u\in V\backslash A$, we have
\[ \frac{1}{|A|} \cdot \underset{v\in A}{\min}\, R_{eff}(u,v)
\leq R_{eff}(u,A) \leq \underset{v\in A}{\min}\, R_{eff}(u,v)\,.\]
\label{lem:multi_effective_resistance}
\end{lemma}
\begin{proof}
Let $\boldsymbol{\mathit{L}}$ be the Laplacian of $G$ with resistances $\boldsymbol{\mathit{r}}$, and note that $R_{eff}(u,v) = \left\|\boldsymbol{\mathit{L}}^{+/2} (\mathbf{1}_u - \mathbf{1}_v)\right\|_2^2$
and, by Lemma~\ref{lem:effective_hitting},
$R_{eff}(u,A) = \left\|\boldsymbol{\mathit{L}}^{+/2} (\mathbf{1}_u - \boldsymbol{\mathit{\pi}}^A(\mathbf{1}_u))\right\|_2^2$.
Expanding the latter, we have
\begin{align*}
R_{eff}(u,A)
& =
\left\|\sum\limits_{v\in A} \pi_v^A(\mathbf{1}_u)\cdot\boldsymbol{\mathit{L}}^{+/2} (\mathbf{1}_u -  \mathbf{1}_v)\right\|_2^2\\
& = \sum\limits_{v\in A}\left(\pi_v^A(\mathbf{1}_u)\right)^2 \left\| \boldsymbol{\mathit{L}}^{+/2} (\mathbf{1}_u - \mathbf{1}_v)\right\|_2^2
+ \sum\limits_{v\in A}
 \sum\limits_{\substack{v'\in A\\v'\neq v}} \pi_v^A(\mathbf{1}_u) \pi_{v'}^A(\mathbf{1}_u) \langle \mathbf{1}_u - \mathbf{1}_{v'}, \boldsymbol{\mathit{L}}^{+} (\mathbf{1}_u - \mathbf{1}_v)\rangle\,.
\end{align*}
Now, note that $\pi_v^A(\mathbf{1}_u),\pi_{v'}^A(\mathbf{1}_u) \geq 0$. Additionally, let
$\boldsymbol{\mathit{\phi}} = \boldsymbol{\mathit{L}}^{+} (\mathbf{1}_u - \mathbf{1}_v)$ be the potential embedding that induces a $1$-unit electrical flow from $v$ to $u$.
As the potential embedding stretches between $\phi_v$ and $\phi_u$, we have that
$\phi_{v'} \leq \phi_u$, so $\langle \mathbf{1}_u - \mathbf{1}_{v'}, \boldsymbol{\mathit{L}}^+ (\mathbf{1}_u - \mathbf{1}_v)\rangle = \phi_u- \phi_{v'} \geq 0$. Therefore,
\begin{align*}
R_{eff}(u,A)
& \geq
\sum\limits_{v\in A}\left(\pi_v^A(\mathbf{1}_u)\right)^2 \left\| \boldsymbol{\mathit{L}}^{+/2} (\mathbf{1}_u - \mathbf{1}_v)\right\|_2^2\\
& \geq \frac{1}{|A|} \sum\limits_{v\in A} \pi_v^A(\mathbf{1}_u) \cdot R_{eff}(u,v)\\
& \geq \frac{1}{|A|}\underset{v\in A}{\min}\, R_{eff}(u,v)\,,
\end{align*}
where we used the Cauchy-Schwarz inequality and the fact that $\sum\limits_{v\in A} \pi_v^A(\mathbf{1}_u) = 1$.
\end{proof}

redpajama_set_name: RedPajamaArXiv