Replacement Paths and k Simple Shortest Paths in Unweighted Directed - - PowerPoint PPT Presentation

replacement paths and k simple shortest paths in
SMART_READER_LITE
LIVE PREVIEW

Replacement Paths and k Simple Shortest Paths in Unweighted Directed - - PowerPoint PPT Presentation

Replacement Paths and k Simple Shortest Paths in Unweighted Directed Graphs Liam Roditty Uri Zwick IIT Madras November 2019 Mithun, Jayasurya (IIT Madras) Replacement Paths November 2019 1 / 32 Introduction and Motivation Suppose that we


slide-1
SLIDE 1

Replacement Paths and k Simple Shortest Paths in Unweighted Directed Graphs

Liam Roditty Uri Zwick

IIT Madras

November 2019

Mithun, Jayasurya (IIT Madras) Replacement Paths November 2019 1 / 32

slide-2
SLIDE 2

Introduction and Motivation

Suppose that we are at a point A and we want to go to another point

  • B. We have some roads that we can travel through. Naturally we

want to reach B via the shortest path

Mithun, Jayasurya (IIT Madras) Replacement Paths November 2019 2 / 32

slide-3
SLIDE 3

Introduction and Motivation

Suppose that we are at a point A and we want to go to another point

  • B. We have some roads that we can travel through. Naturally we

want to reach B via the shortest path This can easily be modeled as a graph problem. Points A and B are vertices and the roads are the edges between the intersections.

Mithun, Jayasurya (IIT Madras) Replacement Paths November 2019 2 / 32

slide-4
SLIDE 4

Introduction and Motivation

Suppose that we are at a point A and we want to go to another point

  • B. We have some roads that we can travel through. Naturally we

want to reach B via the shortest path This can easily be modeled as a graph problem. Points A and B are vertices and the roads are the edges between the intersections.

Mithun, Jayasurya (IIT Madras) Replacement Paths November 2019 2 / 32

slide-5
SLIDE 5

We can find the shortest path using a simple Breadth First Search or using Dijkstra’s algorithm

Mithun, Jayasurya (IIT Madras) Replacement Paths November 2019 3 / 32

slide-6
SLIDE 6

We can find the shortest path using a simple Breadth First Search or using Dijkstra’s algorithm

Mithun, Jayasurya (IIT Madras) Replacement Paths November 2019 3 / 32

slide-7
SLIDE 7

We can find the shortest path using a simple Breadth First Search or using Dijkstra’s algorithm However it could be a rainy day and . . .

Mithun, Jayasurya (IIT Madras) Replacement Paths November 2019 3 / 32

slide-8
SLIDE 8

Mithun, Jayasurya (IIT Madras) Replacement Paths November 2019 4 / 32

slide-9
SLIDE 9

However, we still want to reach our destination. We would also like to find an efficient path.

Mithun, Jayasurya (IIT Madras) Replacement Paths November 2019 4 / 32

slide-10
SLIDE 10

However, we still want to reach our destination. We would also like to find an efficient path. To do this we can simply delete the edge that has failed, and run our BFS or Dijkstras algorithm again

Mithun, Jayasurya (IIT Madras) Replacement Paths November 2019 4 / 32

slide-11
SLIDE 11

Mithun, Jayasurya (IIT Madras) Replacement Paths November 2019 5 / 32

slide-12
SLIDE 12

To be safe we would like to find such ”replacement paths” for every edge in our path.

Mithun, Jayasurya (IIT Madras) Replacement Paths November 2019 5 / 32

slide-13
SLIDE 13

Road Map

1

Definition and Problem statement

2

Previous Results

3

Outline of the Paper

4

Finding Short Detours

5

Finding Long Detours

6

Variations of Replacement Paths Problem

7

k−Shortest Paths Problem and the Reduction

Mithun, Jayasurya (IIT Madras) Replacement Paths November 2019 6 / 32

slide-14
SLIDE 14

Story So Far...

1

Definition and Problem statement

2

Previous Results

3

Outline of the Paper

4

Finding Short Detours

5

Finding Long Detours

6

Variations of Replacement Paths Problem

7

k−Shortest Paths Problem and the Reduction

Mithun, Jayasurya (IIT Madras) Replacement Paths November 2019 7 / 32

slide-15
SLIDE 15

Definition (Replacement Path)

Given a Graph G(V , E) and a path P from s to t, a replacement path for an edge e ∈ P is a path from s to t that avoids e.

Mithun, Jayasurya (IIT Madras) Replacement Paths November 2019 8 / 32

slide-16
SLIDE 16

Definition (Replacement Path)

Given a Graph G(V , E) and a path P from s to t, a replacement path for an edge e ∈ P is a path from s to t that avoids e.

Definition (Replacement Paths Problem)

Given a Graph G and a shortest path P, we are required to find a shortest replacement path for every edge e ∈ P. This is the replacement paths problem.

