# Algorithmic version for Szemerédi regularity partition

A Simple Algorithm for Constructing Szemerédi's Regularity Partition is a paper by Alan M. Frieze and Ravi Kannan giving an algorithmic version of the Szemerédi regularity lemma to find an ε-regular partition of a given graph.

## Formal statement of the regularity lemma

The formal statement of Szemerédi's regularity lemma requires some definitions. Let G be a graph. The density d(X,Y) of a pair of disjoint vertex sets X, Y is defined as d(X,Y)=|E(X,Y)|/|X||Y| where E(X,Y) denotes the set of edges having one end vertex in X and one in Y. For ε>0, a pair of vertex sets X and Y is called ε-regular, if for all subsets AX and BY satisfying |A| ≥ε |X| and |B| ≥ ε |Y|, we have |d(X,Y)-d(A,B)| ≤ ε.

A partition of the vertex set of G into k sets, V1,...,Vk, is called an equitable partition if for all ${\displaystyle i,j}$, ||Vi|-|Vj||≤1. An equitable partition is an ${\displaystyle \epsilon }$-regular partition, if for all but at most ${\displaystyle \epsilon {k^{2}}}$ pairs (i,j) the pair ${\displaystyle (V_{i},V_{j},)}$ is ${\displaystyle \epsilon }$-regular.

Now we are ready to state the regularity lemma.

Regularity lemma. For every ${\displaystyle \epsilon >0}$ and positive integer ${\displaystyle m}$ there exist integers ${\displaystyle N}$ and ${\displaystyle M}$ such that if ${\displaystyle G}$ is a graph with at least ${\displaystyle N}$ vertices, there exists an integer ${\displaystyle k}$ in the range ${\displaystyle m}$${\displaystyle k}$${\displaystyle M}$ and an ${\displaystyle \epsilon }$-regular partition of the vertex set of ${\displaystyle G}$ into ${\displaystyle k}$ sets.

It is a common variant in the definition of an ${\displaystyle \epsilon }$-regular partition to require that the vertex sets all have the same size, while collecting the leftover vertices in an "error"-set ${\displaystyle V_{0}}$ whose size is at most an ${\displaystyle \epsilon }$-fraction of the size of the vertex set of ${\displaystyle G}$.

Szemerédi's regularity lemma is one of the most powerful tools of extremal graph theory. It says that, in some sense, all graphs can be approximated by random-looking graphs. Therefore the lemma helps in proving theorems for arbitrary graphs whenever the corresponding result is easy for random graphs. The first constructive version was provided by Alon, Duke, Leffman, Rödl and Yuster.[1] Subsequently Frieze and Kannan gave a different version and extended it to hypergraphs.[2] The paper [3] is a nice survey on regularity lemma and its various applications. Here we will briefly describe a different construction due to Alan Frieze and Ravi Kannan that uses singular values of matrices.

## Constructive version of Szemerédi regularity lemma by Frieze and Kannan

The algorithm[4] is based on two crucial lemmas:

Lemma 1:
Fix k and ${\displaystyle \gamma }$ and let ${\displaystyle G=(V,E)}$ be a graph with ${\displaystyle n}$ vertices. Let ${\displaystyle P}$ be an equitable partition of ${\displaystyle V}$ in classes ${\displaystyle V_{0},V_{1},...,V_{k}}$. Assume ${\displaystyle |V_{1}|>4^{2k}}$ and ${\displaystyle 4^{k}>600\gamma ^{2}}$. Given proofs that more than ${\displaystyle \gamma k^{2}}$ pairs ${\displaystyle (V_{r},V_{s})}$ are not ${\displaystyle \gamma }$-regular, it is possible to find in O(n) time an equitable partition ${\displaystyle P'}$ (which is a refinement of ${\displaystyle P}$) into ${\displaystyle 1+k4^{k}}$ classes, with an exceptional class of cardinality at most ${\displaystyle |V_{0}|+n/4^{k}}$ and such that ${\displaystyle ind(P')}$${\displaystyle ind(P)+\gamma ^{5}/20}$

