Min Cut, Fast Cut, Polynomial Identities

Similar documents
Finding Dense Subgraphs in G(n, 1/2)

Problem Set 9 Solutions

Calculation of time complexity (3%)

Complete subgraphs in multipartite graphs

Expected Value and Variance

U.C. Berkeley CS294: Beyond Worst-Case Analysis Luca Trevisan September 5, 2017

Finding Primitive Roots Pseudo-Deterministically

Exercises of Chapter 2

Edge Isoperimetric Inequalities

Dynamic Programming. Preview. Dynamic Programming. Dynamic Programming. Dynamic Programming (Example: Fibonacci Sequence)

Chapter 5. Solution of System of Linear Equations. Module No. 6. Solution of Inconsistent and Ill Conditioned Systems

Lecture 5 Decoding Binary BCH Codes

An efficient algorithm for multivariate Maclaurin Newton transformation

COS 521: Advanced Algorithms Game Theory and Linear Programming

Lecture 4: Universal Hash Functions/Streaming Cont d

U.C. Berkeley CS294: Spectral Methods and Expanders Handout 8 Luca Trevisan February 17, 2016

APPENDIX A Some Linear Algebra

Stanford University CS359G: Graph Partitioning and Expanders Handout 4 Luca Trevisan January 13, 2011

Math 217 Fall 2013 Homework 2 Solutions

Notes on Frequency Estimation in Data Streams

THE CHINESE REMAINDER THEOREM. We should thank the Chinese for their wonderful remainder theorem. Glenn Stevens

Exercises. 18 Algorithms

Lecture Notes on Linear Regression

n α j x j = 0 j=1 has a nontrivial solution. Here A is the n k matrix whose jth column is the vector for all t j=0

A new construction of 3-separable matrices via an improved decoding of Macula s construction

U.C. Berkeley CS294: Beyond Worst-Case Analysis Handout 6 Luca Trevisan September 12, 2017

Lecture Space-Bounded Derandomization

Example: (13320, 22140) =? Solution #1: The divisors of are 1, 2, 3, 4, 5, 6, 9, 10, 12, 15, 18, 20, 27, 30, 36, 41,

NP-Completeness : Proofs

2.3 Nilpotent endomorphisms

arxiv: v1 [math.co] 1 Mar 2014

MASSACHUSETTS INSTITUTE OF TECHNOLOGY 6.265/15.070J Fall 2013 Lecture 12 10/21/2013. Martingale Concentration Inequalities and Applications

Lecture 3. Ax x i a i. i i

More metrics on cartesian products

A combinatorial problem associated with nonograms

2E Pattern Recognition Solutions to Introduction to Pattern Recognition, Chapter 2: Bayesian pattern classification

A 2D Bounded Linear Program (H,c) 2D Linear Programming

Problem Do any of the following determine homomorphisms from GL n (C) to GL n (C)?

Difference Equations

DISCRIMINANTS AND RAMIFIED PRIMES. 1. Introduction A prime number p is said to be ramified in a number field K if the prime ideal factorization

Case A. P k = Ni ( 2L i k 1 ) + (# big cells) 10d 2 P k.

3.1 Expectation of Functions of Several Random Variables. )' be a k-dimensional discrete or continuous random vector, with joint PMF p (, E X E X1 E X

The Minimum Universal Cost Flow in an Infeasible Flow Network

CHAPTER 17 Amortized Analysis

REAL ANALYSIS I HOMEWORK 1

Formulas for the Determinant

U.C. Berkeley CS278: Computational Complexity Professor Luca Trevisan 2/21/2008. Notes for Lecture 8

Grover s Algorithm + Quantum Zeno Effect + Vaidman

= z 20 z n. (k 20) + 4 z k = 4

Randomness and Computation

Bézier curves. Michael S. Floater. September 10, These notes provide an introduction to Bézier curves. i=0

Bezier curves. Michael S. Floater. August 25, These notes provide an introduction to Bezier curves. i=0

a b a In case b 0, a being divisible by b is the same as to say that

Spectral Graph Theory and its Applications September 16, Lecture 5

Lecture 10: May 6, 2013

Module 9. Lecture 6. Duality in Assignment Problems

Introduction to Algorithms

Every planar graph is 4-colourable a proof without computer

A New Refinement of Jacobi Method for Solution of Linear System Equations AX=b

Stanford University CS254: Computational Complexity Notes 7 Luca Trevisan January 29, Notes for Lecture 7

Matrix Approximation via Sampling, Subspace Embedding. 1 Solving Linear Systems Using SVD