Mithun, Jayasurya (IIT Madras) Replacement Paths November 2019 8 / 32

slide-17
SLIDE 17

Story So Far...

1

Definition and Problem statement

2

Previous Results

3

Outline of the Paper

4

Finding Short Detours

5

Finding Long Detours

6

Variations of Replacement Paths Problem

7

k−Shortest Paths Problem and the Reduction

Mithun, Jayasurya (IIT Madras) Replacement Paths November 2019 9 / 32

slide-18
SLIDE 18

An O(m + n log n) time algorithm for the Replacement paths problem for undirected graphs was given by Malik.

Mithun, Jayasurya (IIT Madras) Replacement Paths November 2019 10 / 32

slide-19
SLIDE 19

An O(m + n log n) time algorithm for the Replacement paths problem for undirected graphs was given by Malik. Best known algorithm for Replacement paths problem in directed graphs even for unweighted graphs is simply computing a shortest path from s to t, excluding each time a different edge of P. The running time of this algorithm is O(mn + n2 log n).

Mithun, Jayasurya (IIT Madras) Replacement Paths November 2019 10 / 32

slide-20
SLIDE 20

An O(m + n log n) time algorithm for the Replacement paths problem for undirected graphs was given by Malik. Best known algorithm for Replacement paths problem in directed graphs even for unweighted graphs is simply computing a shortest path from s to t, excluding each time a different edge of P. The running time of this algorithm is O(mn + n2 log n). This paper presents an ˜ O(m√n) time algorithm for the Replacement paths problem for unweighted directed graphs.

Mithun, Jayasurya (IIT Madras) Replacement Paths November 2019 10 / 32

slide-21
SLIDE 21

Story So Far...

1

Definition and Problem statement

2

Previous Results

3

Outline of the Paper

4

Finding Short Detours

5

Finding Long Detours

6

Variations of Replacement Paths Problem

7

k−Shortest Paths Problem and the Reduction

Mithun, Jayasurya (IIT Madras) Replacement Paths November 2019 11 / 32

slide-22
SLIDE 22

Consider any shortest replacement path P′ for an edge in the path P. It will be as follows

Mithun, Jayasurya (IIT Madras) Replacement Paths November 2019 12 / 32

slide-23
SLIDE 23

Consider any shortest replacement path P′ for an edge in the path P. It will be as follows

Mithun, Jayasurya (IIT Madras) Replacement Paths November 2019 12 / 32

slide-24
SLIDE 24

Consider any shortest replacement path P′ for an edge in the path P. It will be as follows P′ starts at s and follows P till a vertex u, at this point, it will take a ’detour’ and rejoin the path P at a vertex v.

Mithun, Jayasurya (IIT Madras) Replacement Paths November 2019 12 / 32

slide-25
SLIDE 25

Definition (Detour)

Let P(s, t) be a simple path from s to t. A simple path D(u, v) is a detour

  • f P(s, t) if D(u, v) ∩ P(s, t) = {u, v} and u precedes v on P(s, t).

Mithun, Jayasurya (IIT Madras) Replacement Paths November 2019 13 / 32

slide-26
SLIDE 26

Definition (Detour)

Let P(s, t) be a simple path from s to t. A simple path D(u, v) is a detour

  • f P(s, t) if D(u, v) ∩ P(s, t) = {u, v} and u precedes v on P(s, t).

Definition (Short and Long Detours)

If length of detour is utmost L then it is said to be a short detour. If the length is atleast L then it is said to be a long detour. Here L is a parameter to be chosen later.

Mithun, Jayasurya (IIT Madras) Replacement Paths November 2019 13 / 32

slide-27
SLIDE 27

Outline of Replacement paths Algorithm

Every Replacement path for edge e = (u, v) ∈ P has a detour D(u′, v′) where u’ precedes u and v precedes v’ on P(s,t).

Mithun, Jayasurya (IIT Madras) Replacement Paths November 2019 14 / 32

slide-28
SLIDE 28

Outline of Replacement paths Algorithm

Every Replacement path for edge e = (u, v) ∈ P has a detour D(u′, v′) where u’ precedes u and v precedes v’ on P(s,t). By finding shortest detours D(u′, v′) for every edge uv ∈ P , we can find shortest replacement path for every edge uv ∈ P.

Mithun, Jayasurya (IIT Madras) Replacement Paths November 2019 14 / 32

slide-29
SLIDE 29

Outline of Replacement paths Algorithm

Every Replacement path for edge e = (u, v) ∈ P has a detour D(u′, v′) where u’ precedes u and v precedes v’ on P(s,t). By finding shortest detours D(u′, v′) for every edge uv ∈ P , we can find shortest replacement path for every edge uv ∈ P. We find separately the best short and long detours. For each edge uv, we will then find the shortest replacement paths using long and short detours and then take the shortest replacement path among the two.

Mithun, Jayasurya (IIT Madras) Replacement Paths November 2019 14 / 32

