Presentation is loading. Please wait.

Presentation is loading. Please wait.

Haitao Wang Utah State University WADS 2017, St. John’s, Canada

Similar presentations


Presentation on theme: "Haitao Wang Utah State University WADS 2017, St. John’s, Canada"— Presentation transcript:

1 Haitao Wang Utah State University WADS 2017, St. John’s, Canada
An Improved Algorithm for Diameter-Optimally Augmenting Paths in a Metric Space Haitao Wang Utah State University WADS 2017, St. John’s, Canada

2 A path graph in a metric space
P: a path graph of n vertices v1, v2, …, vn Each edge e(vi,vi+1) has a length |vivi+1| Assume all vertices are in a metric space Triangle inequality: |vivj| + |vjvk| ≤ |vivk|, for any three vertices vi, vj, vk What is the diameter of P? The length of the entire path between v1 and vn |v2v4| + |v4v6| ≤ |v2v6| v7 v1 v2 v6 v3 v5 v4

3 The diameter-optimally augmenting path problem
Add an edge e(vi,vj) to connect two vertices vi and vj, so that the diameter of the resulting graph is minimized The length of the new edge is |vivj|, which can be obtained in O(1) time What is the diameter of the new graph? Previous work O(n log3 n) time, Große et al., ICALP 2015 Our result O(n log n) time v7 v1 v2 v6 v3 v5 v4

4 Related work If P is in the Euclidean space Rd, for a constant d
O(n+1/ε3) time to find a (1+ε)-approximate solution, Große et al., ICALP 2015 If P is in the Euclidean plane R2 O(n) time, De Carufel et al. SWAT 2016 to minimize the continuous diameter, defined with respect to all points of P, not just the vertices For a geometric tree T of n vertices embedded in the Euclidean plane R2 O(n log n) time for continuous diameter, De Carufel et al. WADS 2017 Our problem is for discrete diameter in a metric space

5 Overview of our approach
λ*: the optimal objective value the diameter in an optimal solution The decision problem Given any value λ, determine whether λ ≥ λ*, determine whether we can add an edge to P so that the diameter is at most λ if yes, λ is called a feasible value Previous work: O(n log n) time, Große et al., ICALP 2015 Our result: O(n) time

6 Overview of our approach: solving the original optimization problem
Goal: compute λ* Previous work: parametric search, O(n log3 n) time, Große et al., 2015 Our approach Identify a set S of candidate values that contains λ* λ* is the smallest feasible value of S Find λ* in S, e.g., sort S and then binary search using the decision algorithm Difficulty |S| = Ω(n2), cannot afford to compute S explicitly Our solution: Reduce the size of S in several steps Eventually |S| = O(n) and can be computed in O(n log n) time Each step takes O(n log n) time using our decision algorithm

7 The diameter of the new graph
G(i,j): the new graph after adding e(vi,vj) to P C(i,j): the cycle of G(i,j) D(i,j): the diameter of G(i,j) α(i,j): the largest shortest path length from v1 to vk for all i ≤ k ≤ j β(i,j): the largest shortest path length from vn to vk for all i ≤ k ≤ j δ(i,j): the shortest path length between v1 and vn γ(i,j): the largest shortest path length between vl and vk for i ≤ l ≤ k ≤ j D(i,j) = max{α(i,j), β(i,j), δ(i,j), γ(i,j)} vn v1 vi vj

8 Computing α(i,j), β(i,j), γ(i,j), δ(i,j)
With O(n) time preprocessing, for any (i,j) α(i,j) can be computed in O(log n) time β(i,j) can be computed in O(log n) time δ(i,j) can be computed in O(1) time How about γ(i,j)? γ(i,j) is the diameter of C(i,j) O(n) time, trivial but not good enough The main obstacle for solving the problem Call it “γ-computation difficulty” vn v1 vi vj

9 Solving the decision problem
Given λ, determine whether λ is a feasible value Our approach For each 1 ≤ i ≤ n, determine whether there exists i ≤ j ≤ n, such that max{α(i,j), β(i,j), δ(i,j), γ(i,j)} ≤ λ

10 Notation Ii(α): the largest j such that α(i,j) ≤ λ
Ii(β): the smallest j such that β(i,j) ≤ λ Ii(δ): the smallest j such that δ(i,j) ≤ λ Ii(γ): the largest j such that γ(i,j) ≤ λ β(i,j) δ(i,j) α(i,j) γ(i,j) λ λ j j Ii(β) Ii(α) Ii(δ) Ii(γ)

11 Solving the decision problem
For each i, determine whether there exists i ≤ j ≤ n, such that max{α(i,j), β(i,j), δ(i,j), γ(i,j)} ≤ λ This is true iff there is a vertical line whose intersections with all four functions are below the horizontal line at λ which is true iff [1, Ii(α)]∩[Ii(β), n] ∩[Ii(δ),n] ∩[1,Ii(γ)] ≠ ∅ Computing Ii(α), Ii(β), Ii(δ) for all 1 ≤ i ≤ n can be done in O(n) time This is not true for Ii(γ) due to the γ-computation difficulty λ Ii(β) j Ii(α)

