510 likes | 619 Views
Property Testing and its Connection to Learning and Approximation. Oded Goldreich Shafi Goldwasser Dana Ron February 13, 1998 Max-Cut Property Testing by Ori Rosen. Table of Contents. Introduction Definitions Graph Partitioning Algorithm Max-Cut Approximation Algorithm
E N D
Property Testing and its Connection to Learning and Approximation OdedGoldreich ShafiGoldwasser Dana Ron February 13, 1998 Max-Cut Property Testing by Ori Rosen
Table of Contents • Introduction • Definitions • Graph Partitioning Algorithm • Max-Cut Approximation Algorithm • Property Testing MCρ
Introduction • Definition of the max-cut problem: • For a graph, a maximum cut is a cut whose size is not smaller than the size of any other cut. • Size cut definition: • For graph G, the size of a cut is the number of edges between S, a subset of V(G), and the complementary subset. = 3
Introduction • We will see a property testing of Max-Cut. • First, we are shown an algorithm that “ideally” finds the max-cut by “cheating” with additional information. • The above algorithm is then modified to approximatethe size of the Max-Cut without further information. • Last, we’ll see a usage of the Max-Cut algorithm to test for MCρ. * We will consider our graphs to be dense (with at least εN2 edges), the input graph is given in terms of its adjacency matrix, and a query consists of verifying if the edge (u,v) belongs to E(G).
Definitions • Edge density definition: • For a given partition (V1,V2) of V(G), we define µ(V1,V2) to be the edge density of the cut defined by (V1,V2) – • Let µ(G) denote the edge density of the largest cut in G, meaning it is the largest µ(V1,V2) taken over all partitions of (V1,V2) of V(G).
Definitions G μ(G) = ? G μ(G) = 6/42 = 6/16
Graph Partitioning Algorithm • We will now see a quadratic-time graph partitioning algorithm, with running time : • Given a graph G, the algorithm returns a cut with edge density of at least μ(G) – (¾)*ε, with probability at least 1 - δ .
Graph Partitioning Algorithm • Let , and let (V1,…,Vl) be a fixed partition of V(G) into l sets of (roughly) equal size. • The algorithm constructs a partition (V1,V2) in l iterations. • In the i’th iteration we construct a partition (V1i,V2i) of Vi .
Graph Partitioning Algorithm • Observation: • Let (H1,H2) be a partition of V(G). Let v in H1 and assume that the number of neighbors of v in H2 is the same or more than in H1, meaning – • Then, if we move v from H1 to H2, we cannot decrease the edge density, but we might increase it – => The addition to edge density from new edges brought into the cut from moving v to H2
Graph Partitioning Algorithm • Expanding on the previous observation, we will see what happens when we move Θ(εN) vertices. • In contrast to moving a single vertex, the cut maydecrease by O(ε2N2) per stage. • The algorithm is oracle-aided and will work in O(1/ε) stages. It will be viewed as starting from a partition that matches a Max-Cut, and every stage moves O(εN) vertices. • The total decrease in cut size is bounded by O((1/ε)* ε2N) = O(εN).
Graph Partitioning Algorithm • Let X be a subset of V(G) of size N/l (assume integer). • Let W = V(G) \ X, and let (W1,W2) be a partition of W induced by (H1,H2). => • Remember, consider (H1,H2) being the Max-Cut. • Assume we know for every vertex x in X, |Γ(x)|. • Define XUB (UnBalanced) to be the set of vertices that have “many more” (for example, (ε /8)N) neighbors on one side of the partition than on the other, with respect to (W1,W2) • In contrast, we define XB = X \ XUB to be the set of balanced vertices.
Graph Partitioning Algorithm XB XUB XB XUB X 1 2 3 4 SIMPLE! 5 6 7 8 G W 9 10 11 12 W1 W2 13 14 15 16 H1 H2
Graph Partitioning Algorithm • Assume we partition X into (X1,X2) in the following way – • Vertices in XUBthat have more neighbors in W1 are put in X2, and vice versa for W2 and X1. • Vertices in XBare placed arbitrarily in W1 and W2. • Next we create a new partition – • This partition differs from (H1,H2) only in the placement of vertices in X.
Graph Partitioning Algorithm X1 X2 XB XUB XB XUB X 1 2 3 4 5 6 7 8 G W 9 10 11 12 W1 W2 13 14 15 16 H1 H2 H’1 H’2
Graph Partitioning Algorithm • Reminder: => the difference between μ(H1’,H2’) and μ(H1,H2) is only the change in number of edges between vertices in X and vertices in W, and between pairs of vertices in X. • From the construction of XUB, the number of edges crossing the cut between vertices in XUB and W cannot decrease.
Graph Partitioning Algorithm • Reminder: • From the construction of Xb, the number of cut edges between Xb and W can decrease by at most – • The number of cut edges between pairs of vertices in X can decrease by at most -
Graph Partitioning Algorithm 1 2 3 4 μ(H1,H2) = 34/162 5 6 7 8 G 9 10 11 μ(H1’,H2’) = 32/162 12 13 14 15 16 H1 H2 H’1 H’2
Graph Partitioning Algorithm • Let X be V1, let (H1,H2) define a Max-cut, and let the resulting partition we received from the process we just saw be defined by (H11,H21). • Assume we continue this process iteratively. • During the i’th iteration, we process Vi ,given the partition (H1i-1 ,H2i-1) calculated in iteration i-1. • The result from this process is that μ(H1l ,H2l) is smaller than μ(H1,H2) = μ(G) by no more than –
Graph Partitioning Algorithm XB XB XUB XB 1 2 3 4 And so on… V2 5 6 7 8 G V3 9 10 11 12 W2 W12 W22 13 14 15 16 H12 H22
Graph Partitioning Algorithm • choose l = sets U1,…,Uleach of size t = Θ(ε-2· log(εδ)-1), where Ui is chosen uniformly in V\Vi.Let Û = <U1,…,Ul>. • For each sequence of partitions of π(Û) = <(U11,U21),…,(U1l,U2l)>(where for each i, (U1i,U2i) is a partition of Ui) do: • For i = 1…l, partition Vi into two disjoints V1i and V2i as follows:For each v in Vi , • If then put v in V2i . • Else put v in V1i . • Let V1π(Û) = V1i , and let V2π(Û) = V2i . • Among all partitions (V1π(Û), V2π(Û)), created in step (2), let (V1π(Û), V2π(Û)) be the one which defines the largest cut, and output it. ~ ~
Graph Partitioning Algorithm • The algorithm we just saw has one little problem –wedon’t know what the Max-Cut isto start from, meaning (H10,H20). Because of this, we don’t know if the vertices in V1 are balanced or not. • What we can do, is approximate the number of neighbors v has on each side of (W10,W20) by sampling.
Graph Partitioning Algorithm • We will see that if we uniformly choose a set of vertices U1 of size t = poly(log(1/δ)/ε) in W0 then with high probability over the choice of U1there exists a partition (U11,U21) of U1 which is representative with respect to (W10,W20) and V1 : • For all but a small fraction of vertices v in V1, the number of neighbors v has in U11, relative to the size of U1, is approx the same as the number of neighbors v has in W10, relative to the size of V(G). • This approx is good enough, since when placing vertices in V1 , the most important factor is the location of the unbalanced vertices.
Graph Partitioning Algorithm • If U1 has a representative partition, then we say that U1 is good. • How do we know which of the 2t partitions of U1 is the representative one (if one exists)? Easy – we try them all.
Graph Partitioning Algorithm V11 V21 XB XUB XUB XB V1 U1 1 2 3 4 5 6 7 8 G W0 9 10 11 12 U11 U21 13 14 15 16
Graph Partitioning Algorithm V12 V22 XUB XB XB XUB U2 1 2 3 4 And so on… V2 5 6 7 8 G V3 9 10 11 12 U12 U22 13 14 15 16
Graph Partitioning Algorithm • Out of all the partitions of U1, namely (U11,U21), we only need the partition for which - • Denote this (hopefully representative partition) by (U11,U21). • Let (V11,V21) be the partition of V1 which is determined by this partition of U1. • Let (H11,H21) be the resulting partition of V(G).=> (H11,H21) is the same as (H10,H20) except for the placement of vertices in V1, which is as in (V11,V21).
Graph Partitioning Algorithm • If (U11,U21) is the representative one (in respect to (W10,W20) and V1), then μ(H11,H21) is not much smaller than μ(H10,H20) = μ(G). • Continuing like this, in the i’th stage we randomly pick a set Ui, and we determine a partition Vi for each of its partitions.=>We’re actually constructing (2t)l =2l*t possible partitions of V(G), one for each partition of all the Ui’s.
Graph Partitioning Algorithm • To show that at least one of these partitions defines a cut “close” to the Max-Cut, we only need to make sure that for each i, with high probability, Ui is good with respect to (W1i-1,W2i-1), where the latter partition is determined by the choice of U1 ,…,Ui-1 , and their representative partitions (U11,U21),…,(U1i-1,U2i-1). • We’ll see a lemma that formalizes the intuition we saw before on why the algorithm works.
Graph Partitioning Algorithm • Lemma 1: • Let (H1,H2) be a fixed partition of V(G).Then with probability at least (1 - δ/2) over the choice of Û = <U1,…,Ul>, there exists a sequence of partitions π(Û), such that : μ(V1π(Û),V2π(Û)) ≥ μ(H1,H2) – ¾*ε . • Proof follows.
Graph Partitioning Algorithm Lemma Proof: • For a given sequence of partitions π(Û), we consider the following l+1 hybrid partitions. • The Hybrid (H10,H20) is simply (H1,H2). • The i’th hybrid partition, (H1i,H2i), has the vertices in Vi+1,…,Vl partitioned as in (H1,H2) and the vertices in V1,…,Vi as placed by the algorithm.
Graph Partitioning Algorithm • More precisely, the hybrid partition (H1i,H2i) is defined: • Where for j in {1,2}, • Note that in particular (H1l,H2l) is the partition (V1π(Û),V2π(Û)). • Since the partition of each Vi is determined by the choice of Ui and its partition, the i’th hybrid partition is determined by the choice of U1,…,Ui and their partitions, but not by the choice nor the partitions of Ui+1,…,Ul . and
Graph Partitioning Algorithm • We shall show that for every 1≤i≤l, for any fixed choice and partitions of U1,…,Ui-1 , with probability at least (1 – δ/2*l) over the choice of Ui, there exists a partition (U1i,U2i) of Uisuch that:
Graph Partitioning Algorithm • For the i-1 hybrid partition (H1i-1,H2i-1), or more precisely, for the partition it induces on Wi-1, and a sample set Ui, let – • We say that Uigood with respect to (W1i-1,W2i-1) and Viif (U1i,U2i) is representative with respect to (W1i-1,W2i-1) and Vi.
Graph Partitioning Algorithm • That is, (U1i,U2i) is such that for all but a fraction of ε/8 of the vertices v in Vi the following holds: • Assume that for each i, the set Uiis good with respect to (W1i-1,W2i-1) and Vi . • As previously defined, we say that a vertex v is unbalanced with respect to (W1i-1,W2i-1) if (*)
Graph Partitioning Algorithm • Thus, if v in Viis an unbalanced vertex with respect to (W1i-1,W2i-1) for which (*) is satisfied, then – • We are then guaranteed that when the partition (U1i,U2i) is used then v is put opposite of the majority of its neighbors in Wi-1. if v is balanced then it might be placed on either side.The same is true for the (at most εN/8l) vertices for which (*) does not hold.
Graph Partitioning Algorithm • The decrease in the size of the cut is affected only by the change of edges between Vi and Wi-1, and between pairs of vertices in Vi. In particular: • The number of cut edges between unbalanced vertices in Vi for which (*) issatisfied and vertices in Wi-1 can’t decrease. • The number of cut edges between unbalanced vertices in Vi for which (*) isnotsatisfied and vertices in Wi-1 decrease by at most (ε/8)*|Vi|*2N ≤ εN2/4l . • The number of cut edges between balanced vertices in Vi and vertices in Wi-1 decrease by at most |Vi|*2* ε N/8 ≤ εN2/4l • The number of cut edges between balanced vertices in Vi decrease by at most |Vi|2 = N2/l2 ≤ εN2/4l
Graph Partitioning Algorithm • The total decrease is bounded by 3εN2/4l . • It remains to prove that with high probability a chosen set Ui is good (with respect to (W1i-1,W2i-1) and Vi). • We first fix a vertex v in Vi.Let Ui = {u1,…,ut} (Reminder – Ui is chosen uniformly in Wi-1 = V \ Vi).For j in {1,2}, and for 1≤k ≤t, define a 0/1 random variable, ξjk, which is 1 if μk is a neighbor of v and μk in Wji-1, and is 0 otherwise.
Graph Partitioning Algorithm • By definition, for each j, the sum of the ξjk‘s is simply the number of neighbors v has in Uji (= UiWji-1) and the probability that ξjk = 1 is (1/N)*|Г(v) Wji-1 |. • By an additive Chernoffbound, and our choice of t, for each j in {1,..,k} -
Graph Partitioning Algorithm • By Markov’sinequality, for each j in {1,2}, with probability at least 1 - δ/4*l over the choice of Ui, for all but ε/8 of the vertices in Vi, equation (*) holds (for that j), and thus with probability at least 1 - δ/2l, Ui is good as required. • Applying the lemma 1 to a Max-Cut of G, we get: • With probability at least 1 - δ/2 over the choice of Û we have, μ(V1π(Û),V2π(Û)) ≥ μ(G) - ¾*ε , where (V1π(Û),V2π(Û)) is as defined in step 3 of the algorithm. ~ ~ ~ ~
Max-Cut Approx Algorithm • Armed with the GPA, the Max-Cut approx algorithm is quite straightforward. • We uniformly choose a set S of vertices of sizem = Θ((l*t + log(1/δ))/ε2), and run the GPA restricted to this set. • Instead of returning the largest cut, the algorithm returns S = {s1,…,sm}, a multiset of m/2 ordered pairs, {(s1,s2),…,(sm-1,sm)}, for which there exists a cut that maximizes the number of such pairs that are edges in the cut. This is done for technical reasons.
Max-Cut Approx algorithm • As step 1 of GPA. • Uniformly choose a set S={s1,…,sm} of size m = Θ(l·t+log(1/δ)/ε2).For 1≤i≤l, let Si = Vi S. • Similar to step 2 of GPA, for each of the sequences of partitionsπ(Û) = <(U11 ,U21),…,(U1l,U2l)>, partition each Si into two disjoint sets S1i and S2i , and let Sj π(Û) = (for j = 1,2). • For each partition (S1π(Û),S2π(Û)), compute the fraction of cut edges between pairs of vertices (s2k-1,s2k). More precisely, define –Let (S1π(Û),S2π(Û)) be a partition for which this fraction is maximized,and output μ(S1π(Û),S2π(Û)). ~ ~ ^
Max-Cut Approx Algorithm Lemma 2: • For any fixed Û, with probability at least 1 – δ/2 over the choice of S, μ(S1π(Û),S2π(Û)) = μ(V1π(Û),V2π(Û)) ± ¼*ε, where (S1π(Û),S2π(Û)) and μ(·,·) are as defined in step 4 of the Max-Cut approx algorithm. • Proof follows. ~ ~ ~ ~ ^ ~ ~
Max-Cut Approx Algorithm Lemma 2 proof: • Consider first a particular sequence of partitions, π(Û).The key observation is that for every s in S, and for j in {1,2}, s in Sjπ(Û) s in Vjπ(Û). Thus for each sequence of partitions π(Û) we are effectively sampling from (V1π(Û),V2π(Û)) . Furthermore, by viewing S as consisting of m/2 pairs of vertices (s2k-1,s2k), and counting the number of pairs which are on opposite sides of the partition and have an edge in between, we are able to approx the density of the cut edges.
Max-Cut Approx Algorithm • For 1≤k≤m/2, let ξk be a 0/1 random variable which is 1 if (s2k-1,s2k) in E(G), and for j≠j’, s2k-1 in Sjπ(Û) and s2k inSj’π(Û).Then, by definition, μ(S1π(Û),S2π(Û)) = 2/m ∑km/2ξk ,and the probability that ξk = 1 is μ(V1π(Û),V2π(Û)).Hence, by an additive Chernoff bound and our choice of m - ^
Max-Cut Approx Algorithm • Since there are 2l*t sequences of partitions of Û, with probability at least 1 – δ/2, for every sequence of partitions π(Û), μ(S1π(Û),S2π(Û)) = μ(V1π(Û),V2π(Û)) ± ε/8, and hence μ(S1π(Û),S2π(Û)) = μ(V1π(Û),V2π(Û)) ± ε/4. ^ ~ ~ ~ ~ ^
Property Testing MCρ • Armed with the Max-Cut approx algorithm, we have in hand a property tester for the class MCρ. • Graphs with cut density ρ: • MCρ = {G : μ(G) ≥ ρ} • For example, for ρ = ¼, MC1/4 is the group of graphs that contain a cut of at least density ¼. • Note that for ρ > ½ testing for ρ-cut is trivial. (why?) • For every constant 0 ≥ ρ > ½ , there exists a property testing algorithm for MCρ.
Property Testing MCρ - Proof • Let and let • The testing algorithm runs the Max-Cut approx algorithm algorithm shown earlier, with ε’ and δ as input. • Graph G is accepted if and only if . • If μ(G) ≥ ρ, then by Max-Cut approx algorithm, G is accepted with pr 1 – δ . • If G is accepted with pr > δ, then μ(G) ≥ ρ - 2ε’ . This implies that G is ε-close to some G’ in MCρ.
Property Testing MCρ - Proof • Let (V1,V2) be a partition of V(G) such that μ(V1,V2) ≥ ρ - 2ε’ . => 2|V1|*|V2| ≥ (ρ - 2ε’)N2 • If 2|V1|*|V2| ≥ ρN2 : • To obtain G’ we simply add edges between vertices in V1 and vertices in V2 until μ(V1,V2) = ρ (why can we do this?) • In this case, dist(G,G’) ≤ 2ε’ < ε.
Property Testing MCρ - Proof • Else, meaning 2|V1|*|V2| < ρN2 : • We cannot obtain G’ by simply adding more edges (why?). • Instead, we will move vertices from the larger set (assume V1) to the smaller set (assume V2). Then we will have ”enough room” for the extra edges.
Property Testing MCρ - Proof • Assume |V1|<|V2|, and consider (V1’,V2’) such that and |V1’| has the minimum value such that 2|V1’|*|V2’| ≥ ρN2. => |V1’|-|V1| ≤ (ε/γ)*N => • And now we can proceed adding edges between V1’ and V2’ until we reach the cut density required.