slide-30
SLIDE 30

Outline of Replacement paths Algorithm

Every Replacement path for edge e = (u, v) ∈ P has a detour D(u′, v′) where u’ precedes u and v precedes v’ on P(s,t). By finding shortest detours D(u′, v′) for every edge uv ∈ P , we can find shortest replacement path for every edge uv ∈ P. We find separately the best short and long detours. For each edge uv, we will then find the shortest replacement paths using long and short detours and then take the shortest replacement path among the two. The short detours are found in ˜ O(mL) time. The long detours are found in ˜ O(mn/L) time. By setting L = √n we can find both short and long detours in ˜ O(m√n) time.

Mithun, Jayasurya (IIT Madras) Replacement Paths November 2019 14 / 32

slide-31
SLIDE 31

Story So Far...

1

Definition and Problem statement

2

Previous Results

3

Outline of the Paper

4

Finding Short Detours

5

Finding Long Detours

6

Variations of Replacement Paths Problem

7

k−Shortest Paths Problem and the Reduction

Mithun, Jayasurya (IIT Madras) Replacement Paths November 2019 15 / 32

slide-32
SLIDE 32

Overview

Suppose we want to find all short detours starting from a given vertex u to vertices after u in the path P.

Mithun, Jayasurya (IIT Madras) Replacement Paths November 2019 16 / 32

slide-33
SLIDE 33

Overview

Suppose we want to find all short detours starting from a given vertex u to vertices after u in the path P. A simple approach is to consider the graph G \ PE and perform a BFS from u. From this we can find all the vertices in the path P which are at a distance of utmost than L.

Mithun, Jayasurya (IIT Madras) Replacement Paths November 2019 16 / 32

slide-34
SLIDE 34

Overview

Suppose we want to find all short detours starting from a given vertex u to vertices after u in the path P. A simple approach is to consider the graph G \ PE and perform a BFS from u. From this we can find all the vertices in the path P which are at a distance of utmost than L. It is easy to see that the paths to these vertices will be the only short detours starting from u. However performing n BFS is not good enough for us as it will take O(mn) time.

Mithun, Jayasurya (IIT Madras) Replacement Paths November 2019 16 / 32

slide-35
SLIDE 35

Overview

Suppose we want to find all short detours starting from a given vertex u to vertices after u in the path P. A simple approach is to consider the graph G \ PE and perform a BFS from u. From this we can find all the vertices in the path P which are at a distance of utmost than L. It is easy to see that the paths to these vertices will be the only short detours starting from u. However performing n BFS is not good enough for us as it will take O(mn) time. The important observation is that all the short detours will only be to vertices which are the L next vertices after u in P. (Why?)

Mithun, Jayasurya (IIT Madras) Replacement Paths November 2019 16 / 32

slide-36
SLIDE 36

Overview

Suppose we want to find all short detours starting from a given vertex u to vertices after u in the path P. A simple approach is to consider the graph G \ PE and perform a BFS from u. From this we can find all the vertices in the path P which are at a distance of utmost than L. It is easy to see that the paths to these vertices will be the only short detours starting from u. However performing n BFS is not good enough for us as it will take O(mn) time. The important observation is that all the short detours will only be to vertices which are the L next vertices after u in P. (Why?) This along with a clever construction will allow us to compute short detours for multiple such vertices u in a single run of Dijkstra’s algorithm.

Mithun, Jayasurya (IIT Madras) Replacement Paths November 2019 16 / 32

slide-37
SLIDE 37

Construction of Auxiliary Graph

We construct an Auxiliary Graph as follows, First delete the edges PE from the graph G.

Mithun, Jayasurya (IIT Madras) Replacement Paths November 2019 17 / 32

slide-38
SLIDE 38

Construction of Auxiliary Graph

We construct an Auxiliary Graph as follows, First delete the edges PE from the graph G. Add a new vertex r to the graph. If the path is P = {u0, u1, . . . ul} add edges from r to all vertices of the form u2iL.

Mithun, Jayasurya (IIT Madras) Replacement Paths November 2019 17 / 32

slide-39
SLIDE 39

Construction of Auxiliary Graph

We construct an Auxiliary Graph as follows, First delete the edges PE from the graph G. Add a new vertex r to the graph. If the path is P = {u0, u1, . . . ul} add edges from r to all vertices of the form u2iL. Give a weight of iL to the edges of the form ru2iL. To all other edges, give the weight of 1. This is the Auxiliary Graph A

Mithun, Jayasurya (IIT Madras) Replacement Paths November 2019 17 / 32

slide-40
SLIDE 40

Construction of Auxiliary Graph

We construct an Auxiliary Graph as follows, First delete the edges PE from the graph G. Add a new vertex r to the graph. If the path is P = {u0, u1, . . . ul} add edges from r to all vertices of the form u2iL. Give a weight of iL to the edges of the form ru2iL. To all other edges, give the weight of 1. This is the Auxiliary Graph A Perform the Dijkstra’s Algorithm on this graph from the new vertex r.

