Additive Approximation for Edge-Deletion Problems

Similar documents
Deterministic vs Non-deterministic Graph Property Testing

Math 301: The Erdős-Stone-Simonovitz Theorem and Extremal Numbers for Bipartite Graphs

Quasi-Randomness and the Distribution of Copies of a Fixed Graph

ON INDEPENDENT SETS IN PURELY ATOMIC PROBABILITY SPACES WITH GEOMETRIC DISTRIBUTION. 1. Introduction. 1 r r. r k for every set E A, E \ {0},

ON THE INVERSE SIGNED TOTAL DOMINATION NUMBER IN GRAPHS. D.A. Mojdeh and B. Samadi

On the ratio of maximum and minimum degree in maximal intersecting families

On the ratio of maximum and minimum degree in maximal intersecting families

Stanford University CS259Q: Quantum Computing Handout 8 Luca Trevisan October 18, 2012

An intersection theorem for four sets

Probablistically Checkable Proofs

On decompositions of complete multipartite graphs into the union of two even cycles

SUFFICIENT CONDITIONS FOR MAXIMALLY EDGE-CONNECTED AND SUPER-EDGE-CONNECTED GRAPHS DEPENDING ON THE CLIQUE NUMBER

Surveillance Points in High Dimensional Spaces

COLLAPSING WALLS THEOREM

Relating Branching Program Size and. Formula Size over the Full Binary Basis. FB Informatik, LS II, Univ. Dortmund, Dortmund, Germany

The Chromatic Villainy of Complete Multipartite Graphs

New problems in universal algebraic geometry illustrated by boolean equations

A Bijective Approach to the Permutational Power of a Priority Queue

Lecture 18: Graph Isomorphisms

Fractional Zero Forcing via Three-color Forcing Games

The Substring Search Problem

Pearson s Chi-Square Test Modifications for Comparison of Unweighted and Weighted Histograms and Two Weighted Histograms

arxiv: v1 [math.co] 2 Feb 2018

Do Managers Do Good With Other People s Money? Online Appendix

The Erdős-Hajnal conjecture for rainbow triangles

NOTE. Some New Bounds for Cover-Free Families

Fall 2014 Randomized Algorithms Oct 8, Lecture 3

arxiv: v1 [math.co] 4 May 2017

arxiv: v1 [math.co] 6 Mar 2008

Lecture 28: Convergence of Random Variables and Related Theorems

10/04/18. P [P(x)] 1 negl(n).

Chapter 3: Theory of Modular Arithmetic 38

ONE-POINT CODES USING PLACES OF HIGHER DEGREE

Matrix Colorings of P 4 -sparse Graphs

Brief summary of functional analysis APPM 5440 Fall 2014 Applied Analysis

Multiple Criteria Secretary Problem: A New Approach

Journal of Inequalities in Pure and Applied Mathematics

THE CONE THEOREM JOEL A. TROPP. Abstract. We prove a fixed point theorem for functions which are positive with respect to a cone in a Banach space.

EM Boundary Value Problems

Method for Approximating Irrational Numbers

A solution to a problem of Grünbaum and Motzkin and of Erdős and Purdy about bichromatic configurations of points in the plane

3.1 Random variables

Unobserved Correlation in Ascending Auctions: Example And Extensions

arxiv: v1 [math.nt] 12 May 2017

Vanishing lines in generalized Adams spectral sequences are generic

Central Coverage Bayes Prediction Intervals for the Generalized Pareto Distribution

A Multivariate Normal Law for Turing s Formulae

Solution to HW 3, Ma 1a Fall 2016

Syntactical content of nite approximations of partial algebras 1 Wiktor Bartol Inst. Matematyki, Uniw. Warszawski, Warszawa (Poland)

Duality between Statical and Kinematical Engineering Systems

Numerical approximation to ζ(2n+1)

Turán Numbers of Vertex-disjoint Cliques in r- Partite Graphs

Goodness-of-fit for composite hypotheses.

Numerical Integration

Lecture 8 - Gauss s Law

On the integration of the equations of hydrodynamics

Math 124B February 02, 2012

On the Locality of Codeword Symbols

Temporal-Difference Learning

6 Matrix Concentration Bounds

CERFACS 42 av. Gaspard Coriolis, Toulouse, Cedex 1, France. Available at Date: April 2, 2008.

New lower bounds for the independence number of sparse graphs and hypergraphs

Encapsulation theory: the transformation equations of absolute information hiding.

6 PROBABILITY GENERATING FUNCTIONS

Approximation Algorithms and Hardness of the k-route Cut Problem

Supplementary information Efficient Enumeration of Monocyclic Chemical Graphs with Given Path Frequencies

MATH 415, WEEK 3: Parameter-Dependence and Bifurcations

KOEBE DOMAINS FOR THE CLASSES OF FUNCTIONS WITH RANGES INCLUDED IN GIVEN SETS

The Congestion of n-cube Layout on a Rectangular Grid S.L. Bezrukov J.D. Chavez y L.H. Harper z M. Rottger U.-P. Schroeder Abstract We consider the pr

Approximation Algorithms and Hardness of the k-route Cut Problem

EQUI-PARTITIONING OF HIGHER-DIMENSIONAL HYPER-RECTANGULAR GRID GRAPHS

What Form of Gravitation Ensures Weakened Kepler s Third Law?

ANA BERRIZBEITIA, LUIS A. MEDINA, ALEXANDER C. MOLL, VICTOR H. MOLL, AND LAINE NOBLE

Chem 453/544 Fall /08/03. Exam #1 Solutions

QIP Course 10: Quantum Factorization Algorithm (Part 3)

Hua Xu 3 and Hiroaki Mukaidani 33. The University of Tsukuba, Otsuka. Hiroshima City University, 3-4-1, Ozuka-Higashi

A Crash Course in (2 2) Matrices

F-IF Logistic Growth Model, Abstract Version

Classical Worm algorithms (WA)

Conservative Averaging Method and its Application for One Heat Conduction Problem

Lacunary I-Convergent Sequences

A THREE CRITICAL POINTS THEOREM AND ITS APPLICATIONS TO THE ORDINARY DIRICHLET PROBLEM

A proof of the binomial theorem

JENSEN S INEQUALITY FOR DISTRIBUTIONS POSSESSING HIGHER MOMENTS, WITH APPLICATION TO SHARP BOUNDS FOR LAPLACE-STIELTJES TRANSFORMS

On the Poisson Approximation to the Negative Hypergeometric Distribution

Analytical time-optimal trajectories for an omni-directional vehicle

4/18/2005. Statistical Learning Theory

Lab #4: Newton s Second Law

Research Article On Alzer and Qiu s Conjecture for Complete Elliptic Integral and Inverse Hyperbolic Tangent Function

Geometry of the homogeneous and isotropic spaces

PROBLEM SET #1 SOLUTIONS by Robert A. DiStasio Jr.

Approximating Maximum Diameter-Bounded Subgraph in Unit Disk Graphs

Exploration of the three-person duel

β β β β β B B B B o (i) (ii) (iii)

q i i=1 p i ln p i Another measure, which proves a useful benchmark in our analysis, is the chi squared divergence of p, q, which is defined by

Approximation Algorithms and Hardness of the k-route Cut Problem

Physics 211: Newton s Second Law

Regularity for Fully Nonlinear Elliptic Equations with Neumann Boundary Data

THE JEU DE TAQUIN ON THE SHIFTED RIM HOOK TABLEAUX. Jaejin Lee

Moment-free numerical approximation of highly oscillatory integrals with stationary points

Transcription:

