41
Combinatorics 南京大学 尹一通

Combinatorics - NJUtcs.nju.edu.cn/slides/comb2016/intro.pdfExtremal Combinatorics: with applications in computer science, 2nd Edition. Reference Books Graham, Knuth, and Patashnik,

  • Upload
    others

  • View
    4

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Combinatorics - NJUtcs.nju.edu.cn/slides/comb2016/intro.pdfExtremal Combinatorics: with applications in computer science, 2nd Edition. Reference Books Graham, Knuth, and Patashnik,

Combinatorics南京大学尹一通

Page 2: Combinatorics - NJUtcs.nju.edu.cn/slides/comb2016/intro.pdfExtremal Combinatorics: with applications in computer science, 2nd Edition. Reference Books Graham, Knuth, and Patashnik,

Course Info

• Instructor: 尹一通

[email protected], [email protected]

• Office hour: 804 , Tuesday, 2pm-4pm

• course homepage:

• http://tcs.nju.edu.cn/wiki/

Page 3: Combinatorics - NJUtcs.nju.edu.cn/slides/comb2016/intro.pdfExtremal Combinatorics: with applications in computer science, 2nd Edition. Reference Books Graham, Knuth, and Patashnik,

Textbook

van Lint and Wilson, A course in Combinatorics, 2nd Edition.

Jukna, Extremal Combinatorics: with applications in computer science,2nd Edition.

Page 4: Combinatorics - NJUtcs.nju.edu.cn/slides/comb2016/intro.pdfExtremal Combinatorics: with applications in computer science, 2nd Edition. Reference Books Graham, Knuth, and Patashnik,

Reference Books

Graham, Knuth, and Patashnik, Concrete Mathematics: A Foundation for Computer Science

Stanley, Enumerative Combinatorics, Volume 1

Page 5: Combinatorics - NJUtcs.nju.edu.cn/slides/comb2016/intro.pdfExtremal Combinatorics: with applications in computer science, 2nd Edition. Reference Books Graham, Knuth, and Patashnik,

Alon and Spencer. The Probabilistic Method.

Reference Books

Cook, Cunningham, Pulleyblank, and Schrijver. Combinatorial Optimization.

Aigner and Ziegler. Proofs from THE BOOK.

Page 6: Combinatorics - NJUtcs.nju.edu.cn/slides/comb2016/intro.pdfExtremal Combinatorics: with applications in computer science, 2nd Edition. Reference Books Graham, Knuth, and Patashnik,

Combinatorics

• Enumeration (counting):

• Existence:

• Extremal:

• Ramsey:

• Optimization:

• Construction (design):

How many solutions satisfying the constraints?

Does there exist a solution?

When a solution is sufficiently large, some structure must emerge.

How large/small a solution can be to preserve/avoid certain structure?

Find the optimal solution.

Construct a solution.

solution: combinatorial objectconstraint: combinatorial structure

combinatorial≈discrete finite

Page 7: Combinatorics - NJUtcs.nju.edu.cn/slides/comb2016/intro.pdfExtremal Combinatorics: with applications in computer science, 2nd Edition. Reference Books Graham, Knuth, and Patashnik,

Enumeration(counting)

• to rank n people?

• to assign m zodiac signs to n people?

• to choose m people out of n people?

• to partition n people into m groups?

• to distribute m yuan to n people?

• to partition m yuan to n parts?

• ... ...

How many ways are there:

Page 8: Combinatorics - NJUtcs.nju.edu.cn/slides/comb2016/intro.pdfExtremal Combinatorics: with applications in computer science, 2nd Edition. Reference Books Graham, Knuth, and Patashnik,

Gian-Carlo Rota (1932-1999)

The Twelvefold Way

Stanley, Enumerative Combinatorics, Volume 1

Page 9: Combinatorics - NJUtcs.nju.edu.cn/slides/comb2016/intro.pdfExtremal Combinatorics: with applications in computer science, 2nd Edition. Reference Books Graham, Knuth, and Patashnik,

The twelvefold wayf : N �M |N | = n, |M | = m

elements of N

elements of M any f 1-1 on-to