Mithun, Jayasurya (IIT Madras) Replacement Paths November 2019 17 / 32

slide-41
SLIDE 41

Construction of Auxiliary Graph

We construct an Auxiliary Graph as follows, First delete the edges PE from the graph G. Add a new vertex r to the graph. If the path is P = {u0, u1, . . . ul} add edges from r to all vertices of the form u2iL. Give a weight of iL to the edges of the form ru2iL. To all other edges, give the weight of 1. This is the Auxiliary Graph A Perform the Dijkstra’s Algorithm on this graph from the new vertex r. We will now try to relate short Detours in G \ PE to the distances

  • utput from the Dijkstra’s Algorithm.

Mithun, Jayasurya (IIT Madras) Replacement Paths November 2019 17 / 32

slide-42
SLIDE 42

Getting Short Detours from the Dijkstra’s Algorithm

Mithun, Jayasurya (IIT Madras) Replacement Paths November 2019 18 / 32

slide-43
SLIDE 43

Getting Short Detours from the Dijkstra’s Algorithm

Suppose we had a short Detour from the vertex u2iL to u2iL+j in the graph G \ PE. We can reach the vertex u2iL+j from r by first going from r to u2iL and then following the path in G \ PE.

Mithun, Jayasurya (IIT Madras) Replacement Paths November 2019 18 / 32

slide-44
SLIDE 44

Getting Short Detours from the Dijkstra’s Algorithm

Suppose we had a short Detour from the vertex u2iL to u2iL+j in the graph G \ PE. We can reach the vertex u2iL+j from r by first going from r to u2iL and then following the path in G \ PE. If the detour was of length utmost ≤ L, we can reach u2iL+j via a path

  • f length (i + 1)L. Thus the distance of u2iL+j from r is ≤ (i + 1)L

Mithun, Jayasurya (IIT Madras) Replacement Paths November 2019 18 / 32

slide-45
SLIDE 45

Getting Short Detours from the Dijkstra’s Algorithm

Mithun, Jayasurya (IIT Madras) Replacement Paths November 2019 18 / 32

slide-46
SLIDE 46

Getting Short Detours from the Dijkstra’s Algorithm

Suppose we had a short Detour from the vertex u2iL to u2iL+j in the graph G \ PE. We can reach the vertex u2iL+j from r by first going from r to u2iL and then following the path in G \ PE. If the detour was of length utmost ≤ L, we can reach u2iL+j via a path

  • f length (i + 1)L. Thus the distance of u2iL+j from r is ≤ (i + 1)L

Is the converse true??

Mithun, Jayasurya (IIT Madras) Replacement Paths November 2019 18 / 32

slide-47
SLIDE 47

Getting Short Detours from the Dijkstra’s Algorithm

Suppose we had a short Detour from the vertex u2iL to u2iL+j in the graph G \ PE. We can reach the vertex u2iL+j from r by first going from r to u2iL and then following the path in G \ PE. If the detour was of length utmost ≤ L, we can reach u2iL+j via a path

  • f length (i + 1)L. Thus the distance of u2iL+j from r is ≤ (i + 1)L

Is the converse true?? It is. . .

Mithun, Jayasurya (IIT Madras) Replacement Paths November 2019 18 / 32

slide-48
SLIDE 48

Getting Short Detours from the Dijkstra’s Algorithm

Suppose we had a short Detour from the vertex u2iL to u2iL+j in the graph G \ PE. We can reach the vertex u2iL+j from r by first going from r to u2iL and then following the path in G \ PE. If the detour was of length utmost ≤ L, we can reach u2iL+j via a path

  • f length (i + 1)L. Thus the distance of u2iL+j from r is ≤ (i + 1)L

Is the converse true?? It is. . . Say distance from r to u2iL+j, (j ≤ L) is utmost (i + 1)L. Clearly the path can not be starting with u2kl where k > i since the first edge itself costs (i + 1)L.

Mithun, Jayasurya (IIT Madras) Replacement Paths November 2019 18 / 32

slide-49
SLIDE 49

Getting Short Detours from the Dijkstra’s Algorithm

Mithun, Jayasurya (IIT Madras) Replacement Paths November 2019 18 / 32

slide-50
SLIDE 50

Getting Short Detours from the Dijkstra’s Algorithm

Suppose we had a short Detour from the vertex u2iL to u2iL+j in the graph G \ PE. We can reach the vertex u2iL+j from r by first going from r to u2iL and then following the path in G \ PE. If the detour was of length utmost ≤ L, we can reach u2iL+j via a path

  • f length (i + 1)L. Thus the distance of u2iL+j from r is ≤ (i + 1)L

Is the converse true?? It is. . . Say distance from r to u2iL+j, (j ≤ L) is utmost (i + 1)L. Clearly the path can not be starting with u2kl where k > i since the first edge itself costs (i + 1)L. Suppose the path starts with u2kL with k < i. The path length is at least kL + 2L(i − k) + j > (i + 1)L (Why?).

