









Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!










Alexander Barvinok
October 2014
Abstract. We present a deterministic algorithm which, given a graph G with n ver-
tices and an integer 1 < m ≤ n, computes in n
O(ln m) time the sum of weights w(S)
over all m-subsets S of the set of vertices of G, where w(S) = exp
{ γtm + O
( 1 m
)}
provided exactly t
( m 2
) pairs of vertices of S span an edge of G for some 0 ≤ t ≤ 1.
Here γ > 0 is an absolute constant: we can choose γ = 0.06, and if n ≥ 4 m and
m ≥ 10, we can choose γ = 0.18. This allows us to tell apart the graphs that do
not have m-subsets of high density from the graphs that have sufficiently many m-
subsets of high density, even when the probability to hit such a subset at random is
exponentially small in m.
(1.1) Density of a subset in a graph. Let G = (V, E) be an undirected graph
with set V of vertices and set E of edges, without loops or multiple edges. Let
S ⊂ V be a subset of the set of vertices of G. We define the density σ(S) of S as
the ratio of the number of the edges of G with both endpoints in S to the maximum
possible number of edges spanned by vertices in S:
σ(S) =
|{u, v} ∈ E : u, v ∈ S| ( |S| 2
Hence
0 ≤ σ(S) ≤ 1 for all S ⊂ V.
In particular, σ(S) = 0 if and only if S is an independent set, that is, no two vertices
of S span an edge of G and σ(S) = 1 if and only if S is a clique, that is, every two
vertices of S span an edge of G.
1991 Mathematics Subject Classification. 15A15, 68C25, 68W25, 60C05.
Key words and phrases. algorithm, clique, partition function, subgraph density, graph.
This research was partially supported by NSF Grants DMS 0856640 and DMS 1361541.
Typeset by AMS-TEX
In this paper, we suggest a new approach to testing the existence of subsets S
of a given size m = |S| with high density σ(S). Namely, we present a deterministic
algorithm, which, given a graph G with n vertices and an integer 1 < m ≤ n
computes in n
O(ln m) time (within a relative error of 0.1, say) the sum
(1.1.1) Densitym(G) =
S⊂V |S|=m
exp
γmσ(S) + O
m
where γ > 0 is an absolute constant: we can choose γ = 0.06 and if n ≥ 4 m and
m ≥ 10 then we can choose γ = 0.18. All implicit constants in the “O” notation
are absolute.
Let us fix two non-negative real numbers σ and such that σ + ≤ 1. If there
are no m-subsets S with density σ or higher then
Densitym(G) ≤
n
m
exp
γmσ + O
m
If, however, the there are sufficiently many m-subsets S with density σ + or higher,
that is, if the probability to hit such a subset at random is at least 2 exp{−γm},
then
Densitym(G) ≥ 2
n
m
exp
γmσ + O
m
and we can distinguish between these two cases in n
O(ln m) time. Note that “many
subsets” still allows for the probability to hit such a subset at random to be expo-
nentially small in m.
It turns out that we can compute in n
O(ln m) time an m-subset S, which is
almost as dense as the average under the exponential weighting of (1.1.1), that is,
an m-subset S satisfying
(1.1.2) exp
γmσ(S)
n
m
Densitym(G),
cf. Remark 3.6.
We compute (1.1.1) using partition functions.
(1.2) The partition function of cliques. Let W = (wij ) be an n × n symmetric
matrix, interpreted as a matrix of weights on the edges of the complete graph on n
vertices. For an integer 1 < m ≤ n, we define a polynomial
Pm(W ) =
S⊂{ 1 ,... ,n} |S|=m
{i,j}⊂S i 6 =j
wij ,
which we call the partition function of cliques (note that it is different from what is
known as the partition function of independent sets, see [SS05] and [BG08]). Thus
(1.4) Lemma. Suppose that there exists a real β > 1 such that
Pm
J + z(W − J)
= 0 for all z ∈ C satsifying |z| ≤ β.
Then the right hand side of (1.3.2) approximates f (1) within an additive error of
m(m − 1)
2(l + 1)β
l (β − 1)
In particular, for a fixed β > 1, to ensure an additive error of 0 < < 1, we can
choose l = O (ln m − ln ), which results in the algorithm for approximating Pm(W )
within relative error in n
O(ln m−ln ) time. We prove Lemma 1.4 in Section 2.
Thus we have to identify a class of matrices W for which the number β > 1 of
Lemma 1.4 exists. We prove the following result.
(1.5) Theorem. There is an absolute constant ω > 0 (one can choose ω = 0. 061 ,
and if m ≥ 10 and n ≥ 4 m, one can choose ω = 0. 181 ) such that for any positive
integers 1 < m ≤ n, for any n × n symmetric complex matrix Z = (zij ), we have
Pm(Z) 6 = 0
as long as
|zij − 1 | ≤
ω
m − 1
for all i, j.
We prove Theorem 1.5 in Section 3. Theorem 1.5 implies that if (1.2.1) holds,
where 0 < γ < ω is an absolute constant, we can choose β = ω/γ in Lemma 1.
and obtain an algorithm which computes Pm(W ) within a given relative error in
n
O(ln m−ln ) time. Thus we can choose γ = 0.06 and β = 61/60 and if m ≥ 10 and
n ≥ 4 m, we can choose γ = 0.18 and β = 181/180.
(1.6) Weighted enumeration of subsets. Given a graph G with set of vertices
V = { 1 ,... , n} and set E of edges, we define a weight W by
wij =
γ m− 1
if {i, j} ∈ E
γ m− 1
otherwise,
where γ > 0 is an absolute constant in (1.2.1). Thus we can choose γ = 0.06 and if
m ≥ 10 and n ≥ 4 m, we can choose γ = 0.18. We define the functional (1.1.1) by
Densitym(G) = e
γm
γ
m − 1
)−(m 2 )
Pm(W ).
Then we have
Densitym(G) =
S⊂V |S|=m
w(S),
where
w(S) =e
γm
γ
m − 1
)(t−1)(m 2 )^
γ
m − 1
)(1−t)(m 2 )
= exp
γmt + O
m
provided exactly t
m 2
pairs of vertices of S span an edge of G, that is, provided
σ(S) = t. Thus we are in the situation described in Section 1.1.
(1.7) Comparison with results in the literature. The topic of this paper
touches upon some very active research areas, such as finding dense subgraphs
in a given graph (see, for example, [Bh12] and references therein), computational
complexity of partition functions (see, for example, [BG05] and references therein)
and complex zeros of partition functions (see, for example, [SS05] and references
therein). Detecting dense subsets is notoriously hard. It is an NP-hard problem
to approximate the size |S| of the largest clique S within a factor of |V |
1 − for
any fixed 0 < ≤ 1 [H˚a99], [Zu07]. In [F+01], a polynomial time algorithm for
approximating the highest density of an m-subset within a factor of O(n
1 3 −) for
some small > 0 was constructed. The paper [B+10] presents an algorithm of
n
O(1/) complexity which approximates the highest density of an m-subset within
a factor of n
1 4 +^ and an algorithm of O
n
ln n
complexity which approximates the
density within a factor of O(n
1 / 4 ), the current record (note that [F+01], [Bh12]
and [B+10] normalize density slightly differently than we do). It has also been
established that modulo some plausible complexity assumptions, it is hard to ap-
proximate the highest density of an m-subset within a constant factor, fixed in
advance, see [Bh12].
We note that while searching for a dense m-subset in a graph on n vertices, the
most interesting case to consider is that of a growing m such that m = o(n), since
for any fixed > 0 one can compute in polynomial time the maximum number of
edges of G spanned by an m-subset S of vertices of G within an additive error of n
2
[FK99] (the complexity of the algorithm is exponential in 1/). Of course, for any
constant m, fixed in advance, all subsets of size m can be found by the exhaustive
search in polynomial time.
The appearance of partition functions in combinatorics can be traced back to the
work of Kasteleyn on the statistics of dimers (perfect matchings), see for example,
Section 8.7 of [LP09]. A randomized polynomial time approximation algorithm
(based on the Markov Chain Monte Carlo approach) for computing the partition
function of the classical Ising model was constructed by Jerrum and Sinclair in
[JS93]. A lot of work has recently been done on understanding the computational
complexity of the partition function of graph homomorphisms [BG05], where a cer-
tain “dichotomy” of instances has been established: it is either #P -hard to compute
exactly (in most interesting cases) or it is computable in polynomial time exactly (in
few cases). Recently, an approach inspired by the “correlation decay” phenomenon
We note that g(0) =
n m
. If we compute the values of
d
k
dt
k
g(t)
t=
for k = 1,... , l,
then the formulas (2.1.2) for k = 1,... , l provide a non-degenerate triangular sys-
tem of linear equations that allows us to compute
d
k
dt
k
f (t)
t=
for k = 1,... , l.
Hence our goal is to compute the values (2.1.3).
We have
d
k
dtk^
g(t)
t=
S⊂{ 1 ,... ,n} |S|=m
I=({i 1 ,j 1 },... ,{ik ,jk }) {i 1 ,j 1 },... ,{ik ,jk }⊂S
(wi 1 j 1 − 1) · · · (wik jk − 1) ,
where the inner sum is taken over all ordered sets I of k pairs {i 1 , j 1 },... , {ik, jk}
of points from S.
For an ordered set
I = ({i 1 , j 1 },... , {ik, jk})
of k pairs of points from the set { 1 ,... , n}, let
ρ(I) =
⋃^ k
s=
{is, js}
be the total number of distinct points among i 1 , j 1 ,... , ik, jk. Since there are
exactly ( n − ρ(I)
m − ρ(I)
m-subsets S ⊂ { 1 ,... , n} containing the pairs {i 1 , j 1 },... , {ik, jk}, we can further
rewrite
d
k
dt
k
g(t)
t=
I=({i 1 ,j 1 },... ,{ik ,jk }) {i 1 ,j 1 },... ,{ik ,jk }⊂{ 1 ,... ,n}
n − ρ(I)
m − ρ(I)
(wi 1 j 1 − 1) · · · (wik jk − 1) ,
where the sum is taken all ordered sets I of k pairs {i 1 , j 1 },... , {ik, jk} of points
from the set { 1 ,... , n}. The algorithm consists in computing the latter sum. Since
the sum contains not more than n
2 k = n
O(l) terms, the complexity of the algorithm
is indeed n
O(l) , as claimed.
(2.2) Proof of Lemma 1.4. The function g(z) defined by (2.1.1) is a polynomial
in z of degree d ≤
m 2
with g(0) =
n m
= 0, so we factor
g(z) = g(0)
∏^ d
i=
z
αi
where α 1 ,... , αd are the roots of g(z). By the condition of Lemma 1.4, we have
|αi| ≥ β > 1 for i = 1,... , d.
Therefore,
(2.2.1) f (z) = ln g(z) = ln g(0) +
d ∑
i=
ln
z
αi
provided |z| ≤ 1 ,
where we choose the branch of ln g(z) that is real at z = 0. Using the standard
Taylor expansion, we obtain
ln
αi
∑^ l
k=
k
αi
)k
where
|ζl| =
+∞ ∑
k=l+
k
αi
)k
(l + 1)βl(β − 1)
Therefore, from (2.2.1) we obtain
f (1) = f (0) +
l ∑
k=
k
d ∑
i=
αi
)k
where
|ηl| ≤
m(m − 1)
2(l + 1)βl(β − 1)
It remains to notice that
k
∑^ d
i=
αi
)k
k!
d
k
dtk^
f (t)
t=
(3.3) Lemma. Let us fix real 0 < τ < 1 , real δ > 0 and an integer 1 ≤ r ≤ m.
Suppose that for all Ω ⊂ { 1 ,... , n} such that |Ω| = r, for all Z ∈ U(δ), we have
PΩ(Z) 6 = 0 and that for all i = 1,... , n we have
τ
m − 1
n ∑
j=
|zij |
∂zij
Then, for any pair of subsets
Ω 1 , Ω 2 ⊂ { 1 ,... , n} such that |Ω 1 | = |Ω 2 | = r and |Ω 1 ∆Ω 2 | = 2,
and for any Z ∈ U(δ), the angle between the complex numbers PΩ 1 (Z) and PΩ 2 (Z),
interpreted as vectors in R
2 = C, does not exceed
θ =
4 δ(m − 1)
τ (1 − δ)
and the ratio of |PΩ 1 (Z)| and |PΩ 2 (Z)| does not exceed
λ = exp
4 δ(m − 1)
τ (1 − δ)
Proof. Let us choose an Ω ∈ { 1 ,... , n} such that |Ω| = r. Since PΩ(Z) 6 = 0 for all
Z ∈ U(δ), we can choose a branch of ln PΩ(Z) that is a real number when Z = J.
Then
∂
∂zij
ln PΩ(Z) =
∂zij
Since |zij | ≥ 1 − δ for all Z ∈ U(δ), we have
n ∑
j=
∂zij
ln PΩ(Z)
m − 1
τ (1 − δ)
for i = 1,... , n.
Without loss of generality, we assume that 1 ∈ Ω 1 , 2 ∈/ Ω 1 and Ω 2 = Ω 1 \ { 1 } ∪ { 2 }.
Given A ∈ U(δ), let B ∈ U(δ) be the matrix defined by
b 1 j = bj 1 = a 2 j = aj 2 and b 2 j = bj 2 = a 1 j = aj 1 for j = 1,... , n
and
bij = aij for all other i, j.
Then
PΩ 2 (A) = PΩ 1 (B)
and
|ln PΩ 1 (A) − ln PΩ 2 (A)| = |ln PΩ 1 (A) − ln PΩ 1 (B)|
(^) sup
Z∈U(δ)
n ∑
j=
∂z 1 j
ln PΩ 1 (Z)
n ∑
j=
∂z 2 j
ln PΩ 1 (Z)
× max j=1,... ,n
{|a 1 j − b 1 j | , |a 2 j − b 2 j |}.
Since |aij − bij | ≤ 2 δ for all A, B ∈ U(δ), by (3.3.1) we conclude that the angle
between the complex numbers PΩ 1 (A) and PΩ 2 (A) does not exceed θ and that the
ratio of their absolute values does not exceed λ.
(3.4) Lemma. Let us fix real δ > 0 , real 0 ≤ θ < π/ 2 , real λ > 1 and an integer
1 < r ≤ m. Suppose that for all Ω ⊂ { 1 ,... , n} such that m ≥ |Ω| ≥ r and for all
Z ∈ U(δ), we have PΩ(Z) 6 = 0 and that for any pair of subsets
Ω 1 , Ω 2 ⊂ { 1 ,... , n} such that m ≥ |Ω 1 | = |Ω 2 | ≥ r and |Ω 1 ∆Ω 2 | = 2,
and for any Z ∈ U(δ), the angle between two complex numbers PΩ 1 (Z) and PΩ 2 (Z)
considered as vectors in R
2 = C does not exceed θ while the ratio of |PΩ 1 (Z)| and
|PΩ 2 (Z)| does not exceed λ. Let
τ =
cos θ
λ
Then, for any subset Ω ⊂ { 1 ,... , n} such that |Ω| = r − 1 , all Z ∈ U(δ) and all
i = 1,... , n, we have
τ
m − 1
∑^ n
j=
|zij |
∂zij
In addition,
if
n
m
λ √ cos θ
the inequality (3.4.1) holds with
τ =
cos θ.
Proof. Let us choose a subset Ω ⊂ { 1 ,... , n} such that |Ω| = r − 1. Let us define
Ωj = Ω ∪ {j} for j /∈ Ω.
Suppose first that i ∈ Ω. Then, for j ∈ Ω we have
∂zij
PΩ(Z) = z
− 1 ij PΩ(Z)
If r = m then
∂
∂zij
PΩ(Z) = 0 for any j /∈ Ω
and
∑n
j=
|zij |
∂zij
= (m − 1) |PΩi | if r = m.
By (3.1.1), we have
j /∈Ω
PΩj (Z)
and hence by Lemma 3.
cos θ
j /∈Ω
Ωj (Z)
cos θ |PΩi (Z)| ,
which proves (3.4.1) in the case of r = m with τ =
cos θ.
If r < m, then for j /∈ Ωi, let Ωij = Ω ∪ {i, j}. Then, for j /∈ Ωi, we have
∂zij
∂zij
PΩij (Z) = z
− 1 ij PΩij (Z)
and hence
|zij |
∂zij
Ωij (Z)
∣ (^) provided i /∈ Ω and j /∈ Ω.
From (3.4.4),
∑^ n
j=
|zij |
∂zij
= (r − 1) |PΩi (Z)| +
j /∈Ωi
Ωij (Z)
∣ (^) if r < m.
By (3.1.1), we have
PΩi (Z) =
m − r
j: j /∈Ωi
PΩij (Z)
and hence by Lemma 3.2, we have
|PΩi (Z)| ≥
cos θ
m − r
j: j /∈Ωi
Ωij (Z)
Comparing this with (3.4.5), we conclude as above that
(3.4.6) |PΩi (Z)| ≥
cos θ
m − 1
n ∑
j=
|zij |
∂zij
It remains to compare |PΩi (Z)| and |PΩ(Z)|. Since the ratio of any two
Ωj 1
Ωj 2
∣ (^) does not exceed λ, from (3.4.3) we conclude that
cos θ
λ
n − r + 1
m − r + 1
|PΩi (Z)|
cos θ
λ
|PΩi (Z)| for all i /∈ Ω.
The proof now follows by (3.4.6).
(3.5) Proof of Theorem 1.5.
One can see that for a sufficiently small ω > 0, the equation
θ =
4 ω exp{θ}
(1 − ω) cos θ
has a solution 0 < θ < π/2. Numerical computations show that one can choose
ω = 0.061, in which case
θ ≈ 0. 4580097179.
Let
λ = exp{θ} ≈ 1. 580924366 and τ =
cos θ
exp{θ}
Let
δ =
ω
m − 1
For r = m,... , 1 we prove the following three statements (3.5.1) – (3.5.3):
(3.5.1) Let Ω ⊂ { 1 ,... , n} be a set such that |Ω| = r. Then, for any Z ∈ U(δ),
Z = (zij ), we have
(3.5.2) Let Ω ⊂ { 1 ,... , n} be a set such that |Ω| = r. Then for any Z ∈ U(δ)
and any i = 1,... , n, we have
τ
m − 1
n ∑
j=
|zij |
∂zij
(3.5.3) Let Ω 1 , Ω 2 ⊂ { 1 ,... , n} be sets such that |Ω 1 | = |Ω 2 | = r and |Ω 1 ∆Ω 2 | =
as vectors in R
2 = C, does not exceed θ, whereas the ratio of |PΩ 1 (Z)| and |PΩ 2 (Z)|
does not exceed λ.
Acknowledgments
I am grateful to Alex Samorodnitsky and Benny Sudakov for several useful re-
marks.
References
[Az88] R. Azencott, Simulated annealing, S´eminaire Bourbaki, Vol. 1987/88, Ast´erisque (1988),
No. 161–162, 223–237.
[BG08] A. Bandyopadhyay and D. Gamarnik, Counting without sampling: asymptotics of the
log-partition function for certain statistical physics models, Random Structures & Algo-
rithms 33 (2008), no. 4, 452–479.
[B+07] M. Bayati, D. Gamarnik, D. Katz, C. Nair and P. Tetali, Simple deterministic approxi-
mation algorithms for counting matchings, STOC’07 – Proceedings of the 39th Annual
ACM Symposium on Theory of Computing, ACM, New York, 2007, pp. 122–127.
[Bh12] A. Bhaskara, Finding Dense Structures in Graphs and Matrices, Ph.D. dissertation,
Princeton University, available at
http://www.cs.princeton.edu/∼bhaskara/thesis.pdf, 2012.
[B+10] A. Bhaskara, M. Charikar, E. Chlamtac, U. Feige and A. Vijayaraghavan, Detecting high
log-densities – an O(n^1 /^4 ) approximation for densest k-subgraph, STOC’10–Proceedings
of the 2010 ACM International Symposium on Theory of Computing, ACM, New York,
2010, pp. 201–210.
[BG05] A. Bulatov and M. Grohe, The complexity of partition functions, Theoretical Computer
Science 348 (2005), no. 2–3, 148–186.
[F+01] U. Feige, G. Kortsarz and D. Peleg, The dense k-subgraph problem, Algorithmica 29
(2001), no. 3, 410–421.
[FK99] A. Frieze and R. Kannan, Quick approximation to matrices and applications, Combina-
torica 19 (1999), no. 2, 175–220.
[G+98] O. Goldreich, S. Goldwasser and D. Ron, Property testing and its connection to learning
and approximation, Journal of the ACM 45 (1998), no. 4, 653–750.
[H˚a99] J. H˚astad, Clique is hard to approximate within n^1 −, Acta Mathematica 182 (1999),
no. 1, 105–142.
[JS93] M. Jerrum and A. Sinclair, Polynomial-time approximation algorithms for the Ising
model, SIAM Journal on Computing 22 (1993), no. 5, 1087–1116.
[LY52] T.D. Lee and C.N. Yang, Statistical theory of equations of state and phase transitions.
II. Lattice gas and Ising model, Physical Review (2) 87 (1952), 410–419.
[LP09] L. Lov´asz and M.D. Plummer, Matching Theory, Corrected reprint of the 1986 original,
AMS Chelsea Publishing, Providence, RI, 2009.
[SS05] A.D. Scott and A.D. Sokal, The repulsive lattice gas, the independent-set polynomial, and
the Lov´asz local lemma, Journal of Statistical Physics 118 (2005), no. 5-6, 1151–1261.
[Zu07] D. Zuckerman, Linear degree extractors and the inapproximability of max clique and
chromatic number, Theory of Computing 3 (2007), 103–128.
Department of Mathematics, University of Michigan, Ann Arbor, MI 48109-1043,
USA
E-mail address: [email protected]