Minimum Weight Cycle Liam Roditty Bar-Ilan University Based on: Approximating the girth, (SODA`11) with Roei Tov (BIU) Minimum Weight Cycles and Triangles:

Slides:



Advertisements
Similar presentations
Maximum flow Main goals of the lecture:
Advertisements

Lower Bounds for Additive Spanners, Emulators, and More David P. Woodruff MIT and Tsinghua University To appear in FOCS, 2006.
Chapter 5: Tree Constructions
Long cycles, short cycles, min-degree subgraphs, and feedback arc sets in Eulerian digraphs Raphael Yuster joint work with Asaf Shapira Eilat 2012.
Surender Baswana Department of CSE, IIT Kanpur. Surender Baswana Department of CSE, IIT Kanpur.
Min Cost Flow: Polynomial Algorithms. Overview Recap: Min Cost Flow, Residual Network Potential and Reduced Cost Polynomial Algorithms Approach Capacity.
 Theorem 5.9: Let G be a simple graph with n vertices, where n>2. G has a Hamilton circuit if for any two vertices u and v of G that are not adjacent,
Single Source Shortest Paths
all-pairs shortest paths in undirected graphs
UNC Chapel Hill Lin/Foskey/Manocha Steps in DP: Step 1 Think what decision is the “last piece in the puzzle” –Where to place the outermost parentheses.
Lecture 7 March 1, 11 discuss HW 2, Problem 3
Approximate Distance Oracles and Spanners with sublinear surplus Mikkel Thorup AT&T Research Uri Zwick Tel Aviv University.
1 Efficient algorithms on sets of permutations, dominance, and real-weighted APSP Raphael Yuster University of Haifa.
C&O 355 Lecture 23 N. Harvey TexPoint fonts used in EMF. Read the TexPoint manual before you delete this box.: A A A A A A A A A A.
Theory of Computing Lecture 18 MAS 714 Hartmut Klauck.
Lecture 24 Coping with NPC and Unsolvable problems. When a problem is unsolvable, that's generally very bad news: it means there is no general algorithm.
IKI 10100: Data Structures & Algorithms Ruli Manurung (acknowledgments to Denny & Ade Azurat) 1 Fasilkom UI Ruli Manurung (Fasilkom UI)IKI10100: Lecture10.
October 31, Algorithms and Data Structures Lecture XIII Simonas Šaltenis Nykredit Center for Database Research Aalborg University
CS 206 Introduction to Computer Science II 03 / 27 / 2009 Instructor: Michael Eckmann.
1 Discrete Structures & Algorithms Graphs and Trees: II EECE 320.
Approximation Algorithms: Combinatorial Approaches Lecture 13: March 2.
1 8-ShortestPaths Shortest Paths in a Graph Fundamental Algorithms.
Greedy Algorithms Reading Material: Chapter 8 (Except Section 8.5)
CSE 421 Algorithms Richard Anderson Lecture 4. What does it mean for an algorithm to be efficient?
Answering Distance Queries in directed graphs using fast matrix multiplication Seminar in Algorithms Prof. Haim Kaplan Lecture by Lior Eldar 1/07/2007.
Tirgul 13. Unweighted Graphs Wishful Thinking – you decide to go to work on your sun-tan in ‘ Hatzuk ’ beach in Tel-Aviv. Therefore, you take your swimming.
Greedy Algorithms Like dynamic programming algorithms, greedy algorithms are usually designed to solve optimization problems Unlike dynamic programming.
Tirgul 13 Today we’ll solve two questions from last year’s exams.
1 Shortest Path Calculations in Graphs Prof. S. M. Lee Department of Computer Science.
Theory of Computing Lecture 7 MAS 714 Hartmut Klauck.
Graphs – Shortest Path (Weighted Graph) ORD DFW SFO LAX
Minimal Spanning Trees What is a minimal spanning tree (MST) and how to find one.
1 Introduction to Approximation Algorithms. 2 NP-completeness Do your best then.
Week -7-8 Topic - Graph Algorithms CSE – 5311 Prepared by:- Sushruth Puttaswamy Lekhendro Lisham.
Chapter 9 – Graphs A graph G=(V,E) – vertices and edges
All-Pairs Bottleneck Paths in Vertex Weighted graphs Asaf Shapira Microsoft Research Raphael Yuster University of Haifa Uri Zwick Tel-Aviv University.
C&O 355 Mathematical Programming Fall 2010 Lecture 19 N. Harvey TexPoint fonts used in EMF. Read the TexPoint manual before you delete this box.: AA A.
1 Introduction to Approximation Algorithms. 2 NP-completeness Do your best then.
Advanced Algorithm Design and Analysis (Lecture 13) SW5 fall 2004 Simonas Šaltenis E1-215b
Distance sensitivity oracles in weighted directed graphs Raphael Yuster University of Haifa Joint work with Oren Weimann Weizmann inst.
 2004 SDU Lecture 7- Minimum Spanning Tree-- Extension 1.Properties of Minimum Spanning Tree 2.Secondary Minimum Spanning Tree 3.Bottleneck.
1 The number of orientations having no fixed tournament Noga Alon Raphael Yuster.
Introduction to Algorithms Jiafen Liu Sept
CSE 2331 / 5331 Topic 12: Shortest Path Basics Dijkstra Algorithm Relaxation Bellman-Ford Alg.
Graph Colouring L09: Oct 10. This Lecture Graph coloring is another important problem in graph theory. It also has many applications, including the famous.
Great Theoretical Ideas in Computer Science for Some.
 2004 SDU 1 Lecture5-Strongly Connected Components.
TU/e Algorithms (2IL15) – Lecture 12 1 Linear Programming.
CSE 421 Algorithms Richard Anderson Autumn 2015 Lecture 5.
1 Closures of Relations Based on Aaron Bloomfield Modified by Longin Jan Latecki Rosen, Section 8.4.
Approximation Algorithms based on linear programming.
TIRGUL 10 Dijkstra’s algorithm Bellman-Ford Algorithm 1.
TU/e Algorithms (2IL15) – Lecture 11 1 Approximation Algorithms.
Shortest Paths.
COMP 6/4030 ALGORITHMS Prim’s Theorem 10/26/2000.
Greedy Algorithms / Minimum Spanning Tree Yin Tat Lee
CSE 421: Introduction to Algorithms
Enumerating Distances Using Spanners of Bounded Degree
Randomized Algorithms CS648
Shortest Paths.
On the effect of randomness on planted 3-coloring models
Richard Anderson Autumn 2016 Lecture 5
Algorithms (2IL15) – Lecture 7
Chapter 24: Single-Source Shortest Paths
Shortest Paths.
Chapter 24: Single-Source Shortest Paths
CSE 417: Algorithms and Computational Complexity
CSC 325: Algorithms Graph Algorithms David Luebke /24/2019.
Richard Anderson Winter 2019 Lecture 5
Presentation transcript:

Minimum Weight Cycle Liam Roditty Bar-Ilan University Based on: Approximating the girth, (SODA`11) with Roei Tov (BIU) Minimum Weight Cycles and Triangles: Equivalences and Algorithms, with Virginia V. Williams (UC Berkeley)