Mithun, Jayasurya (IIT Madras) Replacement Paths November 2019 18 / 32

slide-51
SLIDE 51

Getting Short Detours from the Dijkstra’s Algorithm

Mithun, Jayasurya (IIT Madras) Replacement Paths November 2019 18 / 32

slide-52
SLIDE 52

Finding the Replacement Paths that use these detours

Thus we can find all the short detours from vertices u2iL. We repeat this process to find short detours from all vertices of the form u2iL+j.

Mithun, Jayasurya (IIT Madras) Replacement Paths November 2019 19 / 32

slide-53
SLIDE 53

Finding the Replacement Paths that use these detours

Thus we can find all the short detours from vertices u2iL. We repeat this process to find short detours from all vertices of the form u2iL+j. Now let us find replacement paths for an edge using these detours. If D(i, j) is the detour length from ui to ui+j, the replacement path using a detour from ui to ui+j will be of length i + D(i, j) + l − (i + j).

Mithun, Jayasurya (IIT Madras) Replacement Paths November 2019 19 / 32

slide-54
SLIDE 54

Finding the Replacement Paths that use these detours

Thus we can find all the short detours from vertices u2iL. We repeat this process to find short detours from all vertices of the form u2iL+j. Now let us find replacement paths for an edge using these detours. If D(i, j) is the detour length from ui to ui+j, the replacement path using a detour from ui to ui+j will be of length i + D(i, j) + l − (i + j). Thus, to find the the best replacement path for an edge uk, uk+1, we need to find i and j such that this sum is minimized. Note that since we consider only short detours, we need to only consider i > k − L and j ≤ L.

Mithun, Jayasurya (IIT Madras) Replacement Paths November 2019 19 / 32

slide-55
SLIDE 55

Finding the Replacement Paths that use these detours

Thus we can find all the short detours from vertices u2iL. We repeat this process to find short detours from all vertices of the form u2iL+j. Now let us find replacement paths for an edge using these detours. If D(i, j) is the detour length from ui to ui+j, the replacement path using a detour from ui to ui+j will be of length i + D(i, j) + l − (i + j). Thus, to find the the best replacement path for an edge uk, uk+1, we need to find i and j such that this sum is minimized. Note that since we consider only short detours, we need to only consider i > k − L and j ≤ L. We do this by maintaining a priority Queue of all the pairs under

  • consideration. For a given pair (i, j) the value will be

i + D(i, j) + l − (i + j).

Mithun, Jayasurya (IIT Madras) Replacement Paths November 2019 19 / 32

slide-56
SLIDE 56

Finding the Replacement Paths that use these detours

Thus we can find all the short detours from vertices u2iL. We repeat this process to find short detours from all vertices of the form u2iL+j. Now let us find replacement paths for an edge using these detours. If D(i, j) is the detour length from ui to ui+j, the replacement path using a detour from ui to ui+j will be of length i + D(i, j) + l − (i + j). Thus, to find the the best replacement path for an edge uk, uk+1, we need to find i and j such that this sum is minimized. Note that since we consider only short detours, we need to only consider i > k − L and j ≤ L. We do this by maintaining a priority Queue of all the pairs under

  • consideration. For a given pair (i, j) the value will be

i + D(i, j) + l − (i + j). We move along the path P, if we move to an edge uk, uk+1, we delete the pairs of the form (i, k) and add the pairs of the form (i, k + 1).

Mithun, Jayasurya (IIT Madras) Replacement Paths November 2019 19 / 32

slide-57
SLIDE 57

Conclusion and Analysis

At each step we can take the replacement path of least cost from the

  • Queue. This will be the ”best” replacement path for that edge that

uses a short detour.

Mithun, Jayasurya (IIT Madras) Replacement Paths November 2019 20 / 32

slide-58
SLIDE 58

Conclusion and Analysis

At each step we can take the replacement path of least cost from the

  • Queue. This will be the ”best” replacement path for that edge that

uses a short detour. At each edge we introduce utmost L pairs and delete utmost L pairs. Thus this will be done in ˜ O(nL) time.

Mithun, Jayasurya (IIT Madras) Replacement Paths November 2019 20 / 32

slide-59
SLIDE 59

Conclusion and Analysis

At each step we can take the replacement path of least cost from the

  • Queue. This will be the ”best” replacement path for that edge that

uses a short detour. At each edge we introduce utmost L pairs and delete utmost L pairs. Thus this will be done in ˜ O(nL) time. Earlier we had done 2L runs of the Dijkstra’s Algorithm. This will take ˜ O(mL) time.

Mithun, Jayasurya (IIT Madras) Replacement Paths November 2019 20 / 32

slide-60
SLIDE 60

Conclusion and Analysis

At each step we can take the replacement path of least cost from the

  • Queue. This will be the ”best” replacement path for that edge that

