0% found this document useful (0 votes)
15 views7 pages

COMS 6998 Lec 2

This document summarizes a lecture on algebraic graph algorithms. It discusses using algebraic techniques to detect induced subgraphs and perform polynomial identity testing. For induced subgraphs, it describes computing the adjacency matrix squared and summing entries to count subgraphs, but this also counts other structures. To distinguish, it randomly samples the graph and checks if the count is divisible by 6. For polynomial identity testing, it describes evaluating polynomials on random points to efficiently test if a polynomial is the zero polynomial without full expansion.

Uploaded by

vejifon253
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
15 views7 pages

COMS 6998 Lec 2

This document summarizes a lecture on algebraic graph algorithms. It discusses using algebraic techniques to detect induced subgraphs and perform polynomial identity testing. For induced subgraphs, it describes computing the adjacency matrix squared and summing entries to count subgraphs, but this also counts other structures. To distinguish, it randomly samples the graph and checks if the count is divisible by 6. For polynomial identity testing, it describes evaluating polynomials on random points to efficiently test if a polynomial is the zero polynomial without full expansion.

Uploaded by

vejifon253
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 7

COMS 6998: Algebraic Techniques in TCS (Fall’21) Sep 21, 2021

Lecture 2: Algebraic graph algorithms


Instructor: Josh Alman Scribe notes by: Xuan Zhao, Shida Jing

Disclaimer: This draft may be incomplete or have errors. Consult the course webpage for the most
up-to-date version.

1 Induced Subgraphs
Recap from last lecture. We consider the following problem: Given an n-node input graph G, does
G contain H as an induced subgraph? (see Figure 1)

k k
i j i j
l l

Figure 1: The target induced subgraph H. Figure 2: The 4-clique K4 .