Problem Definition Given a graph G=(V,E) find the Minimum Weight Cycle (Min-Cycle) in the graph. Variants: Undirected / Directed Unweighted / Weighted Exact / Approximation With or without Fast Matrix Multiplication (FMM)

The Trivial Algorithm Directed graphs: – Compute All-Pairs of Shortest Paths (APSP). – Min-Cycle = min (u,v)  E d[v,u] + w(u,v) vu

The Trivial Algorithm Undirected graphs: – Dijkstra/BFS from every vertex of the graph – Pick the minimum cycle detected Example (unweighted): vu s In both cases the running time is Õ(n³).

Previous Work (1) Itai & Rodeh (SICOMP 1978) considered only unweighted graphs: Min-Cycle in undirected graphs in O(n ω ) time. Min-Cycle in directed graphs in O(n ω log n) time. Approximation in undirected graphs in O(n²) time. – Return a min-cycle or a cycle whose length is larger by one from the minimum.

Previous Work (2) Yuster & Zwick (SIDMA 1997) presented an algorithm that finds the shortest even cycle in unweighted undirected graphs in O(n²) time.

Previous Work (3) Lingas & Lundell (IPL 2009) presented two approximation algorithms for undirected graphs: For unweighted graphs an Õ(n 3/2 ) algorithm that returns a 2.666…-approximation. For weighted graphs with integral edge weights [1,M] an O(n² log n log nM) algorithm that returns a 2-approximation.