uses a short detour. At each edge we introduce utmost L pairs and delete utmost L pairs. Thus this will be done in ˜ O(nL) time. Earlier we had done 2L runs of the Dijkstra’s Algorithm. This will take ˜ O(mL) time. Thus we achieve the promised time of ˜ O(mL).

Mithun, Jayasurya (IIT Madras) Replacement Paths November 2019 20 / 32

slide-61
SLIDE 61

Story So Far...

1

Definition and Problem statement

2

Previous Results

3

Outline of the Paper

4

Finding Short Detours

5

Finding Long Detours

6

Variations of Replacement Paths Problem

7

k−Shortest Paths Problem and the Reduction

Mithun, Jayasurya (IIT Madras) Replacement Paths November 2019 21 / 32

slide-62
SLIDE 62

Overview

We want to find best replacement path for every edge e ∈ P(s, t) that uses a long detour.

Mithun, Jayasurya (IIT Madras) Replacement Paths November 2019 22 / 32

slide-63
SLIDE 63

Overview

We want to find best replacement path for every edge e ∈ P(s, t) that uses a long detour. We use the following sampling lemma to find long detours.

Lemma

Let D1, D2, ..., Dq ⊆ V such that |Di| ≥ L for 1 ≤ i ≤ q and |V | = n. If R ⊆ V is a random subset obtained by selecting each vertex, independently with probability (c ln n)/L, for some constant c, then with probability of atleast 1 − q.n−c we have Di ∩ R = ∅ for every 1 ≤ i ≤ q.

Mithun, Jayasurya (IIT Madras) Replacement Paths November 2019 22 / 32

slide-64
SLIDE 64

Construction

Our algorithm selects a random set R by picking each vertex v ∈ V with probability 4 ln n

L . The expected size of R is ˜

O( n

L).

Mithun, Jayasurya (IIT Madras) Replacement Paths November 2019 23 / 32

slide-65
SLIDE 65

Construction

Our algorithm selects a random set R by picking each vertex v ∈ V with probability 4 ln n

L . The expected size of R is ˜

O( n

L).

Consider a shortest detour D(u, v) for every pair of vertices u and v

  • n the path P for which shortest detour from u to v is of length

atleast L. Let set of all these detours be D′.

Mithun, Jayasurya (IIT Madras) Replacement Paths November 2019 23 / 32

slide-66
SLIDE 66

Construction

Our algorithm selects a random set R by picking each vertex v ∈ V with probability 4 ln n

L . The expected size of R is ˜

O( n

L).

Consider a shortest detour D(u, v) for every pair of vertices u and v

  • n the path P for which shortest detour from u to v is of length

atleast L. Let set of all these detours be D′. As there can be atmost one detour in D′ for every pair of vertices u and v on the path P. So |D′| ≤ n2 where |V | = n

Mithun, Jayasurya (IIT Madras) Replacement Paths November 2019 23 / 32

slide-67
SLIDE 67

Construction

Our algorithm selects a random set R by picking each vertex v ∈ V with probability 4 ln n

L . The expected size of R is ˜

O( n

L).

Consider a shortest detour D(u, v) for every pair of vertices u and v

  • n the path P for which shortest detour from u to v is of length

atleast L. Let set of all these detours be D′. As there can be atmost one detour in D′ for every pair of vertices u and v on the path P. So |D′| ≤ n2 where |V | = n From the lemma we can say that D(u, v) ∩ R = ∅ with a probability

  • f atleast 1 − n2−c = 1 − n−2.

Lemma

Let D1, D2, ..., Dq ⊆ V such that |Di| ≥ L for 1 ≤ i ≤ q and |V | = n. If R ⊆ V is a random subset obtained by selecting each vertex, independently with probability (c ln n)/L, for some constant c, then with probability of atleast 1 − q.n−c we have Di ∩ R = ∅ for every 1 ≤ i ≤ q.

Mithun, Jayasurya (IIT Madras) Replacement Paths November 2019 23 / 32

slide-68
SLIDE 68

Construction

Our algorithm selects a random set R by picking each vertex v ∈ V with probability 4 ln n

L . The expected size of R is ˜

O( n

L).

Consider a shortest detour D(u, v) for every pair of vertices u and v

  • n the path P for which shortest detour from u to v is of length

atleast L. Let set of all these detours be D′. As there can be atmost one detour in D′ for every pair of vertices u and v on the path P. So |D′| ≤ n2 where |V | = n From the lemma we can say that D(u, v) ∩ R = ∅ with a probability

  • f atleast 1 − n2−c = 1 − n−2.

As probability is very high we assume in rest of the algorithm D(u, v) ∩ R = ∅ for every D(u, v) ∈ D′

Mithun, Jayasurya (IIT Madras) Replacement Paths November 2019 23 / 32

slide-69
SLIDE 69

Finding Replacement Paths