distinct distinct

identical distinct

distinct identical

identical identical

Page 10: Combinatorics - NJUtcs.nju.edu.cn/slides/comb2016/intro.pdfExtremal Combinatorics: with applications in computer science, 2nd Edition. Reference Books Graham, Knuth, and Patashnik,

balls per bin: unrestricted ≤ 1 ≥ 1

n distinct balls,m distinct bins

n identical balls,m distinct bins

n distinct balls,m identical bins

n identical balls,m identical bins

Knuth’s version (in TAOCP vol.4A)

n balls are put into m bins

Page 11: Combinatorics - NJUtcs.nju.edu.cn/slides/comb2016/intro.pdfExtremal Combinatorics: with applications in computer science, 2nd Edition. Reference Books Graham, Knuth, and Patashnik,

Counting (labeled) trees

“How many different trees can be formed from n distinct vertices?”

Page 12: Combinatorics - NJUtcs.nju.edu.cn/slides/comb2016/intro.pdfExtremal Combinatorics: with applications in computer science, 2nd Edition. Reference Books Graham, Knuth, and Patashnik,

Cayley’s formulafor the number of trees

Chapter 30

Arthur Cayley

One of the most beautiful formulas in enumerative combinatorics concernsthe number of labeled trees. Consider the set N = {1, 2, . . . , n}. Howmany different trees can we form on this vertex set? Let us denote thisnumber by Tn. Enumeration “by hand” yields T1 = 1, T2 = 1, T3 = 3,T4 = 16, with the trees shown in the following table:

4 3 4 3 43 43 4 3 4 3 4 3 4

3 4 3 4 3 43 43 4 3 4 3 4 3 4

1 1 1 2 1 21 22

1 2 1 2 1 21 21

3

2 2 1 2 1 2

1 2 1 2 1 21 21 2 1 2 1 2 1 2

1

3 33

Note that we consider labeled trees, that is, although there is only one treeof order 3 in the sense of graph isomorphism, there are 3 different labeledtrees obtained by marking the inner vertex 1, 2 or 3. For n = 5 there arethree non-isomorphic trees:

605 60

For the first tree there are clearly 5 different labelings, and for the secondand third there are 5!

2 = 60 labelings, so we obtain T5 = 125. This shouldbe enough to conjecture Tn = nn−2, and that is precisely Cayley’s result.

Theorem. There are nn−2 different labeled trees on n vertices.

This beautiful formula yields to equally beautiful proofs, drawing on avariety of combinatorial and algebraic techniques. We will outline threeof them before presenting the proof which is to date the most beautiful ofthem all.

Arthur Cayley(1821-1895)

There are nn�2 trees on n distinct vertices.

Cayley’s formula:

Page 13: Combinatorics - NJUtcs.nju.edu.cn/slides/comb2016/intro.pdfExtremal Combinatorics: with applications in computer science, 2nd Edition. Reference Books Graham, Knuth, and Patashnik,

Algorithmic Enumeration

“The number of different spanning trees of G(V,E).”

input: undirected graph G(V, E)

t(G) :

for i =1,2,3,... nn-2

output the i-th tree;

enumeration algorithm:

counting algorithm:

Page 14: Combinatorics - NJUtcs.nju.edu.cn/slides/comb2016/intro.pdfExtremal Combinatorics: with applications in computer science, 2nd Edition. Reference Books Graham, Knuth, and Patashnik,

Graph Laplacian1 2

34

Graph G(V,E)adjacency matrix A

A(i, j) =