Yong Joon Ryang. 1. Introduction Consider the multicommodity transportation problem with convex quadratic cost function. 1 2 (x x0 ) T Q(x x 0 )

18.1 Introduction and Recap

10-701/ Machine Learning, Fall 2005 Homework 3

Lectures - Week 4 Matrix norms, Conditioning, Vector Spaces, Linear Independence, Spanning sets and Basis, Null space and Range of a Matrix

General viscosity iterative method for a sequence of quasi-nonexpansive mappings

Approximation Algorithms for Spanner Problems and Directed Steiner Forest

Estimation: Part 2. Chapter GREG estimation

College of Computer & Information Science Fall 2009 Northeastern University 20 October 2009

HMMT February 2016 February 20, 2016

Multilayer Perceptron (MLP)

E Tail Inequalities. E.1 Markov s Inequality. Non-Lecture E: Tail Inequalities

Lecture 4: Constant Time SVD Approximation

CHAPTER 5 NUMERICAL EVALUATION OF DYNAMIC RESPONSE

Counterexamples to the Connectivity Conjecture of the Mixed Cells

Homework Notes Week 7

The Multiple Classical Linear Regression Model (CLRM): Specification and Assumptions. 1. Introduction

ISSN: ISO 9001:2008 Certified International Journal of Engineering and Innovative Technology (IJEIT) Volume 3, Issue 1, July 2013

Foundations of Arithmetic

Mixed-integer vertex covers on bipartite graphs

Modelli Clamfim Equazione del Calore Lezione ottobre 2014

Report on Image warping

THE WEIGHTED WEAK TYPE INEQUALITY FOR THE STRONG MAXIMAL FUNCTION

Suggested solutions for the exam in SF2863 Systems Engineering. June 12,

Randić Energy and Randić Estrada Index of a Graph

On the Interval Zoro Symmetric Single-step Procedure for Simultaneous Finding of Polynomial Zeros

NUMERICAL DIFFERENTIATION

Subset Topological Spaces and Kakutani s Theorem

Communication Complexity 16:198: February Lecture 4. x ij y ij

The Second Eigenvalue of Planar Graphs

First day August 1, Problems and Solutions

MMA and GCMMA two methods for nonlinear optimization

5 The Rational Canonical Form

Lecture 12: Discrete Laplacian

Lecture 3 January 31, 2017

STAT 309: MATHEMATICAL COMPUTATIONS I FALL 2018 LECTURE 16

1 Matrix representations of canonical matrices

Statistical Mechanics and Combinatorics : Lecture III

Outline and Reading. Dynamic Programming. Dynamic Programming revealed. Computing Fibonacci. The General Dynamic Programming Technique

Review of Taylor Series. Read Section 1.2

Transcription:

Randomzed Algorthms, Summer 016 Mn Cut, Fast Cut, Polynomal Identtes Instructor: Thomas Kesselhem and Kurt Mehlhorn 1 Mn Cuts n Graphs Lecture (5 pages) Throughout ths secton, G = (V, E) s a mult-graph. A cut of G s a bpartton (S, S) of the vertex set of G. The capacty of a cut s the number of edges havng one endpont on both sdes of the cut. A mn-cut s a cut of mnmum capacty. A mnmum cut can be computed wth the help of maxflow computatons. For some vertex s and every other vertex t, one computes the mnmum cut separatng s from t, and then takes the smallest cut obtaned n ths way. There are better determnstc algorthms, see for example [SW97] and [MN99, Secton 7.1] Karger and Sten [KS96] found a smple and effcent randomzed algorthm. We wll ntroduce ther algorthm n two steps. We frst descrbe an extremely smple algorthms that fnds the mnmum cut wth a nonzero, but small probablty. In a second step, we wll show how to ncrease the success probablty. The resultng algorthm s a Monte Carlo algorthm. It fnds the mnmum cut wth good probablty, but s not guaranteed to fnd the mnmum cut. 1.1 A Frst Algorthm Ths secton follows Secton 1.1 n Motwan/Raghavan and Secton 1.4 n Mtzenmacher/Upfal. The algorthm contracts edges untl a graph wth only two vertces s obtaned. It then returns the resultng cut. Let e = (u, v) be an edge of G. Contracton of e produces a graph wth one less vertex, namely vertces u and v are removed and all edges connectng u and v are removed. A new vertex z s added and all edges ncdent to ether u and v (except those connectng u and v) are made ncdent to z. After a sequence of contractons, every vertex of the current graph represents a set of vertces of the orgnal graph. It s easy to keep track of ths set usng lnear lsts. defne S v = {v} for all vertces v of G; whle V 3 do choose a random edge e = (u, v) and contract t; let z be the new vertex and defne S z = S u S v ; end whle let u and v be the two remanng vertces; return (S u, S v ). Fgure 1: The contracton algorthm for fndng mn-cuts. Theorem.1. Let (S, S) be a fxed mn-cut n G. The algorthm above returns ths cut wth probablty at least n(n 1). Proof. Let C be the set of edges of the mn-cut,.e., the set of edges havng exactly one endpont n S and one endpont n S, and let k be ts capacty. The algorthm fnds the cut f and only f t never contracts an edge n C. Let G n = G, G n 1, G n,..., G 3, G be the sequence of graphs generated by the algorthm. The followng Lemma s key for the analyss. Lemma.. Let k be the capacty of the mnmum cut of a graph G. Then G has at least nk/ edges. Proof. For any vertex v, consder the cut (v, V \ v). Its capacty s at least k. Thus every vertex has degree at least k and hence G has at least nk/ edges. Let E be the event that no vertex of G (nterpreted as a set of vertces of G) ntersects S and S. In other words, every vertex of G s ether a subset of S or S. In other words, the edges n C are edges