How to find the shortest replacement path that uses a long detour for the edge (ui, ui+1)?

Mithun, Jayasurya (IIT Madras) Replacement Paths November 2019 24 / 32

slide-70
SLIDE 70

Finding Replacement Paths

How to find the shortest replacement path that uses a long detour for the edge (ui, ui+1)? From the above discussion we can say that every long detour passes through some vertex r ∈ R. Let the shortest replacement path be s → a → r → b → t where s → a, b → t follow P(s, t) and a → b path is D(a, b).

Mithun, Jayasurya (IIT Madras) Replacement Paths November 2019 24 / 32

slide-71
SLIDE 71

Finding Replacement Paths

How to find the shortest replacement path that uses a long detour for the edge (ui, ui+1)? From the above discussion we can say that every long detour passes through some vertex r ∈ R. Let the shortest replacement path be s → a → r → b → t where s → a, b → t follow P(s, t) and a → b path is D(a, b). We need to find a and b, such that a precedes ui and ui+1 precedes b in P(s,t), which minimize the expressions δ(s, a) + δ−(a, r) and δ−(r, b) + δ(b, t). Here δ−(u, v) is distance from u to v in G \ PE.

Mithun, Jayasurya (IIT Madras) Replacement Paths November 2019 24 / 32

slide-72
SLIDE 72

Finding Replacement Paths

To compute above expressions we maintain two priority queues Qin[r] and Qout[r] for every sampled vertex r ∈ R.

Mithun, Jayasurya (IIT Madras) Replacement Paths November 2019 25 / 32

slide-73
SLIDE 73

Finding Replacement Paths

To compute above expressions we maintain two priority queues Qin[r] and Qout[r] for every sampled vertex r ∈ R. When looking for a replacement path for the edge (ui, ui+1), Qin[r] = 0, 1, 2, ...i and Qout[r] = i + 1, ...l. The key for an element j ∈ Qin[r] is δ−(uj, r) + j and that for j ∈ Qout[r] is δ−(r, uj) + (l − j).

Mithun, Jayasurya (IIT Madras) Replacement Paths November 2019 25 / 32

slide-74
SLIDE 74

Finding Replacement Paths

To compute above expressions we maintain two priority queues Qin[r] and Qout[r] for every sampled vertex r ∈ R. When looking for a replacement path for the edge (ui, ui+1), Qin[r] = 0, 1, 2, ...i and Qout[r] = i + 1, ...l. The key for an element j ∈ Qin[r] is δ−(uj, r) + j and that for j ∈ Qout[r] is δ−(r, uj) + (l − j). Algorithm computes δ−(r, v) for every r ∈ R, v ∈ V by running BFS from r in G \ PE and computes δ−(v, r) by running BFS from r in the graph obtained from G \ PE by reversing all the edges.

Mithun, Jayasurya (IIT Madras) Replacement Paths November 2019 25 / 32

slide-75
SLIDE 75

Finding Replacement Paths

To compute above expressions we maintain two priority queues Qin[r] and Qout[r] for every sampled vertex r ∈ R. When looking for a replacement path for the edge (ui, ui+1), Qin[r] = 0, 1, 2, ...i and Qout[r] = i + 1, ...l. The key for an element j ∈ Qin[r] is δ−(uj, r) + j and that for j ∈ Qout[r] is δ−(r, uj) + (l − j). Algorithm computes δ−(r, v) for every r ∈ R, v ∈ V by running BFS from r in G \ PE and computes δ−(v, r) by running BFS from r in the graph obtained from G \ PE by reversing all the edges. We start with the edge u0, u1 and move along the path, when we move to an edge ui, ui+1 we have to add entry i to Qin[r] and remove entry i from Qout[r]

Mithun, Jayasurya (IIT Madras) Replacement Paths November 2019 25 / 32

slide-76
SLIDE 76

Analysis

We perform 2 BFS for each r ∈ R. Since the expected size of R is ˜ O( n

L), the running time of this step is ˜

O( mn

L )

Mithun, Jayasurya (IIT Madras) Replacement Paths November 2019 26 / 32

slide-77
SLIDE 77

Analysis

We perform 2 BFS for each r ∈ R. Since the expected size of R is ˜ O( n

L), the running time of this step is ˜

O( mn

L )

To maintain the priority queue, when we move to an edge, we add

  • ne entry to Qin and remove an entry from Qout for each r ∈ R. This

will take ˜ O( n

L) time. To iterate over all the edges in P we will take

utmost ˜ O( n2

L ) time.

Mithun, Jayasurya (IIT Madras) Replacement Paths November 2019 26 / 32

slide-78
SLIDE 78

Analysis

We perform 2 BFS for each r ∈ R. Since the expected size of R is ˜ O( n

L), the running time of this step is ˜

O( mn

L )

To maintain the priority queue, when we move to an edge, we add

  • ne entry to Qin and remove an entry from Qout for each r ∈ R. This

