The replacement paths problem for directed graphs is to find for given nodes s and t and every edge e on the shortest path between them, the shortest path between s and t which avoids e. For unweighted directed graphs on n vertices, the best known algorithm runtime was \tilde{O}(n^{2.5}) by Roditty and Zwick. For graphs with integer weights in {-M,...,M}, Weimann and Yuster recently showed that one can use fast matrix multiplication and solve the problem in O(Mn^{2.584}) time, a runtime which would be O(Mn^{2.33}) if the exponent ωof matrix multiplication is 2.
We improve both of these algorithms. Our new algorithm also relies on fast matrix multiplication and runs in O(M n^ω polylog(n)) time if ω>2 and O(n^{2+\eps}) for any \eps>0 if ω=2. Our result shows that, at least for small integer weights, the replacement paths problem in directed graphs may be easier than the related all pairs shortest paths problem in directed graphs, as the current best runtime for the latter is Ω(n^{2.5}) time even if ω=2.
One of the classical line of work in graph algorithms has been the Replacement Path Problem: given a graph $G$, $s$ and $t$, find shortest paths from $s$ to $t$ avoiding each edge $e$ on the shortest path from $s$ to $t$. These paths are called replacement paths in literature. For an undirected and unweighted graph, (Malik, Mittal, and Gupta, Operation Research Letters, 1989) and (Hershberger and Suri, FOCS 2001) designed an algorithm that solves the replacement path problem in $\tilde O(m+n)$ time. It is natural to ask whether we can generalize the replacement path problem: {\em can we find a…
Let G=(V,E)(|V|=n and |E|=m) be an undirected graph with positive edge weights. Let P_{G}(s, t) be a shortest s-t path in G. Let l be the number of edges in P_{G}(s, t). The \emph{Edge Replacement Path} problem is to compute a shortest s-t path in G\{e}, for every edge e in P_{G}(s, t). The \emph{Node Replacement Path} problem is to compute a shortest s-t path in G\{v}, for every vertex v in P_{G}(s, t). In this paper we present an O(T_{SPT}(G)+m+l^2) time and O(m+l^2) space algorithm for both the problems. Where, T_{SPT}(G) is the asymptotic time to compute a single source shortest path tree …
We study a natural online variant of the replacement path problem. The \textit{replacement path problem} asks to find for a given graph $G = (V,E)$, two designated vertices $s,t\in V$ and a shortest $s$-$t$ path $P$ in $G$, a \textit{replacement path} $P_e$ for every edge $e$ on the path $P$. The replacement path $P_e$ is simply a shortest $s$-$t$ path in the graph, which avoids the \textit{failed} edge $e$. We adapt this problem to deal with the natural scenario, that the edge which failed is not known at the time of solution implementation. Instead, our problem assumes that the identity of t…
Matrix $M$ is {\em $k$-concise} if the finite entries of each column of $M$ consist of $k$ or less intervals of identical numbers. We give an $O(n+m)$-time algorithm to compute the row minima of any $O(1)$-concise $n\times m$ matrix. Our algorithm yields the first $O(n+m)$-time reductions from the replacement-paths problem on an $n$-node $m$-edge undirected graph (respectively, directed acyclic graph) to the single-source shortest-paths problem on an $O(n)$-node $O(m)$-edge undirected graph (respectively, directed acyclic graph). That is, we prove that the replacement-paths problem is no harde…
In the Single Source Replacement Paths (SSRP) problem we are given a graph $G = (V, E)$, and a shortest paths tree $\widehat{K}$ rooted at a node $s$, and the goal is to output for every node $t \in V$ and for every edge $e$ in $\widehat{K}$ the length of the shortest path from $s$ to $t$ avoiding $e$. We present an $\tilde{O}(m\sqrt{n} + n^2)$ time randomized combinatorial algorithm for unweighted directed graphs. Previously such a bound was known in the directed case only for the seemingly easier problem of replacement path where both the source and the target nodes are fixed. Our new upper …
In this work we derandomize two central results in graph algorithms, replacement paths and distance sensitivity oracles (DSOs) matching in both cases the running time of the randomized algorithms. For the replacement paths problem, let G = (V,E) be a directed unweighted graph with n vertices and m edges and let P be a shortest path from s to t in G. The {\sl replacement paths} problem is to find for every edge e \in P the shortest path from s to t avoiding e. Roditty and Zwick [ICALP 2005] obtained a randomized algorithm with running time of ~O(m \sqrt{n}). Here we provide the first determinis…
In a graph $G$ with a source $s$, we design a distance oracle that can answer the following query: Query$(s,t,e)$ -- find the length of shortest path from a fixed source $s$ to any destination vertex $t$ while avoiding any edge $e$. We design a deterministic algorithm that builds such an oracle in $\tilde{O}(m\sqrt n)$ time. Our oracle uses $\tilde{O}(n\sqrt n)$ space and can answer queries in $\tilde{O}(1)$ time. Our oracle is an improvement of the work of Bilò et al. (ESA 2021) in the preprocessing time, which constructs the first deterministic oracle for this problem in $\tilde{O}(m\sqrt n+…
One of the most basic graph problems, All-Pairs Shortest Paths (APSP) is known to be solvable in $n^{3-o(1)}$ time, and it is widely open whether it has an $O(n^{3-ε})$ time algorithm for $ε> 0$. To better understand APSP, one often strives to obtain subcubic time algorithms for structured instances of APSP and problems equivalent to it, such as the Min-Plus matrix product. A natural structured version of Min-Plus product is Monotone Min-Plus product which has been studied in the context of the Batch Range Mode [SODA'20] and Dynamic Range Mode [ICALP'20] problems. This paper improves the known…
This paper considers a natural fault-tolerant shortest paths problem: for some constant integer $f$, given a directed weighted graph with no negative cycles and two fixed vertices $s$ and $t$, compute (either explicitly or implicitly) for every tuple of $f$ edges, the distance from $s$ to $t$ if these edges fail. We call this problem $f$-Fault Replacement Paths ($f$FRP). We first present an $\tilde{O}(n^3)$ time algorithm for $2$FRP in $n$-vertex directed graphs with arbitrary edge weights and no negative cycles. As $2$FRP is a generalization of the well-studied Replacement Paths problem (RP) …
Harvard University(哈佛大学);Dartmouth College(达特茅斯学院);Hasso Plattner Institute(哈索·普拉特纳研究院);Karlsruhe Institute of Technology(卡尔斯鲁厄理工学院);Boston University(波士顿大学);Yale University(耶鲁大学)
When a network is prone to failures, it is very expensive to compute the shortest paths every time from the scratch. Distance sensitivity oracle provides this privilege to find the new shortest paths faster and with lower cost by once pre-computing an oracle in advance. Although several efficient solutions are proposed in the literature to support the single failure, few efforts are done to devise an efficient method regarding the case of multiple failures. In this paper, we present a novel distance sensitivity oracle based on Markov Tensor Theory \cite{golnari2017markov} to support replacemen…
In the online bipartite matching problem with replacements, all the vertices on one side of the bipartition are given, and the vertices on the other side arrive one by one with all their incident edges. The goal is to maintain a maximum matching while minimizing the number of changes (replacements) to the matching. We show that the greedy algorithm that always takes the shortest augmenting path from the newly inserted vertex (denoted the SAP protocol) uses at most amortized $O(\log^2 n)$ replacements per insertion, where $n$ is the total number of vertices inserted. This is the first analysis …
Adaptive Replacement Cache (ARC) and CLOCK with Adaptive Replacement (CAR) are state-of-the- art "adaptive" cache replacement algorithms invented to improve on the shortcomings of classical cache replacement policies such as LRU, LFU and CLOCK. By separating out items that have been accessed only once and items that have been accessed more frequently, both ARC and CAR are able to control the harmful effect of single-access items flooding the cache and pushing out more frequently accessed items. Both ARC and CAR have been shown to outperform their classical and popular counterparts in practice.…
In the k-Path problem, the input is a directed graph $G$ and an integer $k\geq 1$, and the goal is to decide whether there is a simple directed path in $G$ with exactly $k$ vertices. We give a deterministic algorithm for k-Path with time complexity $O^*(2.554^k)$. This improves the previously best deterministic algorithm for this problem of Zehavi [ESA 2015] whose time complexity is $O^*(2.597^k)$. The technique used by our algorithm can also be used to obtain faster deterministic algorithms for k-Tree, r-Dimensional k-Matching, Graph Motif, and Partial Cover.
We introduce a novel framework of graph modifications specific to interval graphs. We study interdiction problems with respect to these graph modifications. Given a list of original intervals, each interval has a replacement interval such that either the replacement contains the original, or the original contains the replacement. The interdictor is allowed to replace up to $k$ original intervals with their replacements. Using this framework we also study the contrary of interdiction problems which we call assistance problems. We study these problems for the independence number, the clique numb…
In this paper, we propose a useful replacement for quicksort-style utility functions. The replacement is called Symmetry Partition Sort, which has essentially the same principle as Proportion Extend Sort. The maximal difference between them is that the new algorithm always places already partially sorted inputs (used as a basis for the proportional extension) on both ends when entering the partition routine. This is advantageous to speeding up the partition routine. The library function based on the new algorithm is more attractive than Psort which is a library function introduced in 2004. Its…
We present a new heuristic point-to-point routing algorithm based on contraction hierarchies (CH). Given an epsilon >= 0, we can prove that the length of the path computed by our algorithm is at most (1+epsilon) times the length of the optimal (shortest) path. CH is based on node contraction: removing nodes from a network and adding shortcut edges to preserve shortest path distances. Our algorithm tries to avoid shortcuts even when a replacement path is epsilon times longer.
Tree-width and path-width are widely successful concepts. Many NP-hard problems have efficient solutions when restricted to graphs of bounded tree-width. Many efficient algorithms are based on a tree decomposition. Sometimes the more restricted path decomposition is required. The bottleneck for such algorithms is often the computation of the width and a corresponding tree or path decomposition. For graphs with $n$ vertices and tree-width or path-width $k$, the standard linear time algorithm to compute these decompositions dates back to 1996. Its running time is linear in $n$ and exponential in…
Fine-grained reductions have established equivalences between many core problems with $\tilde{O}(n^3)$-time algorithms on $n$-node weighted graphs, such as Shortest Cycle, All-Pairs Shortest Paths (APSP), Radius, Replacement Paths, Second Shortest Paths, and so on. These problems also have $\tilde{O}(mn)$-time algorithms on $m$-edge $n$-node weighted graphs, and such algorithms have wider applicability. Are these $mn$ bounds optimal when $m \ll n^2$? Starting from the hypothesis that the minimum weight $(2\ell+1)$-Clique problem in edge weighted graphs requires $n^{2\ell+1-o(1)}$ time, we prov…
The problem of $d$-Path Vertex Cover, $d$-PVC lies in determining a subset $F$ of vertices of a given graph $G=(V,E)$ such that $G \setminus F$ does not contain a path on $d$ vertices. The paths we aim to cover need not to be induced. It is known that the $d$-PVC problem is NP-complete for any $d \ge 2$. When parameterized by the size of the solution $k$, 5-PVC has direct trivial algorithm with $\mathcal{O}(5^kn^{\mathcal{O}(1)})$ running time and, since $d$-PVC is a special case of $d$-Hitting Set, an algorithm running in $\mathcal{O}(4.0755^kn^{\mathcal{O}(1)})$ time is known. In this paper …
In a directed graph $G=(V,E)$ with a capacity on every edge, a \emph{bottleneck path} (or \emph{widest path}) between two vertices is a path maximizing the minimum capacity of edges in the path. For the single-source all-destination version of this problem in directed graphs, the previous best algorithm runs in $O(m+n\log n)$ ($m=|E|$ and $n=|V|$) time, by Dijkstra search with Fibonacci heap [Fredman and Tarjan 1987]. We improve this time bound to $O(m\sqrt{\log n})$, thus it is the first algorithm which breaks the time bound of classic Fibonacci heap when $m=o(n\sqrt{\log n})$. It is a Las-Ve…
In this paper, we present an improved algorithm for the All Pairs Non-decreasing Paths (APNP) problem on weighted simple digraphs, which has running time $\tilde{O}(n^{\frac{3 + ω}{2}}) = \tilde{O}(n^{2.686})$. Here $n$ is the number of vertices, and $ω< 2.373$ is the exponent of time complexity of fast matrix multiplication [Williams 2012, Le Gall 2014]. This matches the current best upper bound for $(\max, \min)$-matrix product [Duan, Pettie 2009] which is reducible to APNP. Thus, further improvement for APNP will imply a faster algorithm for $(\max, \min)$-matrix product. The previous best …
A directed graph $G$ is called a pumpkin if $G$ is a union of induced paths with a common start vertex $s$ and a common end vertex $t$, and the internal vertices of every two paths are disjoint. We give an algorithm that given a directed graph $G$ and an integer $k$, decides whether a pumpkin can be obtained from $G$ by deleting at most $k$ vertices. The algorithm runs in $O^*(2^k)$ time.
We show how to combine two techniques for efficiently computing shortest paths in directed planar graphs. The first is the linear-time shortest-path algorithm of Henzinger, Klein, Subramanian, and Rao [STOC'94]. The second is Fakcharoenphol and Rao's algorithm [FOCS'01] for emulating Dijkstra's algorithm on the dense distance graph (DDG). A DDG is defined for a decomposition of a planar graph $G$ into regions of at most $r$ vertices each, for some parameter $r < n$. The vertex set of the DDG is the set of $Θ(n/\sqrt r)$ vertices of $G$ that belong to more than one region (boundary vertices). T…
In this work we revisit the fundamental Single-Source Shortest Paths (SSSP) problem with possibly negative edge weights. A recent breakthrough result by Bernstein, Nanongkai and Wulff-Nilsen established a near-linear $O(m \log^8(n) \log(W))$-time algorithm for negative-weight SSSP, where $W$ is an upper bound on the magnitude of the smallest negative-weight edge. In this work we improve the running time to $O(m \log^2(n) \log(nW) \log\log n)$, which is an improvement by nearly six log-factors. Some of these log-factors are easy to shave (e.g. replacing the priority queue used in Dijkstra's alg…
We propose an exact algorithm for solving the longest simple path problem between two given vertices in undirected weighted graphs. By using graph partitioning and dynamic programming, we obtain an algorithm that is significantly faster than other state-of-the-art methods. This enables us to solve instances that were previously unsolved and solve hard instances significantly faster. Lastly, we present a scalable parallelization which yields the first efficient parallel algorithm for the problem.
We present an algorithm for the k shortest simple path problem on weighted directed graphs (kSSP) that is based on Eppstein's algorithm for a similar problem in which paths are allowed to contain cycles. In contrast to most other algorithms for kSSP, ours is not based on Yen's algorithm and does not solve replacement path problems. Its worst-case running time is on par with state-of-the-art algorithms for kSSP. Using our algorithm, one may find O(m) simple paths with a single shortest path tree computation and O(n + m) additional time per path in well-behaved cases, where n is the number of no…
Finding central nodes is a fundamental problem in network analysis. Betweenness centrality is a well-known measure which quantifies the importance of a node based on the fraction of shortest paths going though it. Due to the dynamic nature of many today's networks, algorithms that quickly update centrality scores have become a necessity. For betweenness, several dynamic algorithms have been proposed over the years, targeting different update types (incremental- and decremental-only, fully-dynamic). In this paper we introduce a new dynamic algorithm for updating betweenness centrality after an …
We propose an optimal algorithm for solving the longest path problem in undirected weighted graphs. By using graph partitioning and dynamic programming, we obtain an algorithm that is significantly faster than other state-of-the-art methods. This enables us to solve instances that have previously been unsolved.
Interprocedural analysis is at the heart of numerous applications in programming languages, such as alias analysis, constant propagation, etc. Recursive state machines (RSMs) are standard models for interprocedural analysis. We consider a general framework with RSMs where the transitions are labeled from a semiring, and path properties are algebraic with semiring operations. RSMs with algebraic path properties can model interprocedural dataflow analysis problems, the shortest path problem, the most probable path problem, etc. The traditional algorithms for interprocedural analysis focus on pat…
We present the first $m\,\text{polylog}(n)$ work, $\text{polylog}(n)$ time algorithm in the PRAM model that computes $(1+ε)$-approximate single-source shortest paths on weighted, undirected graphs. This improves upon the breakthrough result of Cohen~[JACM'00] that achieves $O(m^{1+ε_0})$ work and $\text{polylog}(n)$ time. While most previous approaches, including Cohen's, leveraged the power of hopsets, our algorithm builds upon the recent developments in \emph{continuous optimization}, studying the shortest path problem from the lens of the closely-related \emph{minimum transshipment} problem…
We present a new fully dynamic algorithm for maintaining betweenness centrality (BC) of vertices in a directed graph $G=(V,E)$ with positive edge weights. BC is a widely used parameter in the analysis of large complex networks. We achieve an amortized $O((ν^*)^2 \log^2 n)$ time per update, where $n = |V| $ and $ν^*$ bounds the number of distinct edges that lie on shortest paths through any single vertex. This result improves on the amortized bound for fully dynamic BC in [Pontecorvi-Ramachandran2015] by a logarithmic factor. Our algorithm uses new data structures and techniques that are extens…
The parametric shortest path problem is to find the shortest paths in graph where the edge costs are of the form w_ij+lambda where each w_ij is constant and lambda is a parameter that varies. The problem is to find shortest path trees for every possible value of lambda. The minimum-balance problem is to find a ``weighting'' of the vertices so that adjusting the edge costs by the vertex weights yields a graph in which, for every cut, the minimum weight of any edge crossing the cut in one direction equals the minimum weight of any edge crossing the cut in the other direction. The paper presents …
We give an $\tilde{O}(n^{7/5} \log (nC))$-time algorithm to compute a minimum-cost maximum cardinality matching (optimal matching) in $K_h$-minor free graphs with $h=O(1)$ and integer edge weights having magnitude at most $C$. This improves upon the $\tilde{O}(n^{10/7}\log{C})$ algorithm of Cohen et al. [SODA 2017] and the $O(n^{3/2}\log (nC))$ algorithm of Gabow and Tarjan [SIAM J. Comput. 1989]. For a graph with $m$ edges and $n$ vertices, the well-known Hungarian Algorithm computes a shortest augmenting path in each phase in $O(m)$ time, yielding an optimal matching in $O(mn)$ time. The Hop…
A long series of recent results and breakthroughs have led to faster and better distributed approximation algorithms for single source shortest paths (SSSP) and related problems in the CONGEST model. The runtime of all these algorithms, however, is $\tildeΩ(\sqrt{n})$, regardless of the network topology, even on nice networks with a (poly)logarithmic network diameter $D$. While this is known to be necessary for some pathological networks, most topologies of interest are arguably not of this type. We give the first distributed approximation algorithms for shortest paths problems that adjust to …
We consider the question of speeding up classic graph algorithms with machine-learned predictions. In this model, algorithms are furnished with extra advice learned from past or similar instances. Given the additional information, we aim to improve upon the traditional worst-case run-time guarantees. Our contributions are the following: (i) We give a faster algorithm for minimum-weight bipartite matching via learned duals, improving the recent result by Dinitz, Im, Lavastida, Moseley and Vassilvitskii (NeurIPS, 2021); (ii) We extend the learned dual approach to the single-source shortest path …
In the decremental $(1+ε)$-approximate Single-Source Shortest Path (SSSP) problem, we are given a graph $G=(V,E)$ with $n = |V|, m = |E|$, undergoing edge deletions, and a distinguished source $s \in V$, and we are asked to process edge deletions efficiently and answer queries for distance estimates $\widetilde{\mathbf{dist}}_G(s,v)$ for each $v \in V$, at any stage, such that $\mathbf{dist}_G(s,v) \leq \widetilde{\mathbf{dist}}_G(s,v) \leq (1+ ε)\mathbf{dist}_G(s,v)$. In the decremental $(1+ε)$-approximate All-Pairs Shortest Path (APSP) problem, we are asked to answer queries for distance est…
Garnero et al. [SIAM J. Discrete Math. 2015, 29(4):1864--1894] recently introduced a framework based on dynamic programming to make applications of the protrusion replacement technique constructive and to obtain explicit upper bounds on the involved constants. They show that for several graph problems, for every boundary size $t$ one can find an explicit set $\mathcal{R}_t$ of representatives. Any subgraph $H$ with a boundary of size $t$ can be replaced with a representative $H' \in \mathcal{R}_t$ such that the effect of this replacement on the optimum can be deduced from $H$ and $H'$ alone. T…
In the 3-path vertex cover problem, the input is an undirected graph $G$ and an integer $k$. The goal is to decide whether there is a set of vertices $S$ of size at most $k$ such that every path with 3 vertices in $G$ contains at least one vertex of $S$. In this paper we give parameterized algorithm for 3-path cover whose time complexity is $O^*(1.713^k)$. Our algorithm is faster than previous algorithms for this problem.