Randomzed Algorthms, Summer 016 Lecture (page of 5) of G. The event E occurs f and only f the algorthm returns the cut (S, S). We want to lower bound the probablty of the event E. The probablty of the event E n s 1. Also, Pr [E ] = Pr [E E 3 ] Pr [E 3 ] E 4 Pr [E n 1 ] E n Pr [E n ]. Assume E and let m be the number of edges of G. Then m k/ snce G has a vertces and hence Pr [E 1 E ] = m k m k/ k k/ =. Thus Pr [E ] 1 3 4... n = n n(n 1) = ( 1 n ). Let N = ( n ). The smple contracton algorthm returns any partcular mn-cut wth probablty at least 1/N. Ths has a somewhat surprsng consequence. There are at most n(n 1)/ dstnct mn-cuts. Is there any use n an algorthm that has a success guarantee as low as Θ(1/n )? We could run t many tmes and return the best cut found. After an expected number of ( n ) repettons, we have seen a mn-cut at least once. But now the runnng tme s at least n 3 and ths s slower than the best determnstc algorthm. Let us do αn ln n repettons. Then the probablty that we have not seen a mn-cut s (1 1 N )αn ln n ( ) α ln n 1 = 1 e n α. Exercse 1. Show how to mplement the smple contracton algorthm so that t runs n near lnear tme O((n + m)α(n + m)). You may assume that you for any gven L you can choose a random nteger n {1,..., L} n tme O(1). Store the graph as an array of edges. Each edge knows ts two endponts n the orgnal graph. Each vertex has a lst of ts ncdent edges. After a contracton, somehow reorder the edges. Use a unon-fnd data structure to keep track of the set of vertces represented by a vertex of the current graph. 1. FastCut Ths secton follows Secton 10. n Motwan/Raghavan. There s a more clever way to ncrease the success probablty. Note that n the frst teraton the probablty that we do not destroy the cut (S, S) s at least n /n. Ths s close to one. The probablty that the cut stll exsts n G t s Pr [E t ] = Pr [E t E t+1 ] Pr [E t+1 E t+ ] Pr [E n 1 E n ] Pr [E n ] t 1 t + 1 n n (t 1)t = (n 1)n. Lemma.3. Let (S, S) be a mn-cut n G. The probablty that the cut stll exsts n G t s Ω(t /n ). In partcular, for t = n/, the probablty s at least 1/. I am gnorng here the fact that t must be an nteger. For the detals, I refer to Motwan/Raghavan. In order to obtan a reasonable success guarantee for the smple contracton algorthm, one needs to run many copes of t. Contracton makes mstakes near the end of the sequence of contractons. At the begnnng the chance of an error s low. Ths suggests to run only a small number of copes of the smple algorthm n parallel as long as the graph s stll large and to ncrease the number as the graph becomes smaller. Algorthm FastCut realzes ths dea as follows. It makes a copy of G and then runs the contracton algorthm on both copes untl the number of vertces s reduced to t = n/. It then nvokes the algorthm recursvely on the graphs obtaned,.e., t makes two copes of each graph and then runs the contracton algorthm on all four graphs untl the number of vertces s reduced to t/ = n/. Then t makes two copes of each of the resultng graphs and runs the contracton algorthm on each of the