will take ˜ O( n

L) time. To iterate over all the edges in P we will take

utmost ˜ O( n2

L ) time.

Thus the overall time complexity of finding shortest replacement paths that use long detours is ˜ O( mn

L ).

Mithun, Jayasurya (IIT Madras) Replacement Paths November 2019 26 / 32

slide-79
SLIDE 79

Story So Far...

1

Definition and Problem statement

2

Previous Results

3

Outline of the Paper

4

Finding Short Detours

5

Finding Long Detours

6

Variations of Replacement Paths Problem

7

k−Shortest Paths Problem and the Reduction

Mithun, Jayasurya (IIT Madras) Replacement Paths November 2019 27 / 32

slide-80
SLIDE 80

Definition (Restricted Replacement Paths Problem)

Given a directed Graph G and a shortest path P from s to t, we are required to find, for every edge uv ∈ P, a shortest path from u to t that avoids e. This is useful in cases when failure of edge uv is only detected at u.

Mithun, Jayasurya (IIT Madras) Replacement Paths November 2019 28 / 32

slide-81
SLIDE 81

Definition (Restricted Replacement Paths Problem)

Given a directed Graph G and a shortest path P from s to t, we are required to find, for every edge uv ∈ P, a shortest path from u to t that avoids e. This is useful in cases when failure of edge uv is only detected at u.

Definition (Edge Replacement Paths Problem)

Given a directed Graph G and a shortest path P, we are required to find, for every edge uv ∈ P, a shortest path between u and v that avoids edge uv.

Mithun, Jayasurya (IIT Madras) Replacement Paths November 2019 28 / 32

slide-82
SLIDE 82

Story So Far...

1

Definition and Problem statement

2

Previous Results

3

Outline of the Paper

4

Finding Short Detours

5

Finding Long Detours

6

Variations of Replacement Paths Problem

7

k−Shortest Paths Problem and the Reduction

Mithun, Jayasurya (IIT Madras) Replacement Paths November 2019 29 / 32

slide-83
SLIDE 83

Definition and Improvements

Definition (k−Shortest Paths Problem)

Given a directed Graph G, two vertices s, t and an integer k, we are required to find k shortest simple paths from s to t.

Mithun, Jayasurya (IIT Madras) Replacement Paths November 2019 30 / 32

slide-84
SLIDE 84

Definition and Improvements

Definition (k−Shortest Paths Problem)

Given a directed Graph G, two vertices s, t and an integer k, we are required to find k shortest simple paths from s to t. The k-shortest non simple paths can be computed in time of O(m + n log n + k) using an algorithm proposed by Eppstein.

Mithun, Jayasurya (IIT Madras) Replacement Paths November 2019 30 / 32

slide-85
SLIDE 85

Definition and Improvements

Definition (k−Shortest Paths Problem)

Given a directed Graph G, two vertices s, t and an integer k, we are required to find k shortest simple paths from s to t. The k-shortest non simple paths can be computed in time of O(m + n log n + k) using an algorithm proposed by Eppstein. So far the best known algorithm for K-shortest simple paths has a running time of O(kn(m + n log n)). This uses the replacement paths algorithm as a subroutine.

Mithun, Jayasurya (IIT Madras) Replacement Paths November 2019 30 / 32

slide-86
SLIDE 86

Definition and Improvements

Definition (k−Shortest Paths Problem)

Given a directed Graph G, two vertices s, t and an integer k, we are required to find k shortest simple paths from s to t. The k-shortest non simple paths can be computed in time of O(m + n log n + k) using an algorithm proposed by Eppstein. So far the best known algorithm for K-shortest simple paths has a running time of O(kn(m + n log n)). This uses the replacement paths algorithm as a subroutine. Using the improved algorithm discussed here for Replacement paths problem we can improve the running time of K-shortest simple paths to ˜ O(km√n).

Mithun, Jayasurya (IIT Madras) Replacement Paths November 2019 30 / 32

slide-87
SLIDE 87

Reduction to 2nd shortest path computation

Instead of using the replacement path algorithm as a subroutine, the authors show that we can compute k simple shortest paths using O(k) computations of the 2nd shortest path.

Mithun, Jayasurya (IIT Madras) Replacement Paths November 2019 31 / 32

slide-88
SLIDE 88

Reduction to 2nd shortest path computation

Instead of using the replacement path algorithm as a subroutine, the authors show that we can compute k simple shortest paths using O(k) computations of the 2nd shortest path. This means that we can now focus our attempts on improving the algorithm for finding the 2nd shortest path in a graph.

Mithun, Jayasurya (IIT Madras) Replacement Paths November 2019 31 / 32

slide-89
SLIDE 89

Open Problems

Can we modify the replacement paths algorithm to work even in the case of weighted directed graphs? Can we find an ˜ O(m√n) time deterministic algorithm for the replacement paths problem?

Mithun, Jayasurya (IIT Madras) Replacement Paths November 2019 32 / 32