Lemma 2:
Let ${\displaystyle W}$ be a ${\displaystyle R}$×${\displaystyle C}$ matrix with ${\displaystyle |R|=p}$, ${\displaystyle |C|=q}$ and ${\displaystyle \|W\|_{\inf }\leq 1}$ and ${\displaystyle \gamma }$ be a positive real.
(a) If there exist ${\displaystyle S}$${\displaystyle R}$, ${\displaystyle T}$${\displaystyle C}$ such that ${\displaystyle |S|}$${\displaystyle \gamma p}$, ${\displaystyle |T|}$${\displaystyle \gamma q}$ and ${\displaystyle |W(S,T)|}$${\displaystyle \gamma |S||T|}$ then ${\displaystyle \sigma _{1}(W)\geq \gamma ^{3}{\sqrt {pq}}}$
(b) If ${\displaystyle \sigma _{1}(W)\geq \gamma {\sqrt {pq}}}$, then there exist ${\displaystyle S}$${\displaystyle R}$, ${\displaystyle T}$${\displaystyle C}$ such that ${\displaystyle |S|}$${\displaystyle \gamma 'p}$, ${\displaystyle |T|}$${\displaystyle \gamma 'q}$ and ${\displaystyle W(S,T)}$${\displaystyle \gamma '|S||T|}$ where ${\displaystyle \gamma '=\gamma ^{3}/108}$. Furthermore ${\displaystyle S}$, ${\displaystyle T}$ can be constructed in polynomial time.

These two lemmas are combined in the following algorithmic construction of the Szemerédi regularity lemma.

[Step 1] Arbitrarily divide the vertices of ${\displaystyle G}$ into an equitable partition ${\displaystyle P_{1}}$ with classes ${\displaystyle V_{0},V_{1},...,V_{b}}$ where ${\displaystyle |V_{i}|=\lfloor n/b\rfloor }$ and hence ${\displaystyle |V_{0}|. denote ${\displaystyle k_{1}=b}$.
[Step 2] For every pair ${\displaystyle (V_{r},V_{s})}$ of ${\displaystyle P_{i}}$, compute ${\displaystyle \sigma _{1}(W_{r,s})}$. If the pair ${\displaystyle (V_{r},V_{s})}$ are not ${\displaystyle \epsilon -}$regular then by Lemma 2 we obtain a proof that they are not ${\displaystyle \gamma =\epsilon ^{9}/108-}$regular.
[Step 3] If there are at most ${\displaystyle \epsilon {k_{1} \choose 2}}$ pairs that produce proofs of non ${\displaystyle \gamma -}$regularity that halt. ${\displaystyle P_{i}}$ is ${\displaystyle \epsilon -}$regular.
[Step 4] Apply Lemma 1 where ${\displaystyle P=P_{i}}$, ${\displaystyle k=k_{i}}$, ${\displaystyle \gamma =\epsilon ^{9}/108}$ and obtain ${\displaystyle P'}$ with ${\displaystyle 1+k_{i}4^{k_{i}}}$ classes
[Step 5] Let ${\displaystyle k_{i}+1=k_{i}4^{k_{i}}}$, ${\displaystyle P_{i}+1=P'}$, ${\displaystyle i=i+1}$ and go to Step 2.

The algorithm will terminate with an ${\displaystyle \epsilon }$-regular partition in ${\displaystyle O(\epsilon ^{-45})}$ steps since the improvement at each step is ${\displaystyle \gamma ^{5}/20=O(\epsilon ^{45})}$.

## References

1. ^ N. Alon and R. A. Duke and H. Lefmann and V. Rödl and R. Yuster, (1994). "The Algorithmic Aspects of the Regularity Lemma". J. Algorithms. CiteSeerX .
2. ^ A. Frieze and R. Kannan, (1996). "The regularity lemma and approximation schemes for dense problems,". FOCS '96: Proceedings of the 37th Annual Symposium on Foundations of Computer Science,.
3. ^ Komlós, János; Simonovits, Miklós (1996). "Szemeredi's Regularity Lemma and its applications in graph theory". Technical Report: 96-10, DIMACS..
4. ^ A. Frieze and R. Kannan (1999). "A Simple Algorithm for Constructing Szemerédi's Regularity Partition" (PDF). Electr. J. Comb. 6.