(1 {i, j} 2 E

0 {i, j} 62 E

D(i, j) =

(deg(i) i = j

0 i 6= j

diagonal matrix DD =

2

6664

d1d2

. . .dn

3

777500

graph Laplacian L

L = D �A L =

2

664

3 �1 �1 �1�1 2 �1 0�1 �1 3 �1�1 0 �1 2

3

775

Page 15: Combinatorics - NJUtcs.nju.edu.cn/slides/comb2016/intro.pdfExtremal Combinatorics: with applications in computer science, 2nd Edition. Reference Books Graham, Knuth, and Patashnik,

Li,i : submatrix of L by removing ith row and ith collumn

i

i

t(G) : number of spanning trees in G

Kirchhoff ’s Matrix-Tree Theorem:8i, t(G) = det(Li,i)

Gustav Kirchhoff (1824-1887)

Page 16: Combinatorics - NJUtcs.nju.edu.cn/slides/comb2016/intro.pdfExtremal Combinatorics: with applications in computer science, 2nd Edition. Reference Books Graham, Knuth, and Patashnik,

Bipartite Perfect Matching

4 Perfect matchings in bipartite graphs. Consider a bipartite graph with bi-partition (N,N), where N = {1, . . . , n}, and edge set E ⊆ N × N . A perfectmatching is an edge subset M ⊆ E that includes every node as an endpointexactly once. See Fig. 3 for some interpretations.

Fig. 3. Row 1: A bipartitegraph and its three perfectmatchings. Row 2: In thegraph’s adjacency matrixA, every perfect matchingcorresponds to a permuta-tion π for which Ai,π(i) = 1for all i ∈ [n]. Row 3: Inthe directed n-node graphdefined by A, every perfectmatching corresponds toa directed cycle partition.Bottom row: an equiva-lent formulation in termsof non-attacking rooks ona chess board with forbid-den positions.

1 1 1

1 1 0

0 1 1

1 1 1

1 1 0

0 1 1

1 1 1

1 1 0

0 1 1

1 1 1

1 1 0

0 1 1

1

23

1

23

1

23

1

23

VRVR

VR

VRVR

VR

VRVRVR

The Ryser formula for counting the perfect matchings in such a graph canbe given as

!

π∈Sn

n"

i=1

[iπ(i) ∈ E] =!

S⊆N

(−1)|N\S|n"

i=1

!

j∈S

[ij ∈ E] , (4)

where Sn denotes the set of permutations from N to N . The left hand sidesuccinctly describes the problem as iterating over all permutations and checkingif the corresponding edges (namely, 1π(1), 2π(2), . . ., nπ(n)) are all in E. Directevaluation would require n! iterations. The right hand side provides an equivalentexpression that can be evaluated in time O(2nn2), see Fig. 4.

Proof of (4). For fixed i ∈ N , the value#

j∈S [ij ∈ E] counts the number of i’sneighbours in S ⊆ N . Thus the expression

n"

i=1

!

j∈S

[ij ∈ E] (5)

is the number of ways every node i ∈ N can choose a neighbour from S. (Thisallows some nodes to select the same neighbour.) Consider such a choice as amapping g : N → N , not necessarily onto, with image R = g(N). The contribu-tion of g to (5) is 1 for every S ⊇ R, and its total contribution to the right hand

4 Perfect matchings in bipartite graphs. Consider a bipartite graph with bi-partition (N,N), where N = {1, . . . , n}, and edge set E ⊆ N × N . A perfectmatching is an edge subset M ⊆ E that includes every node as an endpointexactly once. See Fig. 3 for some interpretations.

Fig. 3. Row 1: A bipartitegraph and its three perfectmatchings. Row 2: In thegraph’s adjacency matrixA, every perfect matchingcorresponds to a permuta-tion π for which Ai,π(i) = 1for all i ∈ [n]. Row 3: Inthe directed n-node graphdefined by A, every perfectmatching corresponds toa directed cycle partition.Bottom row: an equiva-lent formulation in termsof non-attacking rooks ona chess board with forbid-den positions.

1 1 1

1 1 0

0 1 1

1 1 1

1 1 0

0 1 1

1 1 1

1 1 0

0 1 1

1 1 1

1 1 0

0 1 1

1

23

1

23

1

23

1

23

VRVR

VR

VRVR

VR

VRVRVR

The Ryser formula for counting the perfect matchings in such a graph canbe given as

!

π∈Sn

n"

i=1

[iπ(i) ∈ E] =!

S⊆N

(−1)|N\S|n"

i=1

!

j∈S

[ij ∈ E] , (4)

where Sn denotes the set of permutations from N to N . The left hand sidesuccinctly describes the problem as iterating over all permutations and checkingif the corresponding edges (namely, 1π(1), 2π(2), . . ., nπ(n)) are all in E. Directevaluation would require n! iterations. The right hand side provides an equivalentexpression that can be evaluated in time O(2nn2), see Fig. 4.

Proof of (4). For fixed i ∈ N , the value#

j∈S [ij ∈ E] counts the number of i’sneighbours in S ⊆ N . Thus the expression

n"

i=1

!

j∈S

[ij ∈ E] (5)

is the number of ways every node i ∈ N can choose a neighbour from S. (Thisallows some nodes to select the same neighbour.) Consider such a choice as amapping g : N → N , not necessarily onto, with image R = g(N). The contribu-tion of g to (5) is 1 for every S ⊇ R, and its total contribution to the right hand

4 Perfect matchings in bipartite graphs. Consider a bipartite graph with bi-partition (N,N), where N = {1, . . . , n}, and edge set E ⊆ N × N . A perfectmatching is an edge subset M ⊆ E that includes every node as an endpointexactly once. See Fig. 3 for some interpretations.

Fig. 3. Row 1: A bipartitegraph and its three perfectmatchings. Row 2: In thegraph’s adjacency matrixA, every perfect matchingcorresponds to a permuta-tion π for which Ai,π(i) = 1for all i ∈ [n]. Row 3: Inthe directed n-node graphdefined by A, every perfectmatching corresponds toa directed cycle partition.Bottom row: an equiva-lent formulation in termsof non-attacking rooks ona chess board with forbid-den positions.

1 1 1

1 1 0

0 1 1

1 1 1

1 1 0

0 1 1

1 1 1

1 1 0

0 1 1

1 1 1

1 1 0

0 1 1

1

23

1

23

1

23

1

23

VRVR

VR

VRVR

VR

VRVRVR

The Ryser formula for counting the perfect matchings in such a graph canbe given as

!

π∈Sn

n"

i=1

[iπ(i) ∈ E] =!

S⊆N

(−1)|N\S|n"

i=1

!

j∈S

[ij ∈ E] , (4)

where Sn denotes the set of permutations from N to N . The left hand sidesuccinctly describes the problem as iterating over all permutations and checkingif the corresponding edges (namely, 1π(1), 2π(2), . . ., nπ(n)) are all in E. Directevaluation would require n! iterations. The right hand side provides an equivalentexpression that can be evaluated in time O(2nn2), see Fig. 4.

Proof of (4). For fixed i ∈ N , the value#

j∈S [ij ∈ E] counts the number of i’sneighbours in S ⊆ N . Thus the expression

n"

i=1

!

j∈S

[ij ∈ E] (5)

is the number of ways every node i ∈ N can choose a neighbour from S. (Thisallows some nodes to select the same neighbour.) Consider such a choice as amapping g : N → N , not necessarily onto, with image R = g(N). The contribu-tion of g to (5) is 1 for every S ⊇ R, and its total contribution to the right hand

4 Perfect matchings in bipartite graphs. Consider a bipartite graph with bi-partition (N,N), where N = {1, . . . , n}, and edge set E ⊆ N × N . A perfectmatching is an edge subset M ⊆ E that includes every node as an endpointexactly once. See Fig. 3 for some interpretations.

Fig. 3. Row 1: A bipartitegraph and its three perfectmatchings. Row 2: In thegraph’s adjacency matrixA, every perfect matchingcorresponds to a permuta-tion π for which Ai,π(i) = 1for all i ∈ [n]. Row 3: Inthe directed n-node graphdefined by A, every perfectmatching corresponds toa directed cycle partition.Bottom row: an equiva-lent formulation in termsof non-attacking rooks ona chess board with forbid-den positions.

1 1 1

1 1 0

0 1 1

1 1 1

1 1 0

0 1 1

1 1 1

1 1 0

0 1 1

1 1 1

1 1 0

0 1 1

1

23

1

23

1

23

1

23

VRVR

VR

VRVR

VR

VRVRVR

The Ryser formula for counting the perfect matchings in such a graph canbe given as

!

π∈Sn

n"

i=1

[iπ(i) ∈ E] =!

S⊆N

(−1)|N\S|n"

i=1

!

j∈S

[ij ∈ E] , (4)

where Sn denotes the set of permutations from N to N . The left hand sidesuccinctly describes the problem as iterating over all permutations and checkingif the corresponding edges (namely, 1π(1), 2π(2), . . ., nπ(n)) are all in E. Directevaluation would require n! iterations. The right hand side provides an equivalentexpression that can be evaluated in time O(2nn2), see Fig. 4.

Proof of (4). For fixed i ∈ N , the value#

j∈S [ij ∈ E] counts the number of i’sneighbours in S ⊆ N . Thus the expression

n"

i=1

!

j∈S

[ij ∈ E] (5)

is the number of ways every node i ∈ N can choose a neighbour from S. (Thisallows some nodes to select the same neighbour.) Consider such a choice as amapping g : N → N , not necessarily onto, with image R = g(N). The contribu-tion of g to (5) is 1 for every S ⊇ R, and its total contribution to the right hand

bipartite graph

G([n],[n],E)

perfect matchings

permutation � of [n] (i,�(i)) � Es.t.

Ai,j =

�1 (i, j) � E

0 (i, j) �� E

n � n matrix A :

=�

��Sn

i�[n]

Ai,�(i)

# of P.M. in G

Page 17: Combinatorics - NJUtcs.nju.edu.cn/slides/comb2016/intro.pdfExtremal Combinatorics: with applications in computer science, 2nd Edition. Reference Books Graham, Knuth, and Patashnik,

Permanentn � n matrix A :

=�

��Sn

i�[n]

Ai,�(i)perm(A)

det(A) =�

��Sn

(�1)r(�)�

i�[n]

Ai,�(i)

determinant:

poly-time by Gaussian elimination

#P-hard to compute

Page 18: Combinatorics - NJUtcs.nju.edu.cn/slides/comb2016/intro.pdfExtremal Combinatorics: with applications in computer science, 2nd Edition. Reference Books Graham, Knuth, and Patashnik,

Ryser’s formula

��Sn

i�[n]

Ai,�(i) =�

I�[n]

(�1)n�|I|�

i�[n]

j�I

Ai,j

O(n!) time O(n2n) time

I�S

(�1)|S|�|I| =

�1 S = �0 otherwise

PIE (Principle of Inclusion-Exclusion):

Page 19: Combinatorics - NJUtcs.nju.edu.cn/slides/comb2016/intro.pdfExtremal Combinatorics: with applications in computer science, 2nd Edition. Reference Books Graham, Knuth, and Patashnik,

PIE(Principle of Inclusion-Exclusion)

|A �B| = |A| + |B|�|A ⇥B|

|A �B � C| = |A| + |B| + |C|�|A ⇥B|� |A ⇥ C|� |B ⇥ C|+|A �B � C|

Page 20: Combinatorics - NJUtcs.nju.edu.cn/slides/comb2016/intro.pdfExtremal Combinatorics: with applications in computer science, 2nd Edition. Reference Books Graham, Knuth, and Patashnik,

Inversion

f : 2[n] � N

V: 2n-dimensional vector space of all mappings

� : V � Vlinear transformation

�S � [n],

�S � [n],

then its inverse:

�f(S) ��

T�ST�[n]

f(T )

��1f(S) =�

T�ST�[n]

(�1)|T\S|f(T )

Page 21: Combinatorics - NJUtcs.nju.edu.cn/slides/comb2016/intro.pdfExtremal Combinatorics: with applications in computer science, 2nd Edition. Reference Books Graham, Knuth, and Patashnik,

Fibonacci number

Fn =

�⌅⇤

⌅⇥

Fn�1 + Fn�2 if n � 2,

1 if n = 10 if n = 0.

� =1 +

�5

2�̂ =

1�⇥

52

Fn =1⇥5

��n � �̂n

by generating functions ...

Page 22: Combinatorics - NJUtcs.nju.edu.cn/slides/comb2016/intro.pdfExtremal Combinatorics: with applications in computer science, 2nd Edition. Reference Books Graham, Knuth, and Patashnik,

Quicksort

Qsort(A):

choose a pivot x = A[1];

•partition A into L with all L[i ] < x ,

R with all R[i ] > x ;Qsort(L) and Qsort(R);

input: an array A of n numbers

Complexity: number of comparisons

worst-case:

average-case: ?Θ(n2)

Page 23: Combinatorics - NJUtcs.nju.edu.cn/slides/comb2016/intro.pdfExtremal Combinatorics: with applications in computer science, 2nd Edition. Reference Books Graham, Knuth, and Patashnik,

Qsort(A):

choose a pivot x = A[1];

•partition A into L with all L[i ] < x ,

R with all R[i ] > x ;Qsort(L) and Qsort(R);

Tn :average # of comparisons

used by Qsort

=1

n

n�

k=1

(n � 1 + Tk�1 + Tn�k)Tn

pivot: the k-th smallest number in A|L| = k-1 |R| = n-k

n � 1

Recursion:

T0 = T1 = 0

= 2n ln n + O(n)

generating functions

Page 24: Combinatorics - NJUtcs.nju.edu.cn/slides/comb2016/intro.pdfExtremal Combinatorics: with applications in computer science, 2nd Edition. Reference Books Graham, Knuth, and Patashnik,

Counting with SymmetryRotation :

Rotation & Reflection:

Page 25: Combinatorics - NJUtcs.nju.edu.cn/slides/comb2016/intro.pdfExtremal Combinatorics: with applications in computer science, 2nd Edition. Reference Books Graham, Knuth, and Patashnik,

Symmetries

Page 26: Combinatorics - NJUtcs.nju.edu.cn/slides/comb2016/intro.pdfExtremal Combinatorics: with applications in computer science, 2nd Edition. Reference Books Graham, Knuth, and Patashnik,

Pólya’s Theory of Counting

George Pólya(1887-1985)

Page 27: Combinatorics - NJUtcs.nju.edu.cn/slides/comb2016/intro.pdfExtremal Combinatorics: with applications in computer science, 2nd Edition. Reference Books Graham, Knuth, and Patashnik,

a~v : # of config. (up to symmetry) with ni many color i

pattern inventory :

FG(y1, y2, . . . , ym) =X

~v=(n1,...,nm)n1+···+nm=n

a~v yn11 yn2

2 · · · ynmm

(multi-variate) generating function

FG(y1, y2, . . . , ym) = PG

mX

i=1

yi,mX

i=1

y2i , . . . ,mX

i=1

yni

!Pólya’s enumeration formula (1937):

⇡ =

`1z }| {(· · · )

`2z }| {(· · · ) · · ·

`kz }| {(· · · )| {z }

k cycles

M⇡(x1, x2, . . . , xn) =kY

i=1

x`i

PG(x1, x2, . . . , xn) =1

|G|X

⇡2G

M⇡(x1, x2, . . . , xn)cycle index:

Page 28: Combinatorics - NJUtcs.nju.edu.cn/slides/comb2016/intro.pdfExtremal Combinatorics: with applications in computer science, 2nd Edition. Reference Books Graham, Knuth, and Patashnik,

FD20(r, q, l)

Page 29: Combinatorics - NJUtcs.nju.edu.cn/slides/comb2016/intro.pdfExtremal Combinatorics: with applications in computer science, 2nd Edition. Reference Books Graham, Knuth, and Patashnik,
Page 30: Combinatorics - NJUtcs.nju.edu.cn/slides/comb2016/intro.pdfExtremal Combinatorics: with applications in computer science, 2nd Edition. Reference Books Graham, Knuth, and Patashnik,
Page 31: Combinatorics - NJUtcs.nju.edu.cn/slides/comb2016/intro.pdfExtremal Combinatorics: with applications in computer science, 2nd Edition. Reference Books Graham, Knuth, and Patashnik,
Page 32: Combinatorics - NJUtcs.nju.edu.cn/slides/comb2016/intro.pdfExtremal Combinatorics: with applications in computer science, 2nd Edition. Reference Books Graham, Knuth, and Patashnik,

Existing

• a configuration satisfying this condition?

• a counterexample for this method?

• an efficient algorithm for this problem?

• a problem which is hard to solve in this computation model?

• ...

Does there exist:

Page 33: Combinatorics - NJUtcs.nju.edu.cn/slides/comb2016/intro.pdfExtremal Combinatorics: with applications in computer science, 2nd Edition. Reference Books Graham, Knuth, and Patashnik,

Circuit Complexity

¬

x1 x2 x3

f : {0, 1}n � {0, 1}Boolean function

Boolean circuit

Page 34: Combinatorics - NJUtcs.nju.edu.cn/slides/comb2016/intro.pdfExtremal Combinatorics: with applications in computer science, 2nd Edition. Reference Books Graham, Knuth, and Patashnik,

Claude Shannon(1916 - 2001)

Theorem (Shannon 1949)There is a boolean functionf : {0, 1}n � {0, 1} whichcannot be computed by anycircuit with 2n

3n gates.

no constructive proof is known

Page 35: Combinatorics - NJUtcs.nju.edu.cn/slides/comb2016/intro.pdfExtremal Combinatorics: with applications in computer science, 2nd Edition. Reference Books Graham, Knuth, and Patashnik,

“What is the largest number of edges thatan n-vertex cycle-free graph can have?”

Extremal Problem:

Extremal Graph:

(n-1)

spanning tree

Page 36: Combinatorics - NJUtcs.nju.edu.cn/slides/comb2016/intro.pdfExtremal Combinatorics: with applications in computer science, 2nd Edition. Reference Books Graham, Knuth, and Patashnik,

Triangle-free graph

contains no as subgraph

Example: bipartite graph

|E| is maximized forcomplete balanced bipartite graph

Extremal ?

Page 37: Combinatorics - NJUtcs.nju.edu.cn/slides/comb2016/intro.pdfExtremal Combinatorics: with applications in computer science, 2nd Edition. Reference Books Graham, Knuth, and Patashnik,

Mantel’s Theorem

Theorem (Mantel 1907)

|E| � n2

4.

If G(V,E) has |V|=n and is triangle-free, then

For n is even,extremal graph:

Kn2 , n

2

Page 38: Combinatorics - NJUtcs.nju.edu.cn/slides/comb2016/intro.pdfExtremal Combinatorics: with applications in computer science, 2nd Edition. Reference Books Graham, Knuth, and Patashnik,

Frank P. Ramsey(1903-1930)

“In any party of six people, either at least three of them are mutual strangers or at least three of them are mutual acquaintances”

Color edges of K6 with 2 colors.There must be a monochromatic K3.

Page 39: Combinatorics - NJUtcs.nju.edu.cn/slides/comb2016/intro.pdfExtremal Combinatorics: with applications in computer science, 2nd Edition. Reference Books Graham, Knuth, and Patashnik,

R(k,l) the smallest integer satisfying: �

Ramsey TheoremR(k,l) is finite.

2-coloring of Kn

f :�

[n]2

⇥� {red, blue}

if n≥ R(k,l), for any 2-coloring of Kn, there exists a red Kk or a blue Kl.

R(3,3) = 6

Frank P. Ramsey(1903-1930)

Page 40: Combinatorics - NJUtcs.nju.edu.cn/slides/comb2016/intro.pdfExtremal Combinatorics: with applications in computer science, 2nd Edition. Reference Books Graham, Knuth, and Patashnik,

Ramsey Number

Page 41: Combinatorics - NJUtcs.nju.edu.cn/slides/comb2016/intro.pdfExtremal Combinatorics: with applications in computer science, 2nd Edition. Reference Books Graham, Knuth, and Patashnik,

Combinatorics

• Enumeration (counting):

• Existence:

• Extremal:

• Ramsey:

• Optimization:

• Construction (design):

How many solutions satisfying the constraints?

Does there exist a solution?

When a solution is sufficiently large, some structure must emerge.

How large/small a solution can be to preserve/avoid certain structure?

Find the optimal solution.

Construct a solution.

solution: combinatorial objectconstraint: combinatorial structure

combinatorial≈discrete finite