Additive Appoximation fo Edge-Deletion Poblems Noga Alon Asaf Shapia Benny Sudakov Abstact A gaph popety is monotone if it is closed unde emoval of vetices and edges. In this pape we conside the following algoithmic poblem, called the edge-deletion poblem; given a monotone popety P and a gaph G, compute the smallest numbe of edge deletions that ae needed in ode to tun G into a gaph satisfying P. We denote this quantity by E P (G. The fist esult of this pape states that the edge-deletion poblem can be efficiently appoximated fo any monotone popety. Fo any fixed ɛ > 0 and any monotone popety P, thee is a deteministic algoithm, which given a gaph G = (V, E of size n, appoximates E P (G in linea time O( V + E to within an additive eo of ɛn 2. Given the above, a natual question is fo which monotone popeties one can obtain bette additive appoximations of E P. Ou second main esult essentially esolves this poblem by giving a pecise chaacteization of the monotone gaph popeties fo which such appoximations exist. (1 If thee is a bipatite gaph that does not satisfy P, then thee is a δ > 0 fo which it is possible to appoximate E P to within an additive eo of n2 δ in polynomial time. (2 On the othe hand, if all bipatite gaphs satisfy P, then fo any δ > 0 it is NP -had to appoximate E P to within an additive eo of n2 δ. While the poof of (1 is elatively simple, the poof of (2 equies seveal new ideas and involves tools fom Extemal Gaph Theoy togethe with spectal techniques. Inteestingly, pio to this wok it was not even known that computing E P pecisely fo the popeties in (2 is NP -had. We thus answe (in a stong fom a question of Yannakakis, who asked in 1981 if it is possible to find a lage and natual family of gaph popeties fo which computing E P is NP -had. Schools of Mathematics and Compute Science, Raymond and Bevely Sackle Faculty of Exact Sciences, Tel Aviv Univesity, Tel Aviv 69978, Isael and IAS, Pinceton, NJ 08540, USA. Email: nogaa@tau.ac.il. Reseach suppoted in pat by the Isael Science Foundation, by the Hemann Minkowski Mineva Cente fo Geomety at Tel Aviv Univesity and by the Von Neumann Fund. School of Compute Science, Raymond and Bevely Sackle Faculty of Exact Sciences, Tel Aviv Univesity, Tel Aviv, Isael. Email: asafico@tau.ac.il. This wok foms pat of the autho s Ph.D. thesis. Reseach suppoted in pat by a Chales Cloe Foundation Fellowship and an IBM Ph.D. Fellowship. Depatment of Mathematics, Pinceton Univesity, Pinceton, NJ 08544, USA. E-mail: bsudakov@math.pinceton.edu. Reseach suppoted in pat by NSF gants DMS-0355497, DMS-0106589, and by an Alfed P. Sloan fellowship. 1

1 Intoduction 1.1 Definitions, backgound and motivation The topic of this pape is gaph modification poblems, namely poblems of the type: given a gaph G, find the smallest numbe of modifications that ae needed in ode to tun G into a gaph satisfying popety P. The main two types of such poblems ae the following, in node modification poblems, one ties to find the smallest set of vetices, whose emoval tuns G into a gaph satisfying P, while in edge modification poblems, one ties to find the smallest numbe of edge deletions/additions that tun G into a gaph satisfying P. In this pape we will focus on edge-modification poblems. Befoe continuing with the intoduction we need to intoduce some notations. Fo a gaph popety P, let P n denote the set of gaphs on n vetices which satisfy P. Given two gaphs on n vetices, G and G, we denote by (G, G the edit distance between G and G, namely the smallest numbe of edge additions and/o deletions that ae needed in ode to tun G into G. Fo a given popety P, we want to denote how fa is a gaph G fom satisfying P. Fo notational easons it will be moe convenient to nomalize this measue so that it is always in the inteval [0, 1] (actually [0, 1 2 ]. We thus define Definition 1.1 (E P (G Fo a gaph popety P and a gaph G on n vetices, let E P (G = min G P n (G, G n 2. In wods, E P (G is the minimum edit distance of G to a gaph satisfying P afte nomalizing it by a facto of n 2. Gaph modification poblems ae well studied computational poblems. In 1979, Gaey and Johnson [28] mentioned 18 types of vetex and edge modification poblems. Gaph modification poblems wee extensively studied as these poblems have applications in seveal fields, including Molecula Biology and Numeical Algeba. In these applications a gaph is used to model expeimental data, whee edge modifications coespond to coecting eos in the data: Adding an edge means coecting a false negative, while deleting an edge means coecting a false positive. Computing E P (G fo appopiately defined popeties P have impotant applications in physical mapping of DNA (see [17], [29] and [31]. Computing E P (G fo othe popeties aises when optimizing the unning time of pefoming Gaussian elimination on a spase symmetic positive-definite matix (see [42]. Othe modification poblems aise as suboutines fo heuistic algoithms fo computing the lagest clique in a gaph (see [48]. Some edge modification poblems also aise natually in optimization of cicuit design [18]. We biefly mention that thee ae also many esults about vetex modification poblems, notably that of Lewis and Yannakakis [38], who poved that fo any nontivial heeditay popety P, it is NP -had to compute the smallest numbe of vetex deletions that tun a gaph into one satisfying P. (A gaph popety is heeditay if it is closed unde emoval of vetices. A gaph popety is said to be monotone if it is closed unde emoval of both vetices and edges. Examples of well studied monotone popeties ae k-coloability, and the popety of being H-fee fo some fixed gaph H. (A gaph is H-fee if it contains no copy of H as a not necessaily induced subgaph. Note, that when tying to tun a gaph into one satisfying a monotone popety we will only use edge deletions. Theefoe, in these cases the poblem is sometimes called edge-deletion poblem. Ou main esults, pesented in the following subsections, give a nealy complete answe to the hadness of additive appoximations of the edge-deletion poblem fo monotone popeties. 2

1.2 An algoithm fo any monotone popety Ou fist main esult in this pape states that fo any gaph popety P that belongs to the lage, natual and well studied family of monotone gaph popeties, it is possible to deive efficient appoximations of E P. Theoem 1.1 Fo any fixed ɛ > 0 and any monotone popety P thee is a deteministic algoithm that given a gaph G on n vetices computes in time O(n 2 a eal E satisfying E E P (G ɛ. Note, that the unning time of ou algoithm is of type f(ɛn 2, and can in fact be impoved to linea in the size of the input by fist counting the numbe of edges, taking E = 0 in case the gaph has less than ɛn 2 edges. We note that Theoem 1.1 was not known fo many monotone popeties. In paticula, such an appoximation algoithm was not even known fo the popety of being tianglefee and moe geneally fo the popety of being H-fee fo any non-bipatite H. Theoem 1.1 is obtained via a novel stuctual gaph theoetic technique. One of the applications of this technique (oughly yields that evey gaph G, can be appoximated by a small weighted gaph W, in such a way that E P (G is appoximately the optimal solution of a cetain elated poblem (explained pecisely in Section 3 that we solve on W. The main usage of this new stuctual-technique in this pape is in poving Lemmas 3.4 and 3.5 that lie at the coe of the poof of Theoem 1.1. This new technique, which may vey well have othe algoithmic and gaph-theoetic applications, applies a esult of Alon, Fische, Kivelevich and Szegedy [4] which is a stengthening of Szemeédi s Regulaity Lemma [44]. We then use an efficient algoithmic vesion of the egulaity lemma, which also implies an efficient algoithmic vesion of the esult of [4], in ode to tansfom the existential stuctual esult into the algoithm stated in Theoem 1.1. We futhe use ou stuctual esult in ode to pove the following concentation-type esult egading the edit distance of subgaphs of a gaph. Theoem 1.2 Fo evey ɛ and any monotone popety P thee is a d = d(ɛ, P with the following popety: Let G be any gaph and suppose we andomly pick a subset D, of d vetices fom V (G. Denote by G the gaph induced by G on D. Then, P ob[ E P (G E P (G > ɛ] < ɛ. An immediate implication of the above theoem is the following, Coollay 1.2 Fo evey ɛ > 0 and any monotone popety P thee is a andomized algoithm that given a gaph G computes in time O(1 a eal E satisfying E E P (G ɛ with pobability at least 1 ɛ. We stess that thee ae some computational subtleties egading the implementation of the algoithmic esults discussed above. Roughly speaking, one should define how the popety P is given to the algoithm and also whethe ɛ is a fixed constant o pat of the input. These issues ae discussed in Section 5. It is natual to ask if the above esults can be extended to the lage family of heeditay popeties, namely, popeties closed unde emoval of vetices, but not necessaily unde emoval of edges. Many natual popeties such as being Pefect, Chodal and Inteval ae heeditay non-monotone popeties. By combining the ideas we used in ode to pove Theoem 1.1 along with the main ideas of [6] it can be shown that Theoem 1.1 (as well as Theoem 1.2 and Coollay 1.2 also hold fo any heeditay gaph popety. 3

1.3 On the possibility of bette appoximations Theoem 1.1 implies that it is possible to efficiently appoximate the distance of an n vetex gaph fom any monotone gaph popety P, to within an eo of ɛn 2 fo any ɛ > 0. A natual question one can ask is fo which monotone popeties it is possible to impove the additive eo to n 2 δ fo some fixed δ > 0. In the teminology of Definition 1.1, this means to appoximate E P to within an additive eo of n δ fo some δ > 0. Ou second main esult in this pape is a pecise chaacteization of the monotone gaph popeties fo which such a δ > 0 exists 1. Theoem 1.3 Let P be a monotone gaph popety. Then, 1. If thee is a bipatite gaph that does not satisfy P, then thee is a fixed δ > 0 fo which it is possible to appoximate E P to within an additive eo of n δ in polynomial time. 2. On the othe hand, if all bipatite gaphs satisfy P, then fo any fixed δ > 0 it is NP -had to appoximate E P to within an additive eo of n δ. While the fist pat of the above theoem follows easily fom the known esults about the Tuán numbes of bipatite gaphs (see, e.g., [45], the poof of the second item involves vaious combinatoial tools. These include Szemeédi s Regulaity Lemma, and a new esult in Extemal Gaph Theoy, which is stated in Theoem 6.1 (see Section 6 that extends the main esult of [14] and [15]. We also use the basic appoach of [1], which applies spectal techniques to obtain an N P -hadness esult by embedding a blow-up of a spase instance to a poblem, in an appopiate dense pseudo-andom gaph. Theoem 6.1 and the poof technique of Theoem 1.3 may be useful fo othe applications in gaph theoy and in poving hadness esults. As in the case of Theoem 1.1, the second pat of Theoem 1.3 was not known fo many specific monotone popeties. Fo example, pio to this pape it was not even known that it is NP -had to pecisely compute E P, whee P is the popety of being tiangle-fee. Moe geneally, such a esult was not known fo the popety of being H-fee fo any non-bipatite H. 1.4 Related wok Ou main esults fom a natual continuation and extension of seveal eseach paths that have been extensively studied. Below we suvey some of them. 1.4.1 Appoximations of gaph-modification poblems As we have peviously mentioned many pactical optimization poblems in vaious eseach aeas can be posed as the poblem of computing the edit-distance of a cetain gaph fom satisfying a cetain popety. Cai [16] has shown that fo any heeditay popety, which is expessible by a finite numbe of fobidden induced subgaphs, the poblem of computing the edit distance is fixedpaamete tactable. Khot and Raman [33] poved that fo some heeditay popeties P, finding in a given gaph G, a subgaph that satisfies P is fixed-paamete tactable, while fo othe popeties finding such a subgaph is had in an appopiate sense (see [33]. Note that Theoem 1.1 implies that if the edit distance (in ou case, numbe of edge emovals of a gaph fom a popety is Ω(n 2, then it can be appoximated to within any multiplicative constant 1 + ɛ. 1 We assume hencefoth that P is not satisfied by all gaphs. 4

1.4.2 Hadness of edge-modification poblems Natanzon, Shami and Shaan [39] poved that fo vaious heeditay popeties, such as being Pefect and Compaability, computing E P is NP -had and sometimes even NP -had to appoximate to within some constant. Yannakakis [46] has shown that fo seveal gaph popeties such as outeplana, tansitively oientable, and line-invetible, computing E P is NP -had. Asano [12] and Asano and Hiata [13] have shown that popeties expessible in tems of cetain families of fobidden minos o topological minos ae N P -had. The N P -completeness poofs obtained by Yannakakis in [46], wee add-hoc aguments that applied only to specific popeties. Yannakakis posed in [46] as an open poblem, the possibility of poving a geneal NP -hadness esult fo computing E P that will apply to a geneal family of gaph popeties. Theoem 1.3 achieves such a esult even fo the seemingly easie poblem of appoximating E P. 1.4.3 Appoximation schemes fo dense instances Fenandez de la Vega [22] and Aoa, Kage and Kapinski [11] showed that many of the classical NP -complete poblems such as MAX-CUT and MAX-3-CNF have a PTAS when the instance is dense, namely if the gaph has Ω(n 2 edges o the 3-CNF fomula has Ω(n 3 clauses. Appoximations fo dense instances of Quadatic Assignment Poblems, as well as fo additional poblems, wee obtained by Aoa, Fieze and Kaplan [10]. Fieze and Kannan [26] obtained appoximations schemes fo seveal dense gaph theoetic poblems via cetain matix appoximations. Alon, Fenandez de la Vega, Kannan and Kapinski [3] obtained esults analogous to ous fo any dense Constaint-Satisfaction-Poblem via cetain sampling techniques. It should be noted that all the above appoximation schemes ae obtained in a way simila to ous, that is, by fist poving an additive appoximation, and then aguing that in case the optimal solution is lage (that is, Ω(n 2 in case of gaphs, o Ω(n 3 in case of 3-CNF the small additive eo tanslates into a small multiplicative eo. All the above appoximation esults apply to the family of so called Constaint-Satisfaction- Poblems. In some sense, these poblems can expess gaph popeties fo which one imposes estictions on pais of vetices, such as k-coloability. These techniques thus fall shot fom applying to popeties as simple as Tiangle-feeness, whee the estiction is on tiples of vetices. The techniques we develop in ode to obtain Theoem 1.1 enable us to handle estictions that apply to abitaily lage sets of vetices. We biefly mention that E P is elated to packing poblems of gaphs. In [32] and [47] it was shown that by using linea pogamming one can appoximate the packing numbe of a gaph. In Section 9 we explain why this technique does not allow one to appoximate E P. 1.4.4 Algoithmic applications of Szemeédi s Regulaity Lemma The authos of [2] gave a polynomial time algoithmic vesion of Szemeédi s Regulaity Lemma. They used it to pove that Theoem 1.1 holds fo the k-coloability popety. The unning time of thei algoithm was impoved by Kohayakawa, Rödl and Thoma [34]. Fieze and Kannan [25] futhe used the algoithmic vesion of the egulaity lemma, to obtain appoximation schemes fo additional gaph poblems. Theoem 1.1 is obtained via the algoithmic vesion of a stengthening of the standad egulaity lemma, which was poved in [4], and it seems that these esults cannot be obtained using the standad egulaity lemma. 5

1.4.5 Toleant Popety-Testing In standad Popety-Testing (see [23] and [41] one wants to distinguish between the gaphs G that satisfy a cetain gaph popety P, o equivalently those G fo which E P (G = 0, fom those that satisfy E P (G > ɛ. The main goal in designing popety-testes is to educe thei quey-complexity, namely, minimize the numbe of queies of the fom ae i and j connected in the input gaphs?. Panas, Ron and Rubinfeld [40] intoduced the notion of Toleant Popety-Testing, whee one wants to distinguish between the gaphs G that satisfy E P (G < δ fom those that satisfy E P (G > ɛ, whee 0 δ < ɛ 1 ae some constants. Recently, thee have been seveal esults in this line of wok. Specifically, Fische and Newman [24] have ecently shown that if a gaph popety is testable with numbe of queies depending on ɛ only, then it is also toleantly testable fo any 0 δ < ɛ 1 and with quey complexity depending on ɛ δ. Combining this with the main esult of [7] implies that any monotone popety is toleantly testable fo any 0 δ < ɛ 1 and with quey complexity depending on ɛ δ. Note, that Coollay 1.2 implicitly states the same. In fact, the algoithm implied by Coollay 1.2 is the natual one, whee one picks a andom subset of vetices S, and appoximates E P (G by computing E P on the gaph induced by S. The algoithm of [24] is fa moe complicated. Futhemoe, due to the natue of ou algoithm if the input gaph satisfies a monotone popety P, namely if E P (G = 0, we will always detect that this is the case. The algoithm of [24] may declae that E P (G > 0 even if E P (G = 0. 1.5 Oganization The poofs of the main esults of this pape, Theoems 1.1 and 1.3, ae independent of each othe. Sections 2, 3, 4 and 5 contain the poofs elevant to Theoem 1.1 and Sections 6, 7 and 8 contain the poofs elevant to Theoem 1.3. In Section 2 we intoduce the basic notions of egulaity and state the egulaity lemmas that we use fo poving Theoem 1.1 and some of thei standad consequences. In Section 3 we give a high level desciption of the main ideas behind ou algoithms. We also state the main stuctual gaph theoetic lemmas, Lemmas 3.4 and 3.5 that lie at the coe of these algoithms. The poofs of these lemmas appea in section 4. In Section 5 we give the poof of Theoems 1.1 and 1.2 as well as a discussion about some subtleties egading the implementation of these algoithms. Section 6 contains a high-level desciption of the poof of Theoem 1.3 as well as a desciption of the main tools that we apply in this poof. In Section 7 we pove a new Extemal Gaph-Theoetic esult that lies at the coe of the poof of Theoem 1.3. In Section 8 we give the detailed poof of Theoem 1.3. The final Section 9 contains some concluding emaks and open poblems. Thoughout the pape, wheneve we elate, fo example, to a function f 3.1, we mean the function f defined in Lemma/Claim/Theoem 3.1. 2 Regulaity Lemmas and thei Algoithmic Vesions In this section we discuss the basic notions of egulaity, some of the basic applications of egula patitions and state the egulaity lemmas that we use in the poof of Theoems 1.1 and 1.2. See [35] fo a compehensive suvey on the egulaity-lemma. We stat with some basic definitions. Fo evey two nonempty disjoint vetex sets A and B of a gaph G, we define e(a, B to be the numbe of edges of G between A and B. The edge density of the pai is defined by d(a, B = e(a, B/ A B. 6

Definition 2.1 (γ-egula pai A pai (A, B is γ-egula, if fo any two subsets A A and B B, satisfying A γ A and B γ B, the inequality d(a, B d(a, B γ holds. Thoughout the pape we will make an extensive use of the notion of gaph homomophism which we tun to fomally define. Definition 2.2 (Homomophism A homomophism fom a gaph F to a gaph K, is a mapping ϕ : V (F V (K that maps edges to edges, namely (v, u E(F implies (ϕ(v, ϕ(u E(K. In what follows, F K denotes the fact that thee is a homomophism fom F to K. We will also say that a gaph H is homomophic to K if H K. Note, that a gaph H is homomophic to a complete gaph of size k if and only if H is k-coloable. Let F be a gaph on f vetices and K a gaph on k vetices, and suppose F K. Let G be a gaph obtained by taking a copy of K, eplacing evey vetex with a sufficiently lage independent set, and evey edge with a andom bipatite gaph of edge density d. It is easy to show that with high pobability, G contains a copy of F (in fact, many. The following lemma shows that in ode to infe that G contains a copy of F, it is enough to eplace evey edge with a egula enough pai. Intuitively, the lage f and k ae, and the spase the egula pais ae, the moe egula we need each pai to be, because we need the gaph to be close to a andom gaph. This is fomulated in the lemma below. Seveal vesions of this lemma wee peviously poved in papes using the egulaity lemma (see [35]. Lemma 2.3 Fo evey eal 0 < η < 1, and integes k, f 1 thee exist γ = γ 2.3 (η, k, f, and N = N 2.3 (η, k, f with the following popety. Let F be any gaph on f vetices, and let U 1,..., U k be k paiwise disjoint sets of vetices in a gaph G, whee U 1 =... = U k N. Suppose thee is a mapping ϕ : V (F {1,..., k} such that the following holds: If (i, j is an edge of F then (U ϕ(i, U ϕ(j is γ-egula with density at least η. Then U 1,..., U k span a copy of F. Comment 2.4 Obseve that the function γ 2.3 (η, k, f may and will be assumed to be monotone non-inceasing in k and f and monotone non-deceasing in η. Theefoe, it will be convenient to assume that γ 2.3 (η, k, f η 2. Similaly, we will assume that N 2.3 (η, k, f is monotone nondeceasing in k and f. Also, fo ease of futue definitions (in paticula those given in (2 set γ 2.3 (η, k, 0 = N 2.3 (η, k, 0 = 1 fo any k 1 and 0 < η < 1. A patition A = {V i 1 i k} of the vetex set of a gaph is called an equipatition if V i and V j diffe by no moe than 1 fo all 1 i < j k (so in paticula each V i has one of two possible sizes. The ode of an equipatition denotes the numbe of patition classes (k above. A efinement of an equipatition A is an equipatition of the fom B = {V i,j 1 i k, 1 j l} such that V i,j is a subset of V i fo evey 1 i k and 1 j l. Definition 2.5 (γ-egula equipatition An equipatition B = {V i 1 i k} of the vetex set of a gaph is called γ-egula if all but at most γ ( k 2 of the pais (Vi, V i ae γ-egula. The Regulaity Lemma of Szemeédi can be fomulated as follows. Lemma 2.6 ([44] Fo evey m and γ > 0 thee exists T = T 2.6 (m, γ with the following popety: If G is a gaph with n T vetices, and A is an equipatition of the vetex set of G of ode at most m, then thee exists a efinement B of A of ode k, whee m k T and B is γ-egula. 7

T 2.6 (m, γ may and is assumed to be monotone non-deceasing in m and monotone non-inceasing in γ. Szemeédi s oiginal poof of Lemma 2.6 was only existential as it supplied no efficient algoithm fo obtaining the equied equipatition. Alon et. al. [2] wee the fist to obtain a polynomial time algoithm fo finding the equipatition, whose existence is guaanteed by lemma 2.6. The unning time of this algoithm was impoved by Kohayakawa et. al. [34] who obtained the following esult. Lemma 2.7 ([34] Fo evey fixed m and γ thee is an O(n 2 time algoithm that given an equipatition A finds equipatition B as in Lemma 2.6. Ou main tool in the poof of Theoem 1.1 is Lemma 2.9 below, poved in [4]. This lemma can be consideed a stengthening of Lemma 2.6, as it guaantees the existence of an equipatition and a efinement of this equipatition that poses stonge popeties compaed to those of the standad γ-egula equipatition. This stonge notion is defined below. Definition 2.8 (E-egula equipatition Fo a function E( : N (0, 1, a pai of equipatitions A = {V i 1 i k} and its efinement B = {V i,j 1 i k, 1 j l}, whee V i,j V i fo all i, j, ae said to be E-egula if 1. Fo all 1 i < i k, fo all 1 j, j l but at most E(kl 2 of them, the pai (V i,j, V i,j is E(k-egula. 2. All 1 i < i k but at most E(0 ( k 2 of them ae such that fo all 1 j, j l but at most E(0l 2 of them d(v i, V i d(v i,j, V i,j < E(0 holds. It will be vey impotant fo what follows to obseve that in Definition 2.8 we may use an abitay function athe than a fixed γ as in Definition 2.5 (such functions will be denoted by E thoughout the pape. The following is one of the main esults of [4]. Lemma 2.9 ([4] Fo any intege m and function E( : N (0, 1 thee is S = S 2.9 (m, E such that any gaph on at least S vetices has an E-egula equipatition A, B whee A = k m and B = kl S. In ode to make the pesentation self contained we biefly eview the poof of Lemma 2.9. Fix any m and function E and put ζ = E(0. Patition G into m abitay subsets of equal size and denote this equipatition by A 0. Put M = m. Iteate the following task: Apply Lemma 2.6 on A i 1 with m = A i 1 and γ = E(M/M 2 and let A i be the efinement of A i 1 etuned by Lemma 2.6. If A i 1 and A i fom an E-egula equipatition stop, othewise set M = A i 1 and eiteate. It is shown is [4] that afte at most 100/ζ 4 iteations, fo some 1 i 100/ζ 4 the patitions A i 1 and A i fom an E-egula equipatition. Moeove, detecting an i fo which this holds is vey easy, that is, can be done in time O(n 2 (see the poof in [4]. Note, that one can thus set the intege S 2.9 (m, E to be the ode of A i. In paticula, the following is an immediate implication of the above discussion. Poposition 2.10 If m is bounded by a function of ɛ only, then fo any E the intege S = S 2.9 (m, E can be uppe bounded by a function of ɛ only. The ɛ in the above poposition will be the ɛ fom the task of appoximating E P within an eo of ɛ in Theoem 1.1. Also, in ou application of Lemma 2.9 the function E will (implicitly depend on ɛ. Fo example, it will be convenient to set E(0 = ɛ. Howeve, it follows fom the definition of 8

S 2.9 (m, E given above that even in this case it is possible to uppe bound S 2.9 (m, E by a function of ɛ only. In ode to design ou algoithm we will need to obtain the equipatitions A and B that appea in the statement of Lemma 2.9. Howeve, note that by the oveview of the poof of Lemma 2.9 given above, in ode to obtain this patition one can use Lemma 2.7 as an efficient algoithm fo obtaining the egula patitions. Moeove, by Poposition 2.10 wheneve we apply eithe E o Lemma 2.7 we ae guaanteed that m (which in the above oveview was M is uppe bounded by some function of ɛ and γ is lowe bounded by some function of ɛ. This means that each of the at most 100/ζ 4 applications of Lemma 2.10 takes O(n 2 time. We thus get the following: Poposition 2.11 If m is bounded by a function of ɛ only, then fo any E thee is an O(n 2 algoithm fo obtaining the equipatitions A and B of Lemma 2.9. 3 Oveview of the Poof of Theoem 1.1 We stat with a convenient way of handling a monotone gaph popety. Definition 3.1 (Fobidden Subgaphs Fo a monotone gaph popety P, define F = F P to be the set of gaphs which ae minimal with espect to not satisfying popety P. In othe wods, a gaph F belongs to F if it does not satisfy P, but any gaph obtained fom F by emoving an edge o a vetex, satisfies P. As an example of a family of fobidden subgaphs, conside P which is the popety of being 2- coloable. Then F P is the set of all odd-cycles. Clealy, a gaph satisfies P if and only it contains no membe of F P as a (not necessaily induced subgaph. We say that a gaph is F-fee if it contains no (not necessaily induced subgaph F F. Clealy, fo any family F, being F-fee is a monotone popety. Thus, the monotone popeties ae pecisely the gaph popeties that ae equivalent to being F-fee fo some family F. In ode to simplify the notation, it will be simple to talk about popeties of type F-fee athe than monotone popeties. To avoid confusion we will hencefoth denote by E F (G the value of E P (G, whee F = F P as above. The main idea we apply in ode to obtain the algoithmic esults of this pape is quite simple; given a gaph G, a family of fobidden subgaphs F and ɛ > 0 we use Lemma 2.9 with appopiately defined paametes in ode to constuct in O(n 2 time a weighted complete gaph W, of size depending on ɛ but independent of the size of G, such that a solution of a cetain elated poblem on W gives a good appoximation of E F (G. As W will be of size independent of the size of G, we may and will use exhaustive seach in ode to solve the elated poblem on W. In what follows we give futhe details on how to define W and the elated poblem that we solve on W. We stat with the simplest case, whee the popety is that of being tiangle-fee, namely F = {K 3 }. Let W be some weighted complete gaph on k vetices and let 0 w(i, j 1 denote the weight of the edge connecting i and j in W. Let E F (W be the natual extension of the definition of E F (G to weighted gaphs, namely, instead of just counting how many edges should be emoved in ode to tun G into an F-fee gaph, we ask fo the edge set of minimum weight with the above popety. Let G be a k-patite gaph on n vetices with patition classes V 1,..., V k of equal size n/k. Suppose fo evey i < j we have d(v i, V j = w(i, j (ecall that d(v i, V j denotes the edge density between V i and V j. In some sense, W can be consideed a weighted appoximation of G, but to ou investigation a moe impotant question is whethe W can be used in ode to estimate E F (G? In othe wods, is it tue that E F (G E F (W? 9

It is easy to see that E F (G E F (W. Indeed, given a set of edges S, whose emoval tuns W into a tiangle fee gaph, we simply emove all edges connecting V i and V j fo evey (i, j S. The main question is whethe the othe diection is also tue. Namely, is it tue that if it is possible to emove αn 2 fom G and thus make it tiangle fee, then it is possible to emove fom W a set of edges of total weight appoximately αk 2 and thus make it tiangle-fee? If tue this will mean that by computing E F (W we also appoximately compute E F (G. Unfotunately, this assetion is false in geneal, as the minimal numbe of edge modifications that ae enough to make G tiangle-fee, may involve emoving some and not all the edges connecting a pai (V i, V j, and in W we can emove only edges and not pats of them. It thus seems natual to ask what kind of estictions should we impose on G (o moe pecisely on the pais (V i, V j such that the above situation will be impossible, namely, that the optimal way to tun G into a tiangle fee gaph will involve emoving eithe none o all the edges connecting a pai (V i, V j (up to some small eo. This will clealy imply that we also have E F (G E F (W. One natual estiction is that the pais (V i, V j would be andom bipatite gaphs. While this estiction indeed woks it is of no use fo ou investigation as we ae tying to design an algoithm that can handle abitay gaphs and not necessaily andom gaphs. One is thus tempted to eplace andom bipatite gaph with γ-egula pais fo some small enough γ. Unfotunately, we did not manage to pove that thee is a small enough γ > 0 ensuing that even if all pais (V i, V j ae γ-egula then E F (G E F (W. In ode to cicumvent this difficulty we use the stonge notion of E-egulaity defined in Section 2. As it tuns out, if one uses an appopiately defined function E, then if all pais (V i, V j ae E(k-egula, one can infe that E F (G E F (W. This esult is (essentially fomulated in Lemma 3.4. In the above discussion we consideed the case F = {K 3 }. So suppose now that F is an abitay (possibly infinite family of gaph. Suppose we use a weighted complete gaph W on k vetices as above in ode to appoximate some k-patite gaph. The question that natually aises at this stage is what poblem should we ty to solve on W in ode to get an appoximation of E F (G. It is easy to see that G may be vey fa fom being F-fee, while at the same time W can be F-fee, simply because F does not contain gaphs of size at most k. As an example, conside the case, whee the popety is that of containing no copy of the complete bipatite gaph with two vetices in each side, denoted K 2,2. Now, if G is the complete bipatite gaph K n/2,n/2 then it is vey fa fom being K 2,2 -fee. Howeve, in this case W is just an edge that spans no copy of K 2,2. It thus seems that we must solve a diffeent poblem on W. To fomulate this poblem we need the following definitions. Definition 3.2 (F-homomophism-fee Fo a family of gaphs F, a gaph W is called F- homomophism-fee if F W fo any F F. We now define a measue analogous to E F but with espect to making a gaph F-homomophismfee. Note that we focus on weighted gaphs. Definition 3.3 (H F (W Fo a family of gaphs F and a weighted complete gaph W on k vetices, let H F(W denote the minimum total weight of a set of edges, whose emoval fom W tuns it into an F-homomophism-fee gaph. Define, H F (W = H F(W /k 2. Note, that in Definition 3.2 the gaph W is an unweighed not necessaily complete gaph. Also, obseve that when F = {K 3 } then we have H F (W = E F (W. As it tuns out, the ight poblem to solve on W is to compute H F (W. This is fomulated in the following key lemma, whose poof appeas in Section 4: 10

Lemma 3.4 (The Key Lemma Fo evey family of gaphs F, thee ae functions N 3.4 (k, ɛ and γ 3.4 (k, ɛ with the following popety 2 : Let W be any weighted complete gaph on k vetices and let G be any k-patite gaph with patition classes V 1,..., V k of equal size such that 1. V 1 =... = V k N 3.4 (k, ɛ. 2. All pais (V i, V j ae γ 3.4 (k, ɛ-egula. 3. Fo evey 1 i < j k we have d(v i, V j = w(i, j. Then, E F (G H F (W ɛ. It is easy to ague as we did above and pove that E F (G H F (W in Lemma 3.4 (see the poof of Lemma 3.5, howeve we will not need this (tivial diection. It is impotant to note that while Lemma 3.4 is vey stong as it allows us to appoximate E F (G via computing H F (W (ecall that W is intended to be vey small compaed to G its main weakness is that it equies the egulaity between each of the pais to be a function of k, which denotes the numbe of patition classes, athe than depending solely on the family of gaphs F. We note that even if F = {K 3 } as discussed above, we can only pove Lemma 3.4 with a egulaity measue that depends on k. This supplies some explanation as to why Lemma 2.6 (the standad egulaity lemma is not sufficient fo ou puposes; note that the input to Lemma 2.6 is some fixed γ > 0 and the output is a γ-egula equipatition with numbe of patition classes that depends on γ (the function T 2.6 (m, γ. Thus, even if all pais ae γ-egula, this γ may be vey lage when consideing the numbe of patition classes etuned by Lemma 2.6 and the egulaity measue which Lemma 3.4 equies. Hence, the standad egulaity lemma cannot help us with applying Lemma 3.4. In ode to ovecome this poblem we use the notion of E-egula patitions and the stonge egulaity-lemma given in Lemma 2.9, which, when appopiately used, allows us to apply Lemma 3.4 in ode to obtain Lemma 3.5 below, fom which Theoem 1.1 follows quite easily. The poof of this lemma appeas in Section 4. Lemma 3.5 Fo any ɛ > 0 and family of gaphs F thee ae functions N 3.5 ( and E 3.5 ( satisfying the following 3 : Suppose a gaph G has an E 3.5 -egula equipatition A = {V i 1 i k}, B = {V i,j 1 i k, 1 j l}, whee 1. k 1/ɛ. 2. V i,j N 3.5 (k fo evey 1 i k and 1 j l. Let W be a weighted complete gaph on k vetices with w(i, j = d(v i, V j. Then, E F (G H F (W ɛ. Using the algoithmic vesion of Lemma 2.9, which is given in Poposition 2.11, we can ephase the above lemma in a moe algoithmic way, which is moe o less the algoithm of Theoem 1.1: Given a gaph G we use the O(n 2 time algoithm of Poposition 2.11 in ode to obtain the equipatition descibed in the statement of Lemma 3.5. We then constuct the gaph W as in Lemma 3.5, and finally use exhaustive seach in ode to pecisely compute H F (W. By Lemma 3.5, this gives a good appoximation of E F (G. The poof of Theoem 1.1 appeas in Section 5. 2 The functions N 3.4 (k, ɛ and γ 3.4 (k, ɛ will also (implicitly depend on F. 3 The functions N 3.5( and E 3.5( will also (implicitly depend on ɛ and F. 11

4 Poofs of Lemmas 3.4 and 3.5 In this section we apply ou new stuctual technique in ode to pove Lemmas 3.4 and 3.5. Regetfully, it is had to pecisely state what ae the ingedients of this technique. Roughly speaking, it uses the notion of E-egulaity in ode to patition the edges of a gaph into a bounded numbe of edge sets, which have egula-patitions that ae almost identical 4 and moe impotantly, the egulaity-measue of each of the bipatite gaphs in each of the edge sets can be a function of the numbe of clustes. We stat this section with some definitions that will be vey useful fo the poof of Lemma 3.4. Definition 4.1 Fo any (possibly infinite family of gaphs F, and any intege let F be the following set of gaphs: A gaph R belongs to F if it has at most vetices and thee is at least one F F such that F R. Definition 4.2 Fo any family of gaphs F and intege fo which F, define Ψ F ( = max R F min V (F. (1 {F F:F R} Define Ψ F ( = 0 if F =. Theefoe, Ψ F ( is monotone non-deceasing in. Pacticing definitions, note that if F is the family of odd cycles, then F k is pecisely the family of non-bipatite gaphs of size at most k. Also, in this case Ψ F (k = k when k is odd, and Ψ F (k = k 1 when k is even. The ight way to think of the function Ψ F is the following: Let R be a gaph of size at most k and suppose we ae guaanteed that thee is a gaph F F such that F R (thus R F k. Then by this infomation only and without having to know the stuctue of R itself, the definition of Ψ F implies that thee is a gaph F F of size at most Ψ F (k, such that F R. The function Ψ F has a citical ole in the poof of Lemma 3.4. While poving this lemma we will use Lemma 2.3 in ode to deive that some k sets of vetices, which ae egula enough, span some gaph F F. Roughly speaking, the main difficulty will be that we will not know the size of F, and as a consequence will not know the egulaity measue between these sets that is sufficient fo applying Lemma 2.3 on these k sets (this quantity is γ 2.3 (η, k, V (F. Howeve, we will know that thee is some F F which is spanned by these sets. The function Ψ F ( will thus be vey useful as it supplies an uppe bound fo the size of the smallest F F which is spanned by these sets. See Poposition 4.4, whee Ψ F ( has a cucial ole. Poof of Lemma 3.4: Given ɛ and k let T = T (k, ɛ = T 2.6 (k, γ 2.3 (ɛ/2, k, Ψ F (k. (2 We pove the lemma with γ 3.4 (k, ɛ and N 3.4 (k, ɛ satisfying γ 3.4 (k, ɛ = min(ɛ/2, 1/T, (3 N 3.4 (k, ɛ = T N 2.3 (ɛ/2, k, Ψ F (k (4 Suppose G is a gaph on n vetices, in which case each set V i is of size n k. We may thus show that one must emove at least H F (W n 2 ɛn 2 edges fom G in ode to make it F-fee. To this 4 Two egula patitions V 1,..., V k and U 1,..., U k ae identical if d(v i, V j = d(u i, U j 12

end, it is enough to show that if thee is a gaph G that is obtained fom G by emoving less than H F (W n 2 ɛn 2 edges and spans no F F then it is possible to emove fom W a set of edges of total weight less than H F (W k 2 and obtain a gaph W that is F-homomophism-fee. This will obviously be a contadiction. Assume such a G exists and apply Lemma 2.6 on it with γ = γ 2.3 ( 1 2 ɛ, k, Ψ F(k and m = k (we use m = k as G is aleady patitioned into k subsets V 1,..., V k. Fo the est of the poof we denote by V i,1,..., V i,l the patition of V i that Lemma 2.6 etuns. Recall that as V 1 =... = V k and Lemma 2.6 patitions a gaph into subsets of equal size, then all the sets V i ae patitioned into the same numbe l of subsets. Note also that by Lemma 2.6 and the definition of T in (2 we have l < T. Obseve, that T is in fact an uppe bound fo the total numbe of patition classes V i,j. By Lemma 2.6 (ecall that by Comment 2.4 we may assume γ 2.3 ( 1 2 ɛ, k, Ψ F(k 1 2ɛ, we ae guaanteed that out of the lk sets V i,j at most 2( ɛ lk 2 pais ae not γ2.3 ( 1 2 ɛ, k, Ψ F(k-egula. We define a gaph G, which is obtained fom G by emoving all the edges connecting pais (V i,i, V j,j that ae not γ 2.3 ( 1 2 ɛ, k, Ψ F(k-egula, and all edges connecting pais (V i,i, V j,j fo which thei edge density in G is smalle than 1 2 ɛ. Poposition 4.3 Thee ae k sets V 1,t1,..., V k,tk such that the gaphs induced by G and G on these k sets diffe by less than H F (W n2 ɛn2 edges. l 2 2l 2 Poof: We fist claim that G is obtained fom G by emoving less than ɛ n2 edges. To see this note that the numbe of edges connecting a pai (V i,i, V j,j is at most (n/kl 2. As thee ae at most ɛ lk 2( 2 pais that ae not γ2.3 ( 1 2 ɛ, k, Ψ F(k-egula, we emove at most ɛ 4 n2 edges due to such pais. Finally, as due to pais, whose edge density is at most 1 2 ɛ, we emove at most ( kl ɛ 2 2 (n/kl2 ɛ 4 n2 edges, the total numbe of edges emoved is at most ɛ 2 n2, as needed. As we assume that G is obtained fom G by emoving less than H F (W n 2 ɛn 2 edges, we get fom the pevious paagaph that G is obtained fom G be emoving less than H F (W n 2 ɛ 2 n2 edges. Suppose fo evey 1 i k we andomly and unifomly pick one of the sets V i,1,..., V i,l. The pobability that an edge, which belongs to G and not to G, is spanned by these k sets is l 2. As G and G diffe by less than H F (W n 2 ɛ 2 n2 edges, we get that the expected numbe of such edges is less than H F (W n2 ɛn2 and theefoe thee must be a choice of k sets that span less than l 2 2l 2 this numbe of such edges. We ae now eady to aive at a contadiction by showing that if it is possible to emove less than H F (W n 2 ɛn 2 edges fom G and thus tun it into an F-fee gaph G, then we can emove fom W a set of edges of total weight less than H F (W k 2 and thus tun it into an F-homomophism-fee gaph W. Let V 1,i1,..., V k,ik be the k sets satisfying the condition of Poposition 4.3 and obtain fom W a gaph W by emoving fom W edge (i, j if and only if the density of (V i,ti, V j,tj in G is 0. Poposition 4.4 W is F-homomophism-fee. Poof: Assume F W fo some F F. As W is a gaph of size k this means (ecall Definition 4.2 that thee is F F of size at most Ψ F (k such that F W. Let ϕ be a homomophism fom F to W. By definition of ϕ, fo any (u, v E(F we have (ϕ(u, ϕ(v is an edge of W. Recall that by definition of G eithe the density of a pai (V i,i, V j,j in G is zeo, o this density is at least 1 2 ɛ and the pai is γ 2.3 ( 1 2 ɛ, k, Ψ F(k-egula. By definition of W, this means that fo evey (u, v E(F the pai (V ϕ(u,tϕ(u, V ϕ(v,tϕ(v has density at least ɛ 2 in G and is γ 2.3 ( 1 2 ɛ, k, Ψ F(k-egula. By item 13

1 of the lemma we have fo all 1 i k that V i N 3.4 (k, ɛ. By ou choice in (4 and the fact that l T, the sets V i,ti must theefoe be of size at least N 3.4 (k, ɛ /l N 3.4 (k, ɛ /T = N 2.3 ( 1 2 ɛ, k, Ψ F(k. Hence, the sets V 1,t1,..., V k,tk satisfy all the necessay equiements needed in ode to apply Lemma 2.3 on them in ode to deduce that they span a copy of F in G (ecall, that we have aleady agued that V (F Ψ F (k. This, howeve, is impossible, as we assumed that G was aleady F-fee and G is a subgaph of G. Poposition 4.5 Fo any i < j the edge densities of (V i, V j and (V i,ti, V j,tj satisfy in G d(v i, V j d(v i,ti, V j,tj 1 2 ɛ. Poof: Recall that 1/l > 1/T and by (3 we have 1/T > γ 3.4 (k, ɛ. We infe that V i,ti = V i /l γ 3.4 (k, ɛ V i. By item 2 of the lemma, each pai (V i, V j is γ 3.4 (k, ɛ-egula in G. Hence, by definition of a egula pai, we must have d(v i, V j d(v i,ti, V j,tj γ 3.4 (k, ɛ 1 2 ɛ. Poposition 4.6 W is obtained fom W by emoving a set of edges of weight less than H F (W k 2. Poof: Let S be the set of edges emoved fom W and denote by w(s the total weight of edges in S. Let e(v i,ti, V j,tj denote the numbe of edges connecting the pai (V i,ti, V j,tj in G. We claim that the following seies of inequalities, which imply that w(s < H F (W k 2, hold: H F (W n2 l 2 ɛn2 2l 2 > (i,j S (i,j S (i,j S e(v i,ti, V j,tj (w(i, j ɛ 2 n2 l 2 k 2 w(i, j n2 l 2 k 2 ɛn2 2l 2 = w(s n2 l 2 k 2 ɛn2 2l 2. Indeed, ecall that by the definition of W, we have (i, j S if and only if the density of the pai (V i,i, V j,j in G is 0, which means that all the edges connecting this pai wee emoved in G. As by Poposition 4.3 the total diffeence between G and G is less than H F (W n2 ɛn2 we infe l 2 2l 2 that the fist (stict inequality is valid. The second inequality follows fom Poposition 4.5 togethe with the fact that by the condition of the lemma we have d(v i, V j = w(i, j. The thid inequality is due to the fact that W has k vetices and thus S k 2. The sought afte contadiction now follows immediately fom Popositions 4.4 and 4.6. completes the poof of the lemma. This We continue with the poof of Lemma 3.5. 14

Poof of Lemma 3.5: We pove the lemma with: and E 3.5 ( = { 1 16 ɛ2, = 0 min( 1 8 ɛ 2, 1 8 ɛ2, γ 3.4 (, 1 8 ɛ, 1 (5 N 3.5 ( = N 3.4 (, 1 8 ɛ. We stat with showing that E F (G H F (W + ɛ. Suppose G is a gaph of n vetices, in which case the numbe of edges connecting V i and V j is w(i, j n2. We fist emove all the edges within the k 2 sets V 1,..., V k. As k 1/ɛ the total numbe of edges emoved in this step is at most k ( n/k 2 ɛn 2. Let S be the set of minimal weight whose emoval tuns W into an F-homomophism-fee gaph W. We claim that if fo evey (i, j S we emove all the edges connecting V i and V j the esulting gaph G spans no copy of a gaph F F. Suppose to the contay that G spans a copy of F F, and conside the mapping ϕ : V (F {1,..., k} that maps evey vetex of F that belongs to V j to j. As we have emoved all the edges within the sets V 1,..., V k and all edges between V i and V j fo any (i, j S we get that ϕ is a homomophism fom F to W contadicting ou choice of S. Finally, note that the numbe of edges emoved in the second step is (i,j S w(i, j n2 k 2 = n2 H F (W. Combined with the fist step the total numbe of edges emoved is at most n 2 H F (W + ɛn 2, as needed. Fo the est of the poof we focus on poving H F (W E F (G + ɛ. Let A and B be the two equipatitions fom the statement of the lemma. Suppose fo evey 1 i k we andomly, unifomly and independently pick a set V i,ti out of the sets V i,1,..., V i,l. Let P denote the event that (i All the pais (V i,ti, V i,t i ae E(k-egula. (ii All but at most 1 2 ɛ( k 2 of the pais (Vi,ti, V i,t i satisfy d(v i,ti, V i,t i d(v i, V i E(0. We need the following obsevations: Poposition 4.7 P holds with pobability at least 1 1 2 ɛ. Poof: Fix any i < i. By definition of E 3.5 we have E(k 1 8 ɛk 2, thus by item 1 of Definition 2.8, the pobability that (V i,ti, V i,t i is not E(k-egula is at most 1 8 ɛk 2. By the union bound, the pobability that one of the pais is not E(k-egula is at most ( k 1 2 8 ɛk 2 1 4 ɛ. Item 2 of Definition 2.8 can be ephased as stating that thee ae at most E(0 ( k 2 = 1 16 ɛ2( k 2 choices of i < i fo which the pobability that d(v i,ti, V i,t i d(v i, V i > E(0 = 1 16 ɛ2 is lage than E(0 = 1 16 ɛ2. Thus, the expected numbe of i < i fo which d(v i,ti, V i,t i d(v i, V i > E(0 is at most 1 16 ɛ2( ( k 2 1 + k 2 1 16 ɛ2 1 8 ɛ2( k 2. By Makov s inequality, the pobability that moe than 1 2 ɛ( k 2 of i < i violate the above inequality is at most ɛ 4. As popeties (i and (ii of event P each hold with pobability at least 1 1 4ɛ, we get that P holds with pobability at least 1 1 2 ɛ. Poposition 4.8 Assume event P holds and denote by G the subgaph of G that is spanned by the sets V 1,t1,..., V k,tk. Then, E F (G H F (W 1 2 ɛ. 15

Poof: Let W be a weighted complete gaph on k vetices satisfying w(i, i = d(v i,ti, V i,t i. Event P assumes that all the pais (V i,ti, V i,t i ae E(k-egula. As E(k γ 3.4 (k, 1 8ɛ and the lemma assumes that V i,j N 3.5 (k = N 3.4 (k, 1 8ɛ we may deduce fom Lemma 3.4 that E F (G H F (W ɛ 8. (6 Now, event P also assumes that all but at most 2( ɛ k 2 of the pais i < i ae such that d(v i, V i d(v i,ti, V i,t i E(0 < ɛ 8. This means that the sum of edge weights of W diffes fom the sum of edge weights of W by at most 2( ɛ k 2 due to pais that violate the above inequality and by at most ( k ɛ 2 8 due to the othe pais. This means that the sum of edge weights of W diffes fom that of W by at most ɛ 4 k2 + ɛ 16 k2 3ɛ 8 k2. This clealy implies that The poof now follows by combining (6 and (7. H F (W H F (W 3ɛ 8. (7 Let R be an abitay set of edges whose emoval fom G tuns it into an F-fee gaph. Randomly and unifomly select a set V i,ti fom each of the sets V i,1,..., V i,l, and let R denote the set of edges of R that ae spanned by these k sets. We claim that the following uppe and lowe bound on the expected size of R hold: 1 l 2 R = E[ R ] E[ R P ] P ob[p ] (1 ɛ 2 E[ R P ] (1 ɛ 2 (H F(W ɛ n2 k2 2 (kl 2 (H F (W ɛ n2 l 2. Indeed, the equality is due to the fact than an edge of R has pobability pecisely 1/l 2 to be in R. The second inequality is due to Poposition 4.7, the thid is due to Poposition 4.8 and the last is valid because H F (W 1. As we thus infe that R H F (W n 2 ɛn 2 fo abitay R, we get that E F (G H F (W ɛ, thus completing the poof. 5 Poofs of Algoithmic Results The technical lemmas poved in the pevious sections enabled us to infe that cetain E-egula patitions may be vey useful fo appoximating E P. In this section we apply Poposition 2.11 in ode to efficiently obtain these patitions. We fist pove Theoem 1.1, while ovelooking some subtle issues. We then discuss them is detail. Poof of Theoem 1.1: Fix any ɛ > 0 and monotone gaph popety P. Let F = F P be the family of fobidden subgaphs of P as in Definition 3.1. As satisfying P is equivalent to being F-fee, we 16

focus on appoximating E F (G. Let E 3.5 ( and N 3.5 ( be the appopiate function with espect to F and ɛ. Put S(ɛ = S 2.9 (1/ɛ, E 3.5 and ecall that by Poposition 2.10 the intege S can indeed be uppe bounded by a function of ɛ. If an input gaph has less than S(ɛ N 3.5 (S(ɛ vetices we use exhaustive seach in ode to pecisely compute E F (G. Assume then that G has moe than S(ɛ N 3.5 (S(ɛ vetices, and use Poposition 2.11 with m = 1/ɛ and E 3.5 ( as above in ode to compute the equipatition A = {V i 1 i k} and its efinement B = {V i,j 1 i k, 1 j l} satisfying the conditions of Lemma 2.9. As m is bounded by a function of ɛ we get fom Poposition 2.11 that this step takes time O(n 2. Also, by Lemma 2.9 we have kl S, theefoe, as G has at least S(ɛ N 3.5 (S(ɛ vetices each of the sets V i,j is of size at least N 3.5 (S(ɛ N 3.5 (k. Let W be a weighted complete gaph of size k whee w(i, j = d(v i, V j. Using exhaustive seach, we can now pecisely compute the value of H F (W. By Lemma 3.5 we may infe that E F (G H F (W ɛ. As we have mentioned in the intoduction, one should specify how the popety P is given to the algoithm. Fo example, P may be an undecidable popety, in which case we cannot do anything. We thus focus on decidable gaph popeties. Howeve, even in this case we may face some unexpected poblems. Note, that fo a geneal infinite family of gaphs F it is not clea how to compute H F in finite time. Also, etuning to the oveview of the poof of Lemma 2.9 given in Section 2, note that we have implicitly assumed that one can compute the function E, as this is needed in ode to compute the paametes with which one applies Lemma 2.10. A close inspection of the poofs of Lemmas 3.4 and 3.5 eveals that computing E involves computing the function Ψ F (see (2, (3 and (5. One of the main esults of [5] assets that somewhat supisingly, thee is a family of gaph popeties F, fo which the popety of being F-fee is decidable (in fact, in conp but at the same time Ψ F is not computable. Theefoe, even if we confine ouselves to decidable gaph popeties we still un into touble. Suppose fist that ɛ is not pat of the input to the algoithm. As we have discussed in Section 2, in this case all the applications of E 3.5 ae on inputs of size depending on ɛ only, thus the algoithm may keep the answes to these (finitely many applications of E 3.5 as pat of its desciption. Similaly, in this case we may need to compute H F on gaphs of size depending on ɛ only 5, thus the algoithm may keep the answes to these (finitely many applications of H F as pat of its desciption. Obseve, that we don t need to keep the answe of H F fo all the (infinite ange of edge weights. Rathe, as we only need to appoximate E F within an additive eo of ɛ, it is enough to conside edge weights {0, ɛ, 2ɛ, 3ɛ,..., 1}. If we want the algoithm to be able to accept ɛ as pat of the input, then we must confine ouselves to popeties fo which Ψ F is computable. Howeve, as fo any easonable gaph popety this function is computable, this is not a eal constaint. Fo example, as we have mentioned in Section 4, if P is the popety of being bipatite, then Ψ F (k is eithe k o k 1. Anothe natual family of popeties fo which Ψ F (k is computable is that of being H-fee fo a fixed gaph H, as in this case Ψ F (k V (H. By the definition of the function E 3.5 we get that if Ψ F is computable then so is E 3.5. It is also not difficult to see that if Ψ F is computable then so is H F. Theefoe, in case Ψ F is computable, thee is no poblem with accepting ɛ as pat of the input. We now tun to pove Theoem 1.2. We note that the above difficulties ae also elevant fo Coollay 1.2, which applies Theoem 1.2, but we efain fom discussing them again. Poof of Theoem 1.2: (sketch As in the pevious poof, we focus on the popety of being F- 5 Recall that the size of the gaph on which we compute H F is the numbe of patition classes of the E-egula patition, and this numbe is at most S 2.9(m, E, which is bounded by a function of ɛ. 17