In the last lecture we proposed the following approach: Let A ∈ {0, 1}n×n be the adjacency matrix
of G: (
1 if (i, j) ∈ E(G),
A[i, j] =
0 otherwise.
2
The algorithm first computes A2 ∈ Rn×n in O(n2.373 ) time, then computes the value (i,j)∈E(G) A 2[i,j]
P 

in O(n2 ) time. This value counts the number of our target graph in G, but also counts 4-cliques in G:
 2 
X A [i, j] X
= # of pairs (k, l) s.t. (i, k), (k, j), (i, l), (l, j) ∈ E(G)
2
(i,j)∈E(G) (i,j)∈E(G)

= (# of H) + 6 × (# of K4 ).

Each copy of K4 is counted 6 times since it’s counted once in the summand corresponding to (i, j) being
each of its 6 edges.

A2 [i,j]
P 
A randomized algorithm. Denote R(G) := (i,j)∈E(G) 2 .

• If R(G) is not a multiple of 6, then we conclude that G must contain H as an induced subgraph.

• If R(G) is a nonzero multiple of 6, we use the following randomized algorithm:


Remove every node of G independently with probability 1/2 to obtain a random subgraph G0 . We
will show that if H is an induced subgraph of G, then with probability ≥ 1/16, # of H in G0 is not
a multiple of 6 (Lemma 1), and hence R(G0 ) is not a multiple of 6.

1
We repeat this sampling process for 100 times. If for at least one sampled subgraph G0 , R(G0 ) is
not a multiple of 6, then we conclude that the original graph G contains H as an induced subgraph.
The failure probability is Pr[failure] ≤ (15/16)100 < 1/100.

Now it remains to prove Lemma 1.

Lemma 1 (Correctness of the randomized algorithm). If the graph G contains at least one induced copy
of the subgraph H, then if we remove every node of G independently with probability 1/2, the resulting
graph will have (# of H) 6≡ 0 (mod 6) with probability at least 1/16.

Proof. Let
X
P (x1 , x2 , · · · , xn ) = xi xj xk xl .
0<i<j<k<l≤n, s.t. nodes i, j, k, l form H in G

Then the number of H in G is P (1, 1, · · · , 1).


Plug into P the vector x ∈ {0, 1}n defined as
(
1 if we randomly keep node i,
xi =
0 if we randomly remove node i.

Then P (x) is the number of H in the random subgraph.


It remains to bound the probability that P (x) 6≡ 0 (mod 6) when x is drawn uniformly at random
from {0, 1}n . Using Lemma 2 (to be proved below), since the degree of P is 4, we have

1
Pr [P (x) 6≡ 0 (mod 6)] ≥ .
x1 ,x2 ,··· ,xn ∼{0,1} 16

This finishes the proof.

The only missing piece in the previous proof is to show that for a uniformly random Boolean vector
x, the probability that P (x) 6≡ 0 (mod 6) is at least 1/16. We will prove a slightly more general lemma
where the degree of P is any integer d, and the modulus is any integer m > 1.

Lemma 2. If P (x1 , x2 , · · · , xn ) is a multilinear polynomial with integer coefficients which are not all
divisible by m, and P has degree at most d, then
1
Pr [P (x) 6≡ 0 (mod m)] ≥ .
x1 ,x2 ,··· ,xn ∼{0,1} 2d

Before proving Lemma 2, we first prove the following warm-up lemma, which will be used in the proof
of Lemma 2.

Lemma 3 (Warm-up lemma). If P (x1 , x2 , · · · , xn ) is a multilinear polynomial with integer coefficients


which are not all divisible by m, then there exists an x ∈ {0, 1}n such that

P (x) 6≡ 0 (mod m).

2
Proof. The multilinear polynomial P can be written in the form
X Y
P (x1 , x2 , · · · , xn ) = aS · xi ,
S⊆{1,··· ,n} i∈S

where the aS coefficients are integers which are not all divisible by m. Pick a minimum size set T ⊆
{1, 2, · · · , n} such that aT 6≡ 0 (mod m).
Define y ∈ {0, 1}n by (
1 if i ∈ T,
yi =
0 otherwise.
Q
Then for any set S ⊆ {1, 2, · · · , n}, we have i∈S yi = 1 only if S ⊆ T . And since T is the minimum size
set where aT 6≡ 0 (mod m), we have aS ≡ 0 (mod m) for any strict subset S ( T . It follows that
X
P (y) = aS = aT 6≡ 0 (mod m).
S⊆T

Now we are ready to prove Lemma 2.

Proof of Lemma 2. Again write the multilinear polynomial P in the following form:
X Y
P (x1 , x2 , · · · , xn ) = aS · xi .
S⊆{1,··· ,n} i∈S

Pick any set T ⊆ {1, 2, · · · , n} of maximum size such that aT 6≡ 0 (mod m). Let d0 = |T |. Since P
has degree d, we know that d0 ≤ d. For convenience we re-order the subscripts and denote this set as
T = {1, 2, . . . d0 }.
0
Consider any 0/1 assignment to xd0 +1 , . . . , xn . Let Q : Zd → Z be the resulting polynomial from
this partial assignment to P , where Q has d0 variables x1 , . . . , xd0 . Q is nonzero (mod m) since the
Q
monomial aT · i∈T xi is still in Q. By Lemma 3, there exists an assignment to x1 , . . . , xd0 such that
Q(x1 , . . . , xd0 ) 6≡ 0 (mod m).
Thus, for any 0/1 assignment to xd0 +1 , . . . , xn , there is at least one 0/1 assignment to x1 , . . . , xd0 such
that P (x1 , · · · , xn ) 6≡ 0 (mod m). Hence, as desired,

1 1
Pr [P (x1 , · · · , xn ) 6≡ 0 (mod m)] ≥ 0 ≥ .
x1 ,··· ,xn ∼{0,1} 2 d 2d

2 Polynomial Identity Testing


Suppose we are given an expression for a polynomial and we want to test whether all its terms cancel
out resulting in the zero polynomial. For instance, we know that

P (x, y) = x2 − y 2 − (x + y)(x − y)

3
is the zero polynomial, but for larger examples such as

Q(x, y) = x6 − y 6 − (x2 − y 2 )(x2 + xy + y 2 )(x2 − xy + y 2 )

or
R(x, y, z) = (x + y)100 + (x + z)100 + (y + z)100 − 2(x + y + z)100 ,
it may be unclear. Expanding out all the terms of the polynomial by brute force can be slow. An efficient
test is instead to evaluate the polynomial on a few random points, and check whether the result is always
zero. If the polynomial is zero, then it will always output 0, but otherwise, the next lemma shows that
it will output a nonzero value with decent probability.
Lemma 4 (Schwartz-Zippel). Let F be any field, and let S ⊆ F be a finite subset. Let P (x1 , · · · , xn ) be
a nonzero polynomial over F with degree ≤ d. Then

d
Prn [P (x) = 0] ≤ .
x∼S |S|

Proof. We proceed by strong induction on n.


Base case (n = 1): Any single-variable polynomial over as field F with degree ≤ d has at most d
d
roots. The probability that a random x ∈ S is a root of P (x) is hence at most |S| .
Induction step: Assume the lemma statement is true for n − 1, and we want to prove it for n. Write
the polynomial P in the following form:
d
X
P (x1 , · · · , xn ) = xin · Pi (x1 · · · , xn−1 ),
i=0

where Pi is a polynomial over n − 1 variables with degree ≤ d − i.


Let k be the largest value such that Pk = 6 0. If we randomly pick x1 , · · · , xn−1 ∈ S, then by the
induction hypothesis,
d−k
Pr[Pk (x1 , · · · , xn−1 ) = 0] ≤ .
|S|
Suppose that x1 , · · · , xn−1 satisfy Pk (x1 , · · · , xn−1 ) 6= 0. Then, after fixing x1 , · · · , xn−1 , our polyno-
mial P becomes a nonzero polynomial of degree ≤ k in the single variable xn . As in the base case, it
follows that
k
Pr[P (xn ) = 0] ≤ .
|S|
By the union bound, we have

Pr[P (x1 , · · · , xn ) = 0] ≤ Pr[Pk (x1 , . . . , xn−1 ) = 0] + Pr[P (x1 , . . . , xn ) = 0 | Pk (x1 , . . . , xn−1 ) 6= 0],
d−k k d
which is at most |S| + |S| = |S| .

3 Maximum Matchings in Graphs


We next study the problem of determining the size of a maximum matching in an undirected graph. We
will assume for now that we can compute the determinant of a n × n matrix in O(n2.323 ) operations. This

4
assumption will be discussed in following classes.
Definition 5 (Matching in a graph). For an undirected graph G with n nodes, a matching is a subset
S of the edges of the graph G such that every node of G is incident to at most one edge of S. A perfect
matching is a matching in which each node of G is incident to exactly one edge of S, or equivalently, a
matching of size n/2.
There is a simple reduction showing that if one can detect whether a graph has a perfect matching
in time T (n), then one can binary search for the maximum size of a matching in a graph in time
O(T (n) log n). (The idea is that, for any k, to test whether G has a matching of size at least (n − k)/2,
one can add k nodes to G which are adjacent to each other and every other node in G, and test whether
the resulting graph has a perfect matching.)
Our goal is to find if a graph has a perfect matching in O(n2.373 ) time, and we will use polynomial
identity testing as discussed above. Our plan is to define a polynomial P such that
1. P (x) 6= 0 if and only if G has a perfect matching, and

2. P (x) is easy to evaluate.


We will define our P (x) as the determinant of the Tutte matrix of G.
Definition 6 (Tutte matrix). Let G be a graph with n nodes. Let xi,j where i, j ∈ {1, 2, · · · , n} be n2
variables. The Tutte matrix M is an n × n matrix:

0

 if (i, j) ∈
/ E(G),
M [i, j] = xi,j if (i, j) ∈ E(G) and i < j,

−x

if (i, j) ∈ E(G) and j < i.
j,i

The determinant of M , det(M ), is the polynomial we are looking for with degree ≤ n. We are going
to prove that det(M ) 6= 0 if and only if G has a perfect matching.
Assuming this claim is true, our algorithm works as follows: pick a finite field | Fq | > 2n, then evaluate
det(M ) on random points in Fq . By the Schwartz-Zippel Lemma (Lemma 4), after trying a large constant
number of random points, we learn with high probability whether det(M ) is a zero polynomial.
Theorem 7. det(M ) 6= 0 if and only if G has a perfect matching.
Proof. Recall the determinant of the matrix M is given by

X n
Y
det(M ) = sgn(σ) · M [i, σ[i]],
σ∈Sn i=1

where Sn is the set of all the permutations on {1, · · · , n}. To make our discussion easier, we will use fσ
to denote ni=1 M [i, σ[i]]. So we have
Q

X
det(M ) = sgn(σ)fσ .
σ∈Sn

So what is fσ anyways? Think about fσ in terms of a “cycle cover” of G. A cycle cover of a graph is a
cover where all the edges (directed) belong to a cycle or a loop. If you draw all the directed edges out in

5
terms of the permutation σ (all edges have the form (i, σ(i)) with the arrow pointing towards σ(i)), then
fσ = 0 unless all of these edges are in G. This is because if one of the edges you draw is not in G, then
the entry in M corresponding to your edge would have evaluated to be 0, based on how M is defined.
It is not hard to see that if σ has a fixed point (σ(i) = i), then fσ would be 0. Because if σ has a fixed
point, when you draw out the edges defined by σ, you’ll get a self-loop, which is impossible to be in G.
Now, define On ⊆ Sn such that On are permutations that have an odd cycle.
Permutations with odd cycles. We claim that
X
sgn(σ)fσ = 0.
σ∈On

In other words, the terms that corresponds to the permutations in On will cancel each other out in the
calculation of the determinant. Next we prove this claim.
Fix a σ ∈ On . If there is a 1-cycle (a fixed point) in σ, then fσ = 0, as discussed above. If there is no
1-cycle in σ, then we can pick the odd cycle in σ that contains the smallest index. Let σ 0 be σ but with
that cycle reversed. (For instance, if σ mapped 1 → 2 → 3 → 1, then σ 0 instead maps 1 ← 2 ← 3 ← 1,
but is equal to σ on all other inputs.)
Since the permutations σ 0 and σ only differ in an odd cycle, by the definitions of the sign of permu-
tations, we have sgn(σ) = sgn(σ 0 ). It is not hard to see that fσ = −fσ0 due to the fact that M satisfies
M T = −M : We reversed an odd cycle, so that an odd number of signs are reversed. Thus we have

sgn(σ)fσ + sgn(σ 0 )fσ0 = 0.


P
Therefore, the permutations in On cancel out in pairs, so σ∈On sgn(σ)fσ = 0.
Permutations without odd cycles. Now we will show that for all permutations that are not in
On , we have X
sgn(σ)fσ 6= 0 if and only if G has a perfect matching.
σ∈Sn \On

For the forward direction, if the formula is not equal to zero, then we have at least one σ with fσ 6= 0.
This means there is an even cycle cover of G, which in turn implies a perfect matching. Indeed, if we
pick every other edge in each even cycle, or just the single edge in the case of a cycle of length 2, the
result will be a perfect matching for G.
For the backward direction, if G has a perfect matching, then each node is connected by exactly one
edge in the matching. We define a permutation σ ∈ Sn by turning each edge into a cycle formed by two
edges, as shown below:

=⇒

6
By doing this, we convert a perfect matching into an even-cycle cover σ. Therefore:
n
Y
fσ = M [i, σ(i)]
i=1
Y
= M [i, j] · M [j, i], because all edges are part of a 2-cycle
(i,j) ∈ matching
Y
= −x2ij .
(i,j) ∈ matching

There is no other σ 0 ∈ Sn such that fσ and fσ0 use the same set of variables since σ uses all the copies of
P
every variable it uses in M . Therefore, σ∈Sn \On sgn(σ)fσ 6= 0, since the term corresponding to our σ
can’t get canceled out. This completes the proof.

You might also like