Previous Work (4) V. Williams & Williams (FOCS 2010) showed that if a Min-Cycle in an undirected graph with weights [1,M] can be found in O(n 3-δ log M) for some δ>0 then it is possible to compute APSP in a directed graph with weights [-M,M] in O(n 3-δ’ log M) for some δ’>0.

Results (SODA'11) For undirected graphs with weights from [1,M] a 4/3-approximation algorithm with a running time of O(n² log n log nM). For undirected graphs with real edge weights a (4/3+ε)-approximation with a running time of Õ(1/ε n²). An algorithm with (4/3-ε)-approximation can multiply two Boolean matrices. (Using V.W & W ideas).

“A related problem is finding a minimum weighted circuit in a weighted graph. It is unclear to us whether our methods can be modified to answer this problem too.” SICOMP 1978 New Results For undirected and directed graphs with weights from [1,M] we show that the Min-Cycle problem can be efficiently reduced to finding a minimum weight triangle in graphs with weights [1,Θ(M)]. This implies an Õ(Mn ω ) algorithm for Min-Cycle problem both in undirected and directed graphs. We resolve the open problem raised by Itai & Rodeh:

New Results Notice! APSP in directed graphs can be computed in O(M n ) time (Zwick JACM`02). APSP in undirected graphs can be computed in Õ(Mn ω ) time (Shoshan & Zwick FOCS`99). We show that Min-Cycle in directed graphs can be solved in Õ(Mn ω ) time!

In this talk For undirected graphs with weights from [1,M] a 4/3-approximation algorithm with a running time of O(n² log n log nM) (SODA’11) For undirected graphs with weights from [1,M] we show that the Min-Cycle problem can be efficiently reduced to finding a minimum weight triangle in graph with weights [1,Θ(M)]. (New result)

Itai & Rodeh’s Additive 1- Approximataion s xyz The trivial algorithm: All edges of x are scanned in an arbitrary order. and in particular (x,y). A Min-Cycle is detected. Running time: O(m). We repeat it from every vertex. Total running time is O(mn). w Unweighted undirected.

Itai & Rodeh’s Additive 1- Approximataion s xyz Itai & Rodeh: Stop with the first cycle discovered. Running time O(n²). Assume x is out from the queue after z and before y. w Lucky scan (x,y) and stop. Output: Min-Cycle Unlucky scan (x,w) and stop. Output: Min-Cycle+1 Unweighted undirected.

Lingas & Lundell 2-Approximataion s xyz The same approach as IR with Dijkstra instead of BFS will not work. Lingas & Lundell: Run Dijkstra with a bounding parameter t, that is, grow a shortest paths tree up to depth t and report the first cycle detected. w Weighted [1,M] undirected

Dijkstra(G,s) Q←{s} While Q is not empty do u ← Extract-Min(Q) Relax(u) Reminder: Dijkstra’s algorithm Weighted [1,M] undirected. Relax(u) foreach (u,v)  E if d[s,v]>d[s,u]+w(u,v) d[s,v] ← d[s,u]+w(u,v)

Bounded Dijkstra(G,s,t) Q←{s} While Q is not empty do u ← Extract-Min(Q) Controlled-Relax(u,t) Lingas & Lundell 2-Approximataion Weighted [1,M] undirected. Controlled-Relax(u,t) (u,v) ← Extract-Min(Q u ) While d[u]+w(u,v) ≤ t do RelaxOrStop(u,v) (u,v) ← Extract-Min(Q u ) RelaxOrStop(u,v) if d[v]   then Repot a cycle and stop else Relax(u,v) s u 1 3 X1X1 X2X2 X3X3 d[X 1 ] =  d[X 2 ] =92 4 d[X 3 ] =70 50 d[X 1 ] = 51 STOP: Min-Cycle≤145 t=100

Lingas & Lundell 2-Approximataion Weighted [1,M] undirected. s 50 1 ? t=100 Bounded Dijkstra with t=100 might find the red cycle and not the blue one.

Lingas & Lundell 2-Approximataion Weighted [1,M] undirected. The algorithm: Binary search the interval [1,nM] for the smallest value of t for which Bounded Dijkstra reports a cycle. t * =Min-Cycle Always reports ½t * May report Taking the smallest value of t for which a cycle is reported ensures that t≤t * and a 2-approximation. Running time: O(n² log n (log n+log M))

Our 4/3-Approximataion Weighted [1,M] undirected. Let Min-Cycle=t * and Max-Edge(Min-Cycle)=w *. Let t  t *. We present two algorithms: Alg1: Reports a cycle of weight at most t * + w *. Alg2: Given w l and w u such that w *  [ w l, w u ] reports a cycle of weight at most max{2t * - 2w l, t * + w u - w l }. Notice! max{2t * - 2w l, t * + w u - w l } is 2t * - 2w l as long as w u ≤ t * - w l w*w* Alg 1 t * + w * ≤1⅓t * w*w* Alg 2 [ ⅓ t *, ⅔t * ] 2t * - 2w * ≤1⅓t * t*t* ⅓t*⅓t* ⅔t*⅔t* w*w* Alg 2 [ ⅔t *, t * ] t * + t * - ⅔t * ≤1⅓t *

Our 4/3-Approximataion: Alg1 (t* + w*) Weighted [1,M] undirected. Middle Edge Lemma: Let C={v 1,v 2,…v ℓ } be a cycle of weight t and let s  C. Then there exists an edge (v i,v i+1 ) such that: s vivi v i+1 d[s,v i ]≤ ½ t d[s,v i+1 ]≤ ½ t

Our 4/3-Approximataion: Alg1 (t* + w*) Weighted [1,M] undirected. For a given s there is a mid point in on the cycle s =t*/2

Our 4/3-Approximataion: Alg1 (t* + w*) Weighted [1,M] undirected. s t*/2= =t*/2 For a given s there is a mid point in on the cycle

Our 4/3-Approximataion: Alg1 (t* + w*) Weighted [1,M] undirected. The edge (v i,v i+1 ) is the middle edge. s vivi v i+1 We have: 1. d C [s,v i ] ≤ ½ t 2. d C [v i+1,s] ≤ ½ t 1. d[s,v i ] ≤ ½ t 2. d[s,v i+1 ] ≤½ t

Our 4/3-Approximataion: Alg1 (t* + w*) Weighted [1,M] undirected. And now, the algorithm! Approx-Min-Cycle(G,s,t) R ←ф Q←{s} While Q is not empty do u ← Extract-Min(Q) Controlled-Relax(u,½t) Let (u,v) be the smallest edge of u that was not relaxed R←{(u,v)} While R is not empty do (u,v) ← Extract-Min(R) RelaxOrStop(u,v) (u,v) ← Extract-Min(Q u ) R← R  {(u,v)} Phase 1 Phase 2

Approx-Min-Cycle(G,s,t) R ←ф Q←{s} While Q is not empty do u ← Extract-Min(Q) Controlled-Relax(u,½t) Let (u,v) be the smallest edge of u that was not relaxed R← R  {(u,v)} … Our 4/3-Approximataion: Alg1 (t* + w*) Weighted [1,M] undirected. Phase 1: Bounded Dijkstra(G,s,t) Q←{s} While Q is not empty do u ← Extract-Min(Q) Controlled-Relax(u,t) s ½t u0u0 v0v0 w u1u1 u2u2 v1v1 v2v2 R = {(u 0,v 0 ), (u 1,v 1 ), (u 2,v 2 ) } R = {(u 0,v 0 )}

Our 4/3-Approximataion: Alg1 (t* + w*) Weighted [1,M] undirected. Phase 2: Approx-Min-Cycle(G,s,t) … While R is not empty do (u,v) ← Extract-Min(R) RelaxOrStop(u,v) (u,v) ← Extract-Min(Q u ) R← R  {(u,v)} s ½t½t u0u0 v0v0 w u1u1 u2u2 v1v1 v2v2 R = {(u 0,v 0 ), (u 1,v 1 ), (u 2,v 2 ) } R = {(u 0,v 0 ), (u 1,v 2 ), (u 2,v 2 ) } R = {(u 0,v 0 ), (u 1,v 2 ) } R = {(u 0,v 0 )}

Our 4/3-Approximataion: Alg1 (t* + w*) Weighted [1,M] undirected. We need to prove that: We report a cycle of weight t * +w * (Weight bound). The running time from a given vertex is Õ(n) (Running time). A bound on the weight: Approx-Min-Cycle(G,s,t) R ←ф Q←{s} While Q is not empty do u ← Extract-Min(Q) Controlled-Relax(u,½t) (1) R←{(u,v)} Phase 1: … While R is not empty do (u,v) ← Extract-Min(R) RelaxOrStop(u,v)(2) (u,v) ← Extract-Min(Q u ) R←{(u,v)} Phase 2: A cycle can be reported either in line (1) or (2). Easy case (line 1): We stopped in line (1). The weight of the reported cycle is at most t. Hard case (line 2): Next slide.

Our 4/3-Approximataion: Alg1 (t* + w*) Weighted [1,M] undirected. Hard case (line 2): If we stopped at phase 2 before the middle edge (v i,v i+1 ) of s got out then any edge (x,y) that was popped out from R satisfies: d[s,x]+w(x,y) ≤ min {d[s,v i ]+w *,d[s,v i+1 ]+w * } In particular, if we stopped with the edge (h,g) then: d[s,h]+w(h,g)+d[s,g] ≤ 2 min {d[s,v i ]+w *,d[s,v i+1 ]+w * } ≤ d[s,v i ]+2w * +d[s,v i+1 ] ≤ t * +w * s vivi v i+1 ½t*  ≤½t* ≤w * s h g Phase 1

Our 4/3-Approximataion: Alg1 (t* + w*) Weighted [1,M] undirected. Running time: The first time that a vertex beyond the ½t threshold is added to R for the second time we stop and report a cycle. Hence, we can charge any edge of R to its endpoint beyond the ½t threshold and the running time is Õ(n). R = {(u 0,v 0 ), (u 1,v 1 ), (u 2,v 2 ) } s ½t½t u0u0 v0v0 w u1u1 u2u2 v1v1 v2v2

Our 4/3-Approximataion: Alg1 (t* + w*) Weighted [1,M] undirected. Summary: We have shown that given t  t* in Õ(n²) time it is possible to return a cycle of weight t* + w* This algorithm is a natural generalization of the additive 1-approximation of Itai and Rodeh for unweighted graphs. Recall that this is just one ingredient of our algorithm.

Our 4/3-Approximataion: Alg2 ( max{2t * - 2w l, t * + w u - w l } ). Weighted [1,M] undirected. Approx-Min-Cycle(G,s,t,w l,w u ) d[s] = 0 Controlled-Relax(s,w u ) While Q is not empty do u ← Extract-Min(Q) Controlled-Relax(u,t-w l ) Sketch: Analysis: More complicated. Some intuition: when a cycle is reported it is because we reach some vertex u twice. The bound is either 2t * - 2w l or t * + w u - w l. s=v i v i+1 =w * w *  [w l,w u ]

In this talk For undirected graphs with weights from [1,M] a 4/3-approximation algorithm with a running time of O(n² log n log nM). (SODA’11) For undirected graphs with weights from [1,M] we show that the Min-Cycle problem can be efficiently reduced to finding a minimum weight triangle in graph with weights [1,Θ(M)]. (New result)

Weighted [1,M] undirected. Theorem: Given an undirected graph G with weights [1,M] there is an O(n² log n log nM) time algorithm that either find a Min-Cycle in G or compute log n graphs: G’ 1, G’ 2,G’ 3,... G’ log n With Θ(n) nodes and edge weights [1,O(M)] such that: The minimum weight triangle among all G’ i graphs has the same weight as the Min-Cycle of G. Min-Cycle to Min-Triangle

Simple (and important) observation: Assume that we run just the first phase of Alg1 (t * +w * ) for a given t. We either compute all distances of length at most ½t from s or report a cycle of weight at most t. Weighted [1,M] undirected. Min-Cycle to Min-Triangle Approx-Min-Cycle(G,s,t) R ←ф Q←{s} While Q is not empty do u ← Extract-Min(Q) Controlled-Relax(u,½t) Let (u,v) be the smallest edge of u that was not relaxed R←{(u,v)} While R is not empty do (u,v) ← Extract-Min(R) RelaxOrStop(u,v) (u,v) ← Extract-Min(Q u ) R←{(u,v)} Approx-Min-Cycle(G,s,t) Q←{s} While Q is not empty do u ← Extract-Min(Q) Controlled-Relax(u,½t)

First stage: Binary search for the first t such that Approx-Min-Cycle(G,2t) does not report on a cycle and Approx-Min-Cycle(G,2t+2) reports. Weighted [1,M] undirected. Min-Cycle to Min-Triangle t+1 Report a cycle ≤2t+2 t No cycle is reported. All distances up to t are computed Need to show: If the Min-Cycle ≤ 2t+1 we can find it.

vjvj vivi v i+1 Main Lemma: Let C={v 1,v 2, …,v ℓ } and assume that Approx-Min-Cycle(G,t) does not report a cycle then there are three distinct vertices v i,v i+1, and v j  C such that: d C [v j,v i ]+w(v i,v i+1 )>t and d C [v i+1,v j ]+w(v i,v i+1 )>t Weighted [1,M] undirected. Min-Cycle to Min-Triangle ≤ 2t+1

vjvj vivi v i+1 Main Lemma: Let C={v 1,v 2, …,v ℓ } and assume that Approx-Min-Cycle(G,t) does not report a cycle then there are three distinct vertices v i,v i+1, and v j  C such that: d C [v j,v i ]+w(v i,v i+1 )>t and d C [v i+1,v j ]+w(v i,v i+1 )>t Weighted [1,M] undirected. Min-Cycle to Min-Triangle ≤ 2t+1 d C [v j,v i ] ≤ t d C [v i+1,v j ] ≤ t As this is a Min-Cycle d[v j,v i ] = d C [v j,v i ] d [v i+1,v j ]=d C [v i+1,v j ] and we have computed these distances !

Create a new graph G’: Weighted [1,M] undirected. Min-Cycle to Min-Triangle vjvj vivi v i+1 v2iv2i v1jv1j v 2 i+1 (V 1,ø) (V 2,E) Distances 

There are two problems with G’. We may create a triangle that corresponds to a path rather than a cycle The weights in G’ may be Ω(nM) (not covered in the talk) Weighted [1,M] undirected. Min-Cycle to Min-Triangle

Fixing the first problem: The last vertex on the path to z is y. We use color coding (Alon, Yuster and Zwick JACM`95 ). We use two colors. Weighted [1,M] undirected. Min-Cycle to Min-Triangle x1x1 y2y2 z2z2 y (V 1,ø) (V 2,E) Distances  We add an edge (x 1,z 2 ) only if the last vertex before z is red y cannot be red and blue at the same time! x y z

We avoid the bad case and remain with the good case Weighted [1,M] undirected. Min-Cycle to Min-Triangle vjvj vivi v i+1

Summary We have settled many variants of a fundamental open problem in algorithmic graph theory. But, what about approximation in directed graphs? Can we get O(n 3-δ ) for some δ>0 and constant approximation? Or maybe we can show a “lower” bound.

Thank you!

Our 4/3-Approximataion: Alg1 (t* + w*) Weighted [1,M] undirected. Proof: Let (v i,v i+1 ) be an edge of C with weight strictly more than ½ t. In this case the claim holds for every vertex using this edge. Thus, we can assume that w*≤ ½ t. s=v 1 vivi v i+1 v2v2 v3v3 1. d C [s,v i ] ≤ ½ t 2. d C [s,v i+1 ]> ½ t We search for two vertices that satisfy: 1. d[s,v i ] ≤ d C [s,v i ] ≤ ½ t 2. d[s,v i+1 ] ≤½ t

Our 4/3-Approximataion: Alg1 (t* + w*) Weighted [1,M] undirected. Proof (cont): To complete the proof we need to show that these vertices exist. Assume on the contrary that we have not found two such vertices in the process. s=v 1 vivi v i+1 v2v2 v3v3 This means that: 1. d C [s,v ℓ-1 ] ≤ ½ t 2. d C [s,v ℓ ] ≤ ½ t A contradiction as w* ≤ ½ t vℓvℓ v ℓ-1 > ½ t