Randomzed Algorthms, Summer 016 Lecture (page 3 of 5) eght graphs untl the number of vertces s reduced to (n/)/. The recurson ends once the resultng graphs have only a constant number of vertces (n = 6 works). For such small graphs, the exact mn-cut s computed usng a determnstc algorthm. What s the runnng tme of ths algorthm? What s ts success probablty? The recurson depth s log n as the sze of the graphs s reduced by a factor of 1/ between recursve calls. We wll not analyze the tme complexty, but only upper bound the total number of vertces n all the graphs constructed. Let V (n) be the maxmum number of vertces constructed. Then V (n) n + V (n/ ) = O(n ). We double the number of subproblems at each recurson step but reduce the sze only by a factor of. Thus the total sze of the problems grows n each recurson step by a factor of. Snce the recurson depth s log n, the growth s by a factor of log n = n. We start wth a problem of sze n and end up wth total sze n. The bottom of the recurson domnates. Formally, V (n) n + V (n/ ) = (n + V (n/ ) = (n + (n/ + V (n/ )) (n + 1 n + n +...) = n = n 1 log n 1 log n = O(n log n ) = O(n ). In comparson, runnng the smple contracton algorthm n tmes wll construct Θ(n 3 ) vertces. Let us now turn to the success probablty. Let P (n) be the probablty that the algorthms returns a mn-cut when appled to a graph wth n vertces. Then P (n 0 ) = 1, when we stop the recurson at n 0 vertces. The algorthm returns a mn-cut, f the mn-cut survves one of the contractons from n to t = n/ vertces (probablty 1/ for each of the contracton sequences) and the correspondng recursve call returns a mn-cut (probablty P (n/ )). Thus a branch fals wth probablty 1 1 P (n/ ) and hence both branches fals wth probablty (1 1 P (n/ )). Thus P (n) 1 (1 1 P (n/ )). How can one solve such a recurrence? The frst step s always a change of varables. Instead of ndexng by problem sze, we ndex by the depth of the recurson. Defne p(k) = P (n), where k = log n O(1) s the recurson depth. We also replace the nequalty by an equalty. Then p(k) = 1 (1 1 p(k 1)) = p(k 1) p(k 1). 4 Ths looks already much smpler. The p k are decreasng and converge to zero. Also p(0) = 1. It s usually easer to work wth large quanttes and therefore we defne q(k) = 1/p(k). Then q(0) = 1 and (after a short calculaton) q(k) = q(k 1) + 1 4 + 1 16q(k 1) 4. Thus q(k) 1 + k/4 and q(k) 1 + k/ as a smple nducton shows. 1 p(k) = Θ(1/k) and hence P (n) = Θ( 1 log n ). Theorem.4. Algorthm Fast-Cut returns a mn-cut wth probablty Ω(1/ log n). So q(k) = Θ(k) and hence Exercse. How often do you have to run the algorthm n order to ncrease the success probablty to 1/ or to 1/n, respectvely. 1 Snce q(k) 1 for all k, we have q(k) q(k 1)+1/4. Thus q(k) 1+k/4. Snce q(k) 1, we have 1/(16q(k 1) 4) 1/4 and hence q(k) 1 + k/.

Randomzed Algorthms, Summer 016 Lecture (page 4 of 5) Requre: S and T are multsets of sze n n {0,... m 1}; p s a prme greater or equal to m. Construct the polynomals S(x) and T (x) as descrbed n the text. Choose a random α Z p and computer S(α) mod p and T (α) mod p. If S(α) T (α) mod p, declare S T. Ths answer s correct. If S(α) = T (α) mod p, return that the two sets are equal. Ths answer may be ncorrect. Fgure : An algorthm for decdng whether two sets S and T are equal. Set Equalty and Polynomal Identtes Ths secton summarzes Sectons 7.1 and 7. n Motwan/Raghavan. Let S and T be two equal-szed mult-sets of ntegers n the range 0 to m 1. Let n = S = T. We want to decde whether S and T are equal. The standard determnstc soluton s to sort S and T and then decde equalty by a lnear scan over the sequences. If bucket sort s used, ths takes tme O(n + m), where n = S = T. Wth randomzaton, we can do dfferently. We assocate a polynomal of degree n wth each set, namely S(x) = (x z) T (x) = z) z S z T(x and consder ther dfference D(x) = S(x) T (x). If the sets S and T are equal, the polynomals S(x) and T (x) are dentcal and hence D(x) s dentcally zero. If S and T are not equal, D(x) s non-vanshng and hence has at most n roots. Theorem.5. Let p be a prme greater or equal to m. Let D(x) = 0 a x wth a Z p for all and a n 0 be a polynomal. Let D(x) = 1 n (x α ) be a factorzaton of D(x) over Z p. Then D(α) 0 mod p for α {α 1,..., α n }. In partcular, Pr [D(α) 0 mod p] p n p = 1 n p. For ths statement t s assumed that α s chosen unformly from Z p. Assume S T. Then D(x) = 0 a x wth a 0 mod p for some. Proof. Z p s a feld and n a feld a product s zero f and only f one of the factors s zero. Thus D(α) = 0 mod p mples α = α for some. For the second part, let C be the ntersecton of S and T. For example, f S = {,, 3} and T = {, 3, 3}, C = {, 3}. Wrte S = C S and T = C T. Then S and T are dsjont and D(x) = S(x) T (x) = z C(x ( ) z) (x z) (x z) = C(x)D (x). z S z T By the frst part, there are at most C elements α for whch C(α) = 0. The polynomal D (x) has degree at most n C. It s non-vanshng, snce for any z T, we have D (z) = S (z) T (z) = S (z) 0 mod p. Thus there are at most n C elements α wth D (α) = 0. We conclude that there are at most n elements α for whch D(α) = 0 mod p. Thus D s non-vanshng. The theorem above s readly extended to multvarate polynomals. Theorem.6 (Schwartz-Zppel). Let Q(x 1,..., x n ) be a non-vanshng multvarate polynomal wth coeffcents n the feld F of total degree d,.e., for any monomal x e1 1... xen n of Q, we have e n. Let S F be a fnte set. For r 1 to r n chosen ndependently and unformly at random from S, we have Pr [Q(r 1,..., r n ) = 0] If p s not a prme, Z p s not a feld and ths s not true. Take p = 100. Then 10 = 100 = 0 mod 100 and hence x(x 0) = x 0x = x 0x + 100 = (x 10)(x 10) mod 100. Thus the polynomal D(x) = x 0x has several factorzatons. d S.

Randomzed Algorthms, Summer 016 Lecture (page 5 of 5) Proof. The proof s by nducton on the number of varables. A non-vanshng unvarate polynomal of degree d has at most d roots. Ths establshes the result for n = 1. If n > 1, we wrte the polynomal as a polynomal n the varable x n, say Q(x 1,..., x n ) = Q (x 1,..., x n 1 )x n, 0 k where the degree of Q n x n s equal to k. Then Q k (x 1,..., x n 1 ) s non-vanshng and ts total degree s at most d k. Consder now a random tuple (r 1,..., r n ). If Q(r 1,..., r n ) = 0 then ether Q k (r 1,..., r n ) = 0 or r n s a zero of the non-vanshng polynomal 0 k Q (r 1,..., r n 1 )x n of degree k. The former probablty s at most (d k)/ S and the later probablty s at most k/ S. Thus Pr [Q(r 1,..., r n ) = 0] Pr [Q k (r 1,..., r n 1 ) = 0] + Pr Q (r 1,..., r n 1 )rn = 0 Q k(r 1,..., r n 1 ) = 0 d k S + k S = d S. 0 k A useful specal case s as follows. Theorem.7. Let u Z n p be a nonzero vector. For a vector r Z n p of n ndependently chosen random components, Pr [ u T r 0 ] = 1/p. Proof. We could appeal to Schwarz-Zppel wth S = Z p and d = 1. Let us gve a drect proof. Assume u 0. Then u T r = 0 ff u r = ( ) j u jr j ff r = j u jr j /u. For fxed r j, j, there s thus one exactly choce for r. Thus Pr [ u T r = 0 ] = 1/p. Theorem.7 leads to an effcent randomzed algorthm for checkng matrx products. Requre: A, B, and C are n n matrces over Z p, where p s a prme. Ensure: decde f A = B C. choose a random vector r Z n p and compute Ar and B(Cr). The latter s two matrx-vector products. return equal f Ar = B(Cr) and unequal otherwse. Fgure 3: An algorthm for verfyng matrx products. If A = B C, the algorthm always returns equal. However, f A B C, t may also return equal. Thus the algorthm s a Monte Carlo algorthm (t may gve the wrong answer) wth one-sded error (the answer unequal s always correct, however, the answer equal may be ncorrect.). Theorem.8 (Frewalds). The probablty that the algorthm ncorrectly returns equal s at most 1/p. Proof. Let D = A B C and assume D 0. Pr [ u T r 0 ] = 1/p. Then D has at least one nonzero row, say u, and References [KS96] D.R. Karger and C. Sten. A new approach to the mnmum cut problem. Journal of the ACM, 43(4):601 640, 1996. [MN99] K. Mehlhorn and S. Näher. The LEDA Platform for Combnatoral and Geometrc Computng. Cambrdge Unversty Press, 1999. [SW97] M. Stoer and F. Wagner. A smple mn-cut algorthm. Journal of the ACM, 44(4):585 591, July 1997.