12 Our algorithm Compute [1, Ii(α)], [Ii(β), n],[Ii(δ),n] for all 1 ≤ i ≤ n For each i, Whether Qi = [1, Ii(α)]∩[Ii(β), n] ∩[Ii(δ),n] ∩[1,Ii(γ)] is empty? If [1, Ii(α)]∩[Ii(β), n]∩[Ii(δ),n] = ∅, then Qi is empty Else ai: the smallest index in [1, Ii(α)]∩[Ii(β), n]∩[Ii(δ),n] Observation: Qi is not empty iff γ(i,ai) ≤ λ How to determine whether γ(i,ai) ≤ λ? Note: do not have to compute the exact value γ(i,ai) γ(i,j) λ j ai Ii(γ)

13 Determine whether γ(i,ai) ≤ λ
d(vk,vl): the shortest path length between vk and vl dP(vk,vl): the path length between vk and vl along P Determine whether the diameter of the cycle C(i,ai) is at most λ Whether d(vk,vl) ≤ λ, for all i ≤ k ≤ l ≤ ai A sub-problem: For each k, whether d(vk,vl) ≤ λ for all k ≤ l ≤ ai k’: the smallest index with dP(vk,vk’) > λ Observation: Only need to check whether the length of the path from k to k’ containing the new edge is at most λ Check whether dP(vk,vk’) ≥ |C(i,ai)| - λ Sufficient to find the index k with the smallest dP(vk,vk’) O(1) time by a range-minima data structure Total time for the decision problem: O(n) λ i k k’ ai

14 The optimization problem
Goal: compute λ*

15 The candidate sets D(i,j) = max{α(i,j), β(i,j), δ(i,j), γ(i,j)}
Sα = {α(i,j) | 1 ≤ i ≤ j ≤ n} Define Sβ, Sδ, Sγ similarly S = the union of the above four sets λ* must be in S λ* is the smallest feasible value of S |S| = Ω(n2), too large to compute Our solution: Reduce the size of S in several steps Eventually |S| = O(n) and can be computed in O(n log n) time

16 Defining λα, λβ, λδ, λγ S = Sα ∪ Sβ ∪ Sδ ∪ Sγ
λα: the smallest feasible value of Sα Define λβ, λδ, λγ similarly λ* = min{λα, λβ, λδ, λγ} How to compute λα, λβ, λδ, λγ? The values of Sα can be organized into a sorted matrix so that each element can be computed in O(log n) time λα can be computed in O(n log n) time By a sorted matrix searching technique Using our decision algorithm This is also true for λβ and λδ, but not for λγ due to the γ-computation difficulty S = Sα ∪ Sβ ∪ Sδ ∪ Sγ

17 Computing λγ λ’ = min{λα, λβ, λδ} Assumption: λγ < λ’ λ*= λγ

18 Notation Ii(α): the largest j such that α(i,j) ≤ λ
Ii(β): the smallest j such that β(i,j) ≤ λ Ii(δ): the smallest j such that δ(i,j) ≤ λ Ii(γ): the largest j such that γ(i,j) ≤ λ β(i,j) δ(i,j) α(i,j) γ(i,j) λ λ j j Ii(β) Ii(α) Ii(δ) Ii(γ)

19 Define similar notation with respect to “< λ’”
I’i(α): the largest j such that α(i,j) < λ’ I’i(β): the smallest j such that β(i,j) < λ’ I’i(δ): the smallest j such that δ(i,j) < λ’ I’i(γ): the largest j such that γ(i,j) < λ’ Computing I’i(α), I’i(β), I’i(δ) for all 1 ≤ i ≤ n can be done in O(n log n) time Not true for I’i(γ) due to the γ-computation difficulty β(i,j) δ(i,j) α(i,j) γ(i,j) λ’ λ’ j j I’i(β) I’i(α) I’i(δ) I’i(γ)

20 A key observation Suppose e(i,j) is an optimal edge
the edge added to P in an optimal solution λ*= λγ = D(i,j) ai: the smallest index in [1, I’i(α)]∩[I’i(β), n]∩[I’i(δ),n] Observation: j = ai Corollary: λγ is the smallest feasible value of S’={γ(i,ai)|1≤i≤ n} |S’| = O(n) Compute λγ in S’ Still cannot compute S’ in O(n log n) time due to the γ-computation difficulty Our solution: Follow the similar scheme as the decision algorithm Total time: O(n log n)

21 Thank you for your attention!


Download ppt "Haitao Wang Utah State University WADS 2017, St. John’s, Canada"

Similar presentations


Ads by Google