27
MATH39001 Graph Theory 0 Basic definitions (Jungnickel, Chapter 1, Bollob´as79, Chapter I, Bollob´ as98, Chapter I) Definition. A graph (or simple graph for emphasis) is an ordered pair G = (V,E), where V is a non-empty finite set, called the set of vertices of G, and E is a set of unordered pairs (2-element subsets) of V , called the edges of G. If {x, y}∈ E, x and y are called adjacent and they are incident with the edge {x, y}. Definition. The complete graph on n vertices, denoted by K n , is a graph on n vertices such that every pair of vertices is connected by an edge. The empty graph on n vertices, denoted by E n , is a graph on n vertices with no edges. Definition. A graph G 0 =(V 0 ,E 0 ) is a subgraph of G =(V,E) if and only if V 0 V and E 0 E. G 0 =(V 0 ,E 0 ) is a spanned subgraph of G =(V,E) if and only if it is a subgraph of G and for all x, y V 0 , {x, y}∈ E implies {x, y}∈ E 0 . Definition. The graphs G =(V,E) and G 0 =(V 0 ,E 0 ) are isomorphic if and only if there exists a function φ : V E V 0 E 0 such that φ gives a bijection between V and V 0 and between E and E 0 and furthermore for any edge {x, y}∈ E, φ({x, y})= {φ(x)(y)}. Generalisations. Directed graphs (digraphs), in which the edges are ordered pairs, represented by arrows in diagrams. Graphs with loops, where the endpoints of an edge may be the same. Graphs with multiple edges. Any combination of the above. Definition. The order of a graph G =(V,E) is |V |, the number of its vertices. The size of G is |E|, the number of its edges. The degree of a vertex x V , denoted by d(x), is the number of edges incident with it. Lemma 0.1 (See Jungnickel, proof of Lemma 1.1.1) Let G =(V,E) be a graph, then X xV d(x)=2|E|. Proof. Let S = {(x, e) | x V, e E, e is incident with x}. 1

Graph Theorems

  • Upload
    cdhbff

  • View
    265

  • Download
    1

Embed Size (px)

DESCRIPTION

dcddgb

Citation preview

Page 1: Graph Theorems

MATH39001

Graph Theory

0 Basic definitions

(Jungnickel, Chapter 1, Bollobas79, Chapter I, Bollobas98, Chapter I)

Definition. A graph (or simple graph for emphasis) is an ordered pair G =(V,E), where V is a non-empty finite set, called the set of vertices of G, andE is a set of unordered pairs (2-element subsets) of V , called the edges ofG. If x, y ∈ E, x and y are called adjacent and they are incident with theedge x, y.

Definition. The complete graph on n vertices, denoted by Kn, is a graph on nvertices such that every pair of vertices is connected by an edge. The emptygraph on n vertices, denoted by En, is a graph on n vertices with no edges.

Definition. A graph G′ = (V ′, E ′) is a subgraph of G = (V,E) if and only ifV ′ ⊆ V and E ′ ⊆ E.

G′ = (V ′, E ′) is a spanned subgraph of G = (V,E) if and only if it is asubgraph of G and for all x, y ∈ V ′, x, y ∈ E implies x, y ∈ E ′.

Definition. The graphs G = (V,E) and G′ = (V ′, E ′) are isomorphic if andonly if there exists a function φ : V ∪ E → V ′ ∪ E ′ such that φ gives abijection between V and V ′ and between E and E ′ and furthermore for anyedge x, y ∈ E, φ(x, y) = φ(x), φ(y).

Generalisations. Directed graphs (digraphs), in which the edges are orderedpairs, represented by arrows in diagrams.

Graphs with loops, where the endpoints of an edge may be the same.

Graphs with multiple edges.

Any combination of the above.

Definition. The order of a graph G = (V,E) is |V |, the number of its vertices.The size of G is |E|, the number of its edges. The degree of a vertex x ∈ V ,denoted by d(x), is the number of edges incident with it.

Lemma 0.1 (See Jungnickel, proof of Lemma 1.1.1) Let G = (V,E) be a

graph, then∑x∈V

d(x) = 2|E|.

Proof. Let S = (x, e) | x ∈ V, e ∈ E, e is incident with x.

1

Page 2: Graph Theorems

For each x, there are d(x) possibilities for e, so |S| =∑x∈V

d(x). Each edge

has two endpoints, therefore we also have |S| = 2|E|, so∑x∈V

d(x) = 2|E| as

claimed.

Definition. A walk in a graph is an alternating sequence of vertices and edgesx0e1x1e2x2 . . . xn−1enxn such that x0, x1, . . . , xn are vertices and ei is an edgeconnecting xi1 and xi for each i, 1 ≤ i ≤ n. (In a simple graph the sequenceof vertices determines the walk uniquely and therefore the edges are usuallyomitted.)

A trail is a walk with no repeated edges.

A path is a walk with no repeated vertices. (Note: A path is necessarily atrail.)

A circuit is a closed trail, i.e., a trail with x0 = xn.

A cycle is a closed trail with no repeated vertices other than the initial oneand the final one, i.e., xi = xj for i < j if and only if i = 0 and j = n.

Definition. Let G = (V,E) be a graph. Define the relation ∼ on V by x ∼ yif and only if there exists a path beginning at x which ends at y.

Proposition 0.2 x ∼ y defined above is an equivalence relation on V .

Proof. x ∼ x for any vertex x, since we can just take the path consisting ofthe vertex x and no edges, so ∼ is reflexive.

If x ∼ y then by reversing a path from x to y we obtain a path from y to x,so y ∼ x therefore ∼ is symmetric.

As usual, the proof of transitivity requires the most effort. Let’s assumethat x ∼ y and y ∼ z. Let x0e1x1e2x2 . . . xn−1enxn (x0 = x, xn = y) andy0f1y1f2y2 . . . ym−1fmym (y0 = y, ym = z) be paths from x to y and fromy to z, resp. By joining them, we obtain x0e1x1e2x2 . . . xn−1enxnf1y1f2y2 . . .ym−1fmym, which is a walk from x to z, but not necessarily a path.

Let v0g1v1g2v2 . . . vk−1gkvk (v0 = x, vk = z) be a walk of minimum length fromx to z. We claim that it is a path. Let’s assume that it is not. This meansthat vi = vj for some i < j, but then we can just remove the section betweenvi and vj to obtain v0g1v1g2v2 . . . vi−1givigj+1vj+1 . . . vn−1gn−1vn, which is ashorter walk from x to z, contradicting the assumption that the length ofv0g1v1g2v2 . . . vn−1gnvn was minimal. Hence v0g1v1g2v2 . . . vn−1gnvn is a path,so x ∼ z and ∼ is transitive.

We have proved that ∼ is reflexive, symmetric and transitive, therefore it is

2

Page 3: Graph Theorems

indeed an equivalence relation.

The subgraphs spanned by the equivalence classes of ∼ are called the con-nected components of G.

G is called connected if and only if it has one connected component.

Definition. A graph G is called a tree if and only if it is connected andcontains no cycles.

Definition. A graph G is called a forest if and only if it contains no cycles.(Equivalently, G is a forest if and only if its connected components are trees.).

Proposition 0.3 Let G = (V,E) be a graph. The following statements areequivalent:(i) G is a tree.(ii) G is connected, but the removal of any edge makes it disconnected.(iii) G has no cycles, and either |V | = 1, or |V | = 2 and |E| = 1, or addingany edge to G introduces a cycle.(iv) There exists a unique path between any two vertices in V .(v) |V | = n, |E| = n− 1 for some positive integer n and G is connected.(vi) |V | = n, |E| = n − 1 for some positive integer n and G contains nocycles.

(For a proof, see the solution to question 2 on problem sheet 1.)

3

Page 4: Graph Theorems

1 Electrical networks

(Bollobas79, Chapter II, Bollobas98, Chapter II)

1.1 Calculating currents

Problem: An electrical network consisting of resistors can be modelled bya graph with a resistance Rab > 0 assigned to each edge ab and with twodistinguished vertices, the source s and the sink t connected to a powersupply. Assuming the electric potential difference U between s and t isknown, what is the current flowing in each edge?

Notation: Iab will denote the current flowing from the vertex a to the vertexb (Iab < 0 if the current flows from b to a), Iab = −Iba.Kirchhoff’s 1st law Let x be a vertex other than s or t, then∑

y adjacent to x

Ixy = 0. (1.1)

(This law expresses the fact that no electric charge is created or destroyed.)

Each vertex x has an electrical potential Vx, and Ohm’s law states that forany edge xy,

IxyRxy = Vx − Vy.

Applying this to a cycle we obtain the following:Kirchhoff’s 2nd law: Let x0x1 . . . xn (xn = x0) be a cycle, then

n∑i=1

Rxi−1xiIxi−1xi

= 0. (1.2)

(Kirchhoff’s 2nd law is equivalent to the existence of the electric potential.)

As Kirchhoff’s laws only give homogenenous equations, we need at least onemore equation to determine the currents. Let x0x1 . . . xn be any path froms to t (x0 = s, xn = t) and U = Vs − Vt is the known potential differencebetween s and t. By writing down Ohm’s law for each edge on the path andsumming them, we obtain

n∑i=1

Rxi−1xiIxi−1xi

= U. (1.3)

4

Page 5: Graph Theorems

Example. (Bollobas79, p. 28, Bollobas98, p. 41) An electric network consistsof a source s, a sink t, and two other vertices a and b. The resistances ofthe edges are the following: Rsa = 5Ω, Rsb = 4Ω, Rat = 1Ω, Rbt = 2Ω andRab = 3Ω, as shown on the graph below. The potential difference between sand t is 1V .

a b

s

t

5 4

3

1 2

We obtain the following equations from (1.1) for a and b, from (1.2) for thecycles sabs and atba and from (1.3) for the path sat:

Isa − Iab − Iat = 0

Isb + Iab − Ibt = 0

5Isa + 3Iab − 4Isb = 0

Iat − 2Ibt − 3Iab = 0

5Isa + Iat = 1

We have 5 linear equations for 5 variables and the unique solution is Isa =10/62A, Isb = 11/62A, Iab = −2/62A (Iab < 0 means that the current is, infact, flowing from b to a), Iat = 12/62A and Ibt = 9/62A.

Theorem 1.1 For any connected graph G = (V,E) and for any positivevalues of resistances, the equations (1.1), (1.2) wand (1.3) have a uniquesolution.

Proof. Uniqueness: Let’s assume that the Iab and the I ′ab (ab ∈ E) bothsatisfy (1.1), (1.2) and (1.3). Let Jab = Iab − I ′ab (ab ∈ E), then the Jab also

satisfy (1.1), (1.2), but instead of (1.3) we now haven∑

i=1

Rxi−1xiJxi−1xi

= 0 for

the path x0x1 . . . xn from s to t, i. e., the potential difference between s andt is 0.

5

Page 6: Graph Theorems

Let’s assume that there is an edge y0y1 such that Jy0y1 6= 0, we may assumethat Jy0y1 > 0. If y1 6= s, t, by (1.1) there exists a vertex y2 adjacent to y1such that Jy1y2 > 0, in particular this implies y2 6= y0. Similarly, if y0 6= s, t,there exists a vertex y−1 6= y1 adjacent to y0 such that Jy−1y0 > 0. Wecan extend the sequence y−1, y0, y1, y2 in both directions in such a way thatJyiyi+1

> 0 for every i, until we find k < l such that yk = yl, or yk = s andyl = t, or yk = t and yl = s.

If yk = yl, then we may assume that l − k is minimal, this ensures that

ykyk+1 . . . yl−1yl is a cycle. Now we havel∑

i=k+1

Ryi−1yiJyi−1yi > 0 since every

term in the sum is positive, this contradicts (1.2) for the cycle ykyk+1 . . . yl−1yl.

If yk = s and yl = t, thenl∑

i=k

Ryi−1yiJyi−1yi > 0, contradicting that the

potential difference between s and t is 0. The case yk = t and yl = s issimilar.

Existence (sketch): Let’s consider just the equations given by Kirchoff’s laws.Let’s assume first that G is a tree. Then there are |E| = |V | − 1 variablesand |E| − 1 = |V | − 2 equations (1.1) for each vertex other than s and t), sothe space of solutions is at least 1-dimensional. Adding an edge introduces anew variable and it can be proved that the rank of the matrix of the systemof linear equations is always at most |E| − 1. (There may be several cyclescontaining the new edge, but the sum or difference of Kirchoff’s 2nd lawcan be expressed in terms of Kirchoff’s 2nd law for cycles not containing thenew edge.) Therefore the space of solutions of (1.1) and (1.2) is at least 1-dimensional. An argument similar to the one used in the proof of uniquenesscan be used to prove that (1.3) can also be satisfied.

However, this argument is not required, because we shall give a constructiveproof of existence by describing a method for calculating the solution.

The Method of Spanning Trees for calculating the solution

Definition: A spanning tree of a graph G is a subgraph which is a tree andwhich contains all vertices of G.

Definition: The weight of a subgraph T is w(T ) =∏

e∈E(T )1Re. For an edge

ab, N(a, b) =∑

T w(T ), where the summation is over all spanning trees Tsuch that the edge ab is on the unique path from s to t in T and a precedesb on that path.

6

Page 7: Graph Theorems

We claim that the currents defined by

Iab = α(N(a, b)−N(b, a))

where α is a constant, satisfy Kirchoff’s laws, see below.

Let’s consider Kirchhoff’s 1st law at a vertex x 6= s, t. Let T be an arbitraryspanning tree of G and let y0y1 . . . yn be the unique path from s to t in T .If x is not one of the vertices on this path, T does not contribute to the thecurrent in any of the edges incident with x. Let’s assume now that x on thepath, x = yi for some i, 1 ≤ i ≤ n − 1. Then w(T ) is a term in N(yi−1, x)and in N(x, yi+1), but not in N(x, y) or N(y, x) for any other vertex adjacentto x. Therefore T contributes αw(T ) to Ixyi+1

and −αw(T ) to Ixyi−1, so its

total contribution to the left-hand side of (1.1) is 0. By summing it over allspanning trees we see that (1.1) holds.

Let’s consider Kirchhoff’s 2nd law for a cycle x0x1 . . . xn−1xn (xn = x0). Wedefine a thicket to be a pair of subtrees Fs, Ft such that s ∈ V (Fs), t ∈ V (Ft),V (Fs) ∩ V (Ft) = ∅ and V (Fs) ∪ V (Ft) = V . Adding an edge connecting anyvertex in Fs to any vertex in Ft will give a spanning tree of G, since it willcreate a connected graph without cycles (see the lemma in the solution ofquestion 1 on homework sheet 1), which contains all vertices of G, but addingan edge betwen two vertices in Fs or two vertices in Ft will not give a tree.

Let’s fix a thicket and let T be a spanning tree obtained by adding one of

the edges xi−1xi to Fs, Ft. Then w(T ) =w(Fs)w(Ft)

Rxi−1xi

. If xi−1 ∈ Fs and

xi ∈ Ft, then xi−1xi lies on the unique path from s to t and xi−1 precedes xi,because xi−1xi is the only edge connecting a vertex in Fs to a vertex in Ft,and the path has to cross from Fs to Ft at some point. Therefore w(T ) isincluded as a summand in Nxi−1xi

, so the contribution of T to Rxi−1xiIxi−1xi

is

αw(Fs)w(Ft)

Rxi−1xi

Rxi−1xi= αw(Fs)w(Ft). If xi ∈ Fs and xi−1 ∈ Ft, then similarly

the edge xi−1xi lies on the unique path from s to t but now xi precedes xi−1,so w(T ) is included in N(xi, xi−1) and the contribution of T to Rxi−1xi

Ixi−1xi

is −αw(Fs)w(Ft).

As x0x1 . . . xn−1xn is a cycle, it must cross from Fs to Ft exactly the samenumber of times as it crosses back, therefore the number of edges contributing+αw(Fs)w(Ft) is equal to the number of edges contributing −αw(Fs)w(Ft),so the total contribution to the left-hand side of (1.2) coming from all span-ning trees that can be obtained from the thicket Fs, Ft is 0. By summing itover all possible thickets, we see that (1.2) also holds.

Therefore the Iab = α(N(a, b) − N(b, a)) indeed satisfy Kirchoff’s laws for

7

Page 8: Graph Theorems

any α and then α can be determined from (1.3) for any path from s to t.

Remark: A spanning tree T does not contribute to Iab if it does not containthe edge ab or if ab does not lie on the path from s to t in T . If ab is on theunique path from s to t in T , then T contributes with a + sign if a precedesb and with a − sign if b precedes a on that path. In particular, if only thecurrents in some edges are required, only the spanning trees in which thoseedges lie on the path from s to t need to be taken into account.

The following theorem gives the number of spanning trees in a graph, so itcan be used to verify that a given list of spanning trees is complete.

Theorem 1.2 (Matrix Tree Theorem, Kirchhoff) Let G be a graph withvertices labelled x1, x2, . . . , xn. Let

aij =

d(xi) if i = j,

−1 if i 6= j and xixj is an edge of G,

0 if i 6= j and xixj is not an edge G,

and let A be the n× n matrix whose ij entry is aij.

The number of spanning trees of G is the modulus of any (n− 1)× (n− 1)

minor of A. It can also be calculated asλ1λ2 . . . λn−1

n, where λ1, λ2, . . .λn−1

are the eigenvalues of A with a 0 removed.

Theorem 1.3 (Cayley) The number of spanning trees of the complete graphKn is nn−2.

Example. Let’s consider again the example before the theorem.

There are 8 spanning trees, which are shown in the first row of the tablebelow. The 2nd row shows the weight of each tree, the other rows show thecalculation of N(x, y)−N(y, x) for each edge xy. The key thing to rememberis that a spanning tree T only contributes to N(x, y) − N(y, x) if the edgexy is on the unique path from s to t in T , the contribution is +w(T ) if xprecedes y on that path and −w(T ) if y precedes x.

8

Page 9: Graph Theorems

w(T )1

10

1

20

1

8

1

40

1

30

1

12

1

15

1

24

N(x, y)−N(y, x)

sa1

10

1

20

1

30

1

15

1

4

sb1

8

1

40

1

12

1

24

11

40

ab1

30− 1

12− 1

20

at1

10

1

20

1

12

1

15

3

10

bt1

8

1

40

1

30

1

24

9

40

The currents are α times the numbers in the last column for some constant

α. Now (1.3) for the path sat gives 5 · 14α+

3

10α = 1, hence α = 20/31, and

we obtain exactly the same answers as before.

1.2 Squared squares and rectangles

(Bollobas79 Chapter II, §2, Bollobas98 Chapter II, §2, see also http://en.

wikipedia.org/wiki/Squaring_the_square and http://www.squaring.net.)

Imagine that a rectangle with horizontal sides of length a vertical sides oflength b is made of a metal plate of uniform thickness.

If we apply a voltage to the top and bottom sides, a current will flow verti-cally, so we can make vertical cuts without effecting the current. Where wemake a horizontal cut, we separate the squares, we apply a superconductingmaterial to the horizontal sides and connect the separated squares by a su-perconducting wire (superconducting means 0 resistance), this will not affectthe current either.

The resistance between the sides of length a is proportional to b/a, and bychoosing suitable units, we can assume that the resistance of any square is 1.

This way we can associate graphs to subdivisions of rectangles into squares.The vertices of the graph will be the horizontal line segments forming theedges of the squares, including the top edge and the bottom edge of therectangle, the source and the sink, resp. The edges correspond to the squares,

9

Page 10: Graph Theorems

each one connecting the line segments corresponding to its top and bottomedges, and each edge has resistance 1.

In particular, a subdivision of a square into squares gives rise to a an electricnetwork of total resistance 1 consisting of resistors of resistance 1.

Given a graph, if it arises from a subdivision of a rectangle into squares, onecan reconstruct the subdivision in the following way. The total resistenceof the graph when each edge has resistance 1 is the ratio of the sides of therectangle, the sides of the squares are proportional to the currents in thecorresponding edges and the graph gives information about the arrangementof the squares.

Example: The diagram below on the left shows a 11×15 rectangle subdividedinto squares, the diagram on the right shows the corresponding graph.

6

3

5 61

1

4

4

5

s

t

a

c

b

d

s

ab

cd

t

The horizontal line segments, including the top and bottom edge of the rect-angle are labelled with letters, they correspond to the vertices of the graph.For every square, there is an edge between the vertices corresponding to thehorizontal line segments forming the top and bottom sides of the square.

Given only the graph, we assing edge resistance 1, put an arbitrary voltagebetween s and t and calculate the currents by solving Kirchhoff’s equationsor by using the method of spanning trees. (There are 75 spanning trees,but on the plus side, they all have weight 1.) The solutions are Isa = Idt =6α, Isc = Ibt = 4α, Isd = Iat = 5α, Icd = Iab = α and Icb = 3α, whereα is a suitable constant. The currents are proportional to the side of thecorresponding squares.

10

Page 11: Graph Theorems

2 Flow networks and applications

2.1 Flow networks and the Ford–Fulkerson algorithm

(Jungnickel, Chapter 6, Bollobas79, Chapter III, Bollobas98, Chapter III)

Setup: G is a directed graph with 2 distinguished vertices, the source s andthe sink t, and with a capacity 0 < c(x, y) <∞ assigned to each edge.

Definition: A flow (also called a feasible flow) is a function f : E(G)→ R≥0such that 0 ≤ f(x, y) ≤ c(x, y) for every edge xy and for every vertex x otherthan s and t we have ∑

xy∈E(G)

f(x, y) =∑

yx∈E(G)

f(y, x). (2.1)

(This is analogous to Kirchhoff’s 1st law.)

Definition: The value of a flow f is v(f) =∑

sy∈E(G)

f(s, y)−∑

ys∈E(G)

f(y, s).

Definition: A cut is a partitioning of V (G) into two subsets S and T suchthat S ∪ T = V (G), S ∩ T = ∅, s ∈ S and t ∈ T . The capacity of a cut S, T

is c(S, T ) =∑

xy∈E(G),x∈S,y∈T

c(x, y).

Lemma 2.1 (Jungnickel, Lemma 6.1.2, Bollobas79, p. 46, Bollobas98, p. 69)For any flow f and any cut S, T , we have v(f) ≤ c(S, T ).

Proof. v(f) =∑

sy∈E(G)

f(s, y)−∑

ys∈E(G)

f(y, s), while for x ∈ S\s,∑

xy∈E(G)

f(x, y)−∑yx∈E(G)

f(y, x) = 0. Hence

v(f) =∑

x∈S, xy∈E(G)

f(x, y)−∑

x∈S, yx∈E(G)

f(y, x).

If a, b ∈ S, f(a, b) occurs in the above expression once with + sign, once with− sign, so it cancels out. If a ∈ S and b ∈ T , f(a, b) occurs once with + sign.If a ∈ T and b ∈ S, f(a, b) occurs once with − sign. If a, b ∈ T , f(a, b) doesnot occur at all. Hence

v(f) =∑

a∈S, b∈Tab∈E(G)

f(a, b)−∑

a∈S, b∈Tba∈E(G)

f(b, a) ≤∑

a∈S, b∈Tab∈E(G)

f(a, b) = c(S, T ),

as claimed.

11

Page 12: Graph Theorems

Theorem 2.2 (Max-flow-min-cut theorem, Ford–Fulkerson, 1956) (Jung-nickel, Theorem 6.1.6, Bollobas79, Chapter III, Theorem 1, Bollobas98, Chap-ter III, Theorem 1) Let G be a directed graph, with 2 distinguished vertices,the source s and the sink t, and with a capacity 0 < c(x, y) <∞ assigned toeach edge xy. There exists a flow of maximal value, and this maximal valueis equal to the minimum of the capacities of the cuts.

Proof. The set of flows is a subset of R|E(G)| defined by the inequalities0 ≤ f(x, y) ≤ c(x, y) and the equations (2.1), therefore it is closed andbounded, so by the Heine–Borel theorem, it is compact. v(f) is a continuousfunction of f , therefore it has a maximum. This proves the existence of aflow of maximum value. (This part of the proof is not examinable.)

Let f be a flow. Let’s try to construct a flow with greater value, if possible.The idea is to find the vertices to which we can increase the flow and see ift is among them.

Let’s define the sets Sj for j ≥ 0 inductively as follows. We start withS0 = s. Let’s assume that Sj has already been contructed. There are twoways the flow could be increased to a vertex y outside Sj, either xy is anedge is an edge with spare capacity, that is f(x, y) < c(x, y), or yx is an edgewith f(x, y) > 0. Sj+1 is obtained from Sj by adjoining these two kinds ofvertices, formally

Sj+1 = Sj ∪ y ∈ V (G) | ∃x ∈ Sj, f(x, y) < c(x, y)∪ y ∈ V (G) | ∃x ∈ Sj, f(y, x) > 0.

There are two possibilities, either there exists n such that t ∈ Sn (Case 1),or there exists no such n, in which case there exists N such that SN = SN+1

and t /∈ SN (Case 2), since S0 ⊆ S1 ⊆ S2 ⊆ . . . and G is finite.

Case 1. t ∈ Sn for some n, we may assume that n is minimal with thisproperty. Let xn = t. By the minimality of n, t /∈ Sn−1, so there existsxn−1 ∈ Sn−1 such that either f(xn−1, xn) < c(xn−1, xn) or f(xn, xn−1) > 0.In the first case let en = xn−1xn, in the second, let en = xnxn−1. Assume thatwe already have xmem+1xm+2 . . . xn−1enxn such that for each i, m ≤ i ≤ n,xi ∈ Si and either ei is the edge xi−1xi and f(xi−1, xi) < c(xi−1, xi) or ei isthe edge xixi−1 and f(xi, xi−1) > 0. By the minimality of n, xm /∈ Sm−1,so there exists xm−1 ∈ Sm−1 such that either f(xm−1, xm) < c(xm−1, xm) orf(xm, xm−1) > 0. In the first case let em = xm−1xn, in the second let em =xmxm−1. Since S0 = s, this way we obtain a path x0e1x1e2 . . . xn−1enxnwith x0 = s, xn = t, and for each i, 1 ≤ i ≤ n, either ei is the edge xi−1xiand f(xi−1, xi) < c(xi−1, xi) or ei is the edge xixi−1 and f(xi, xi−1) > 0.

12

Page 13: Graph Theorems

The sequence of vertices and directed edges obtained above is called an aug-menting path, the formal definition is given below.

Definition: Given a flow f in the graph G, an augmenting path is an al-ternating sequence of vertices and edges, x0e1x1e2x2 . . . xn−1enxn, such thatx0 = s, xn = t, and for each k, 1 ≤ k ≤ n, either ek = xk−1xk andf(xk−1, xk) < c(xk−1, xk) (this is called a forward edge) or ek = xkxk−1 andf(xk, xk−1) > 0 (this is called a backward edge). (It is called an augmentingpath because it can be used to increase the flow by using the spare capacityin the forward edges and by reducing the flow in the backward edges.)

Given an augmenting path, we set

ε = min

minc(xk−1, xk)− f(xk−1, xk) | ek is a forward edge,minf(xk, xk−1) | ek is a backward edge

.

and define a new flow f by

f(x, y) =

f(x, y) if xy 6= ek for any k, 1 ≤ k ≤ n,

f(x, y) + ε if xy = ek is a forward edge,

f(x, y)− ε if xy = ek is a backward edge.

f is also a flow, by construction 0 ≤ f(x, y) ≤ c(x, y) for every edge xyand (2.1) is also satisfied at all vertices other than s and t, and we havev(f) = v(f) + ε > v(f). This means that v(f) was not maximal.

Case 2. Let S = SN and T = V (G) \ S. S, T is clearly a cut. Let x ∈ Sand y ∈ T . If xy is an edge then f(x, y) = c(x, y), since otherwise we wouldhave y ∈ SN+1. Similarly, if yx is an edge then f(y, x) = 0, since otherwisewe would have y ∈ SN+1.

We saw in the proof of Lemma 2.1 that

v(f) =∑

x∈S,y∈Txy∈E(G)

f(x, y)−∑

x∈S,y∈Tyx∈E(G)

f(y, x).

We have established that f(x, y) = c(x, y) if xy is an edge with x ∈ S andy ∈ T , and f(y, x) = 0 if yx is an edge with x ∈ S and y ∈ T , therefore

v(f) =∑

x∈S,y∈Txy∈E(G)

c(x, y) = c(S, T ).

By Lemma 2.1 this implies that v(f) is maximal and c(S, T ) is minimal.

This argument can be turned into an algorithm for finding a flow of maximumvalue.

13

Page 14: Graph Theorems

The Ford–Fulkerson algorithm (Jungnickel, Algorithm 6.1.7) See http:

//www.maths.manchester.ac.uk/~gm/teaching/MATH39001/FFdemo13Oct2014.

pdf, http://www.maths.manchester.ac.uk/~gm/teaching/MATH39001/FFdemo15Oct2014.pdf and Jungnickel pp. 156–161 for worked examples.

Step 1. Start with any flow f0, e. g., f0(x, y) = 0 for every edge xy.

Step 2. Assume that you already have a flow fr. Find an augmenting path,x0e1x1e2x2 . . . xn−1enxn, if possible. See below for a systematic way of findingone, or showing that there is no augmenting path, but in most cases youshould be able to find an augmenting path by observation. Set

ε = min

minc(xk−1, xk)− fr(xk−1, xk) | ek is a forward edge,minfr(xk, xk−1) | ek is a backward edge

.

and define the flow fr+1 as follows:

fr+1(x, y) =

fr(x, y) if xy 6= ek for any i, 1 ≤ i ≤ n,

fr(x, y) + ε if xy = ek is a forward edge,

fr(x, y)− ε if xy = ek is a backward edge.

fr+1 is also a flow, by construction 0 ≤ fr+1(x, y) ≤ c(x, y) for every edgexy and (2.1) is also satisfied at all vertices other than s and t, and we havev(fr+1) = v(fr) + ε. Now repeat Step 2 with fr+1.

Step 3. There is no augmenting path, in this case by constructing the setsSj, j = 0, 1, 2, . . ., we obtain a cut S, T , such that c(S, T ) = v(fr), thereforev(fr) is maximal, STOP.

Finding an augmenting path:If you cannot see an augmenting path, then define the sets Sj for j ≥ 0 asfollows. S0 = s. If Sj has been constructed for some j ≥ 0, let

Sj+1 = Sj ∪ y ∈ V (G) | ∃x ∈ Sj, fr(x, y) < c(x, y)∪ y ∈ V (G) | ∃x ∈ Sj, fr(y, x) > 0.

Case 1. t ∈ Sn for some n, we may assume that n is minimal with thisproperty. Let xn = t. By the minimality of n, t /∈ Sn−1, so there existsxn−1 ∈ Sn−1 such that either fr(xn−1, xn) < c(xn−1, xn) or fr(xn, xn−1) > 0.In the first case let en = xn−1xn, in the second, let en = xnxn−1. Assume thatwe already have xmem+1xm+2 . . . xn−1enxn such that for each i, m ≤ i ≤ n,xi ∈ Si and either ei is the edge xi−1xi and fr(xi−1, xi) < c(xi−1, xi) or ei isthe edge xixi−1 and fr(xi, xi−1) > 0. By the minimality of n, xm /∈ Sm−1,

14

Page 15: Graph Theorems

so there exists xm−1 ∈ Sm−1 such that either fr(xm−1, xm) < c(xm−1, xm)or fr(xm, xm−1) > 0. In the first case let em = xm−1xn, in the second letem = xmxm−1. Since S0 = s, this way we obtain an augmenting pathx0e1x1e2 . . . xn−1enxn.

Case 2. t /∈ Sn for any n, in this case there is no augmenting path. Thereexists N such that SN = SN+1, let S = SN , T = V (G) \ SN . Go to Step 3.

Theorem 2.3 (Jungnickel, Theorem 6.1.5, Bollobas79, Chapter III, Theorem2, Bollobas98, Chapter III, Theorem 2) Assume that all the capacities areintegers. Then the Ford–Fulkerson algorithm terminates in finitely manysteps and gives an integral maximal flow, i.e., a maximal flow f such thatf(x, y) is an integer for each edge xy.

Proof. If all the capacities are integers and we start with the 0 flow, thenthe algorithm constructs flows with integer values in each edge in each step.v(f0), v(f1), v(f2), . . . is a strictly increasing sequence of integers which isbounded by the capacity of any cut, so it must be finite and the algorithmmust terminate in finitely many steps. The maximal flow obtained is alsointegral.

Remarks 1. If we only assume that the capacities are rational numbers, theFord–Fulkerson algorithm still terminates and gives a rational maximal flow.2. WARNING: If some capacities are irrational, the Ford–Fulkerson algo-rithm may not terminate and the flows may not even converge to a maximalflow.3. (Bollobas79, Chapter III, Theorem 3, Bollobas98, Chapter III, Theorem 3)The Ford–Fulkerson algorithm can be extended to networks with multiplesources s1, s2, . . . , sm, and multiple sinks t1, t2, . . . , tn with the objective ofmaximising the sum of the flows from the sources. Introduce a new sources and connect it to the original sources by infinite capacity edges −→ss1, −→ss2,. . . , −−→ssm, and similarly introduce a new sink t connect it to the original sinksby infinite capacity edges

−→t1t,−→t2t, . . . ,

−→tnt. Infinite capacity means that the

edges can carry arbitrarily large finite flows. Alternatively, the new edgescan be given a finite capacity greater than the sum of the capacities of theother edges. There is an obvious correspondence between the flows in theoriginal and the new network, and the maximal flow in the new network willgive the maximal flow in the original network.4. Vertices can also have capacities, meaning that for some vertices x the sumof the flows in the edges into a vertex, which is equal to the sum of the flows

in the edges out of the vertex, is bounded by c(x),∑

xy∈E(G)

f(x, y) ≤ c(x).

This can be reduced to the case with only edge capacities by replacing x by

15

Page 16: Graph Theorems

two vertices x− and x+ and an edge−−−→x−x+ of capacity c(x) between them,

and changing the graph so that the edges into x go into x− and the edgesout of x go out of x+, as illustrated in the figure below.

H2LH4L

H5LH3LH6L

cHxL=7

x −→

H2LH4L

H5LH3LH6Lx- x+H7L

There is an obvious bijection between the flows in the original graph satisfyingthe additional capacity constraints at x and ordinary flows in the new graph.

Definition. A vertex cut is a set Z of vertices such that s, t /∈ Z and re-moving the vertices in Z together with any edges incident with them makesG disconnected with s and t in different components. The capacity of Z is

c(Z) =∑z∈Z

c(z).

Theorem 2.4 (Vertex version of Max-flow-min-cut, Bollobas79, Chapter III,Theorem 4, Bollobas98, Chapter III, Theorem. 4) Assume that in the graphG every edge has infinite capacity in both directions, but the vertices otherthan s, t have finite capacities. Then the maximum value of the flows in G isequal to the minimum of the capacities of the vertex cuts. Proof. Let G′ bethe graph in which each vertex x of G other than s and t is replaced by two

vertices x− and x+ and an edge−−−→x−x+ of capacity c(x) and each edge xy of

G is replaced by two directed edges,−−−→x+y− and

−−−→y+x−. Similarly, edges of the

form sy are replaced by directed edges,−−→sy− and

−−→y+s and edges of the form

xt are replaced by directed edges,−→x+t and

−→tx−. All edges are given infinite

capacity. The source in G′ is s and the sink is t.

x yG

−→ HcHxLL H¥L HcHyLL

H¥L

x- x+ y- y+G'

The idea of the proof is to establish a correspondence between vertex cuts inG and (ordinary) cuts in G′ and then to apply Theorem 2.2 to G′.

Let Z be a vertex cut in G, we shall construct a cut in G′ the usual sensewhose capacity is equal to that of Z.

16

Page 17: Graph Theorems

After removing Z and the edges incident with the vertices in Z, G becomesdisconnected with s and t in different components, this is the definition ofthe vertex cut. Let S be the set of vertices of the component containing sand T the union of the set of vertices of the other components (there maybe several).

LetS ′ = s ∪ x−, x+ | x ∈ S, x 6= s ∪ z− | z ∈ Z

andT ′ = t ∪ x−, x+ | x ∈ T, x 6= t ∪ z+ | z ∈ Z.

Clearly S ′ ∩ T ′ = ∅ and S ′ ∪ T ′ = V (G′), so S ′, T ′ is a cut in G′. Let’sconsider the possible edges from S ′ to T ′. There are two types of edges in

G′,−−−→x−x+ for x ∈ V (G), x 6= s, t and edges corresponding to edges of G. For

the first type we need x− ∈ S ′ and x+ ∈ T ′ which implies x ∈ Z, and indeed

for any x ∈ Z,−−−→x−x+ is an edge from S ′ to T ′. Let’s assume

−−−→x+y− is an edge

of the second type from S ′ to T ′. Then x ∈ S, y ∈ T and xy is an edge inG, but this is impossible since S is a connected component of G after Z hasbeen removed and T is the union of the other components, therefore therecan be no edge between a vertex in S and a vertex in T . The other possible

edges of this type−−→sy−,

−−→y+s,

−→x+t and

−→tx− can be dealt with similarly.

Hence S ′, T ′ is a cut in G′ with c(S ′, T ′) = c(Z).

Let us now consider a cut S ′, T ′ in G′ with finite capacity. The finiteness

of c(S ′, T ′) implies that any edge from S ′ to T ′ must be of the form−−−→z−z+,

z ∈ V (G), z 6= s, t since these are the only ones with finite capacity. LetZ = z ∈ V (G) | z− ∈ S ′ and z+ ∈ T ′. We claim that Z is a vertex cut.s, t /∈ Z clearly. Let x0x1 . . . xn−1xn (x0 = s, xn = t) be a path from s to t inG. There is a corresponding path sx−1 x

+1 . . . x

−n−1x

+n−1t in G′. As s ∈ S ′ and

t ∈ T ′, there is a last vertex on this path which is in S ′. If it were x+i for

some i, 0 ≤ i ≤ n−2, then−−−−→x+i x

−i+1 would be an infinite capacity edge from S ′

to T ′, but we have assumed that c(S ′, T ′) is finite. Similarly, it cannot be s,because c(s, x−1 ) = ∞ and it cannot be x+n−1 either because c(x+n−1, t) = ∞.Therefore this last vertex must be x−i for some i, 1 ≤ i ≤ n − 1. Thenx+i ∈ T ′, therefore x ∈ Z. We have proved that any path from s to t mustcontain a vertex in Z, therefore removing Z and the edges incident with thevertices in Z makes G disconnected with s and t in different components, soZ is a vertex cut. It follows from the construction that c(Z) = c(S ′, T ′).

There is a bijection between the flows in G satisfying the capacity conditionsat the vertices and the flows in G′ and this bijection preserves the value ofthe flows. We know by Theorem 2.2 that the maximum of the value of the

17

Page 18: Graph Theorems

flows in G′ is equal to the minimum of the capacities of the cuts, and we haveproved that there is bijection between vertex cuts in G and cuts in G′, andthis preserves capacities. Therefore the maximum value of the flows in G isequal to the minimum of the capacities of the vertex cuts.

2.2 Connectivity and matchings in graphs

(Jungnickel, Chapters 7 and 13, Bollobas79, Chapter III, Bollobas98, Chap-ter III)

Definition. Let G be a simple graph and let s, t ∈ V (G). A set of pathsbetween s and t is called edge independent if and only if no two have an edgein common. A set of paths between s and t is called vertex independent ifand only if no two have an vertex in common other than s and t.

Theorem 2.5 (Menger’s theorems) (Jungnickel, Thms. 7.1.1 and 7.1.4, Bol-lobas79, Chapter III, Thm. 5, Bollobas98, Chapter III, Thm. 5)Let G be a simple graph and let s, t ∈ V (G).(i) (Edge version) The minimum number of edges that need to be removedto disconnect s and t is the maximum number of edge independent pathsbetween s and t.(ii) (Vertex version) If s, t are not adjacent, the minimum number of verticesthat need to be removed, together with the edges incident with them, inorder to disconnect s and t is the maximum number of vertex independentpaths between x and y.

Proof. The key idea in the proof of both parts is to relate the paths to flowsand the edges or vertices that have to be removed to cuts or vertex cuts.

(i) Let the graph G′ with the same vertices as G. If xy ∈ E(G) and neitherof x, y is s or t, then replace xy by two directed edges −→xy and −→yx. Replacethe edges sy and xt by directed edges −→sy and

−→xt. Give each edge capacity 1.

Given a set of edge independent paths between s and t in G, we can constructa flow in G′ from it. If sx1x2 . . . xn−1t is one of the paths, let f(s, x1) =f(x1, x2) = . . . = f(xn−1, t) = 1. Do this for each path and let f(x, y) = 0for all other edges. f satisfies (2.1) and also the capacity restriction in eachedge because of the edge independence of the paths.

Let us now consider an integral flow f in G′. As the capacity of each edge is 1,integrality means that the flow in each edge is 0 or 1. If there are vertices x1,x2, . . . , xn−1, xn such that f(x1, x2) = f(x2, x3) = . . . = f(xn−1, xn) =f(xn, x1) = 1, we can set f(x1, x2) = f(x2, x3) = . . . = f(xn−1, xn) =

18

Page 19: Graph Theorems

f(xn, x1) = 0 while preserving (2.1). By repeating this, we can eliminatecircular flows, so we can assume that there are no circular flows. Note thatthis does not change the value of the flow.

Let sx1 be an edge with f(s, x1) = 1. If x1 6= t, then since the flow in eachedge is 0 or 1, by (2.1) there exists x2 with f(x1, x2) = 1. If x2 6= t, thensimilarly there exists x3 with f(x2, x3) = 1. As we have eliminated circularflows and graph is finite, if we continue this process, we must reach t infinitely many steps and we get a path sx1x2 . . . xn−1t. We then repeat thiswith other edges incident with s that carry a flow. The only difference is thatat the intermediate vertices we have to choose an unused edge to continue,but this is possible since by (2.1) at every vertex other than s, t, the numberof incoming edges with a flow equals the number of outgoing edges with aflow, and each path uses one of each. The paths constructed this way areedge independent, since each edge carrying a flow can be used at most once.(Eliminating circular flows means that we cannot have a flow both in theedge −→xy and in the edge −→yx.)

This gives a correspondence between sets of edge independent paths betweens and t in G and integral flows in G′, and the number of paths is equal tovalue of the corresponding flow.

Let Z ⊆ E(G) be a set of edges whose removal disconnects s, t. Let S bethe set of vertices of the component containing s and let T = V (G) \ S. S,T is a cut in G′ and its capacity is the number of edges between S and T inG, which is at most |Z|. If S, T is a cut in G′, let Z ⊆ E(G) be the set ofedges between S and T in G. As each edge in G′ has capacity 1, we have|Z| = c(S, T ). Hence the minimum number of edges that have to removed inorder to disconnect s and t in G is equal to the minimum of the capacity ofthe cuts in G′.

By Theorem 2.3, there exist an integral flow in G′ whose value is equal tothe minimum of the capacity of the cuts. By our previous observations, theformer is equal to the maximum number of edge independent paths betweens and t, while the latter is equal to the minimum number of edges that haveto be removed in order to disconnect s and t. This proves (i).

(ii) Let each vertex of G other than s and t have capacity 1 and let each edgehave infinite capacity in both directions.

Given a set of vertex independent paths between s and t in G, we can con-struct a flow from it. If sx1x2 . . . xn−1t is one of the paths, let f(s, x1) =f(x1, x2) = . . . = f(xn−1, t) = 1. Do this for each path and let f(x, y) = 0for all other edges. f satisfies (2.1) and also the capacity restriction at each

19

Page 20: Graph Theorems

vertex because of the vertex independence of the paths.

Let us now consider an integral flow f in G. As the capacity of each ver-tex is 1, integrality means that the flow in each edge is 0 or 1. If thereare vertices x1, x2, . . . , xn−1, xn such that f(x1, x2) = f(x2, x3) = . . . =f(xn−1, xn) = f(xn, x1) = 1, we can set f(x1, x2) = f(x2, x3) = . . . =f(xn−1, xn) = f(xn, x1) = 0 while preserving (2.1). By repeating this, wecan eliminate circular flows, so we can assume that there are no circularflows. Note that this does not change the value of the flow.

Let sx1 be an edge with f(s, x1) = 1. As the flow in each edge is 0 or 1 andthe capacity of each vertex other that s and t is 1, by (2.1) there exists aunique x2 with f(x1, x2) = 1. If x2 6= t, then similarly there exists a unique x3with f(x2, x3) = 1. As we have eliminated circular flows and graph is finite,if we continue this process, we must reach t in finitely many steps and we geta path sx1x2 . . . xn−1t. We then repeat this with other edges incident with sthat carry a flow. The paths constructed this way are vertex independent,since each vertex can be used at most once.

This gives a correspondence between sets of vertex independent paths be-tween s and t in G and integral flows in G, and the number of paths is equalto value of the corresponding flow.

A set of vertices Z in G whose removal disconnects s and t is exactly a vertexcut and its capacity is exactly |Z| since each vertex has capacity 1.

By Theorem 2.4, the maximum value of the flows in G equal to the minimumof the capacity of vertex cuts. Furthermore, Theorem 2.4 is proved by con-structing another graph with only edge capacities, and since the capacitiesare integers, so by Theorem 2.3 there exists an integral flow which whosevalue is equal to the minimum capacity of the vertex cuts.

By our previous observations, the maximum value of integral flows is equalto the maximum number of vertex independent paths between s and t, whilethe minimum capacity of the vertex cuts is equal to the minimum number ofvertices that have to be removed in order to disconnect s and t. This proves(ii).

Definition. A graph G = (V,E) is bipartite if and only if V can be partitionedinto two non-empty subsets V1 and V2 such that V = V1 ∪ V2, V1 ∩ V2 = ∅and there are no edges between vertices in V1 or between vertices in V2.

Definition. Let G = (V,E) be a bipartite graph with vertex classes V1 and V2.A matching from V1 to V2 is a set of edges F ⊂ E such that no two edges inF have a vertex in common and every vertex in V1 is incident with exactly

20

Page 21: Graph Theorems

one edge in F .

Theorem 2.6 (Konig’s theorem or Hall’s marriage theorem) (Jungnickel,Theorem 7.2.4, Bollobas79, Chapter III, Theorem 7, Bollobas98, ChapterIII, Theorem 7, http://en.wikipedia.org/wiki/K%C3%B6nig’s_theorem_(graph_theory).) Let G = (V,E) be a bipartite graph with vertex classesV1 and V2. For X ⊆ V1 define Γ(X) = y ∈ V2 | ∃x ∈ X such that xy ∈ E.There exists a matching from V1 to V2 if and only if |Γ(X)| ≥ |X| for everysubset X ⊆ V1.

Proof. Let’s assume that there exists a matching from V1 to V2. For anyX ⊆ V1, there are |X| vertices in V2 connected to the vertices in X by thematching and they are elements of Γ(X), therefore |Γ(X)| ≥ |X|.Let’s assume now that if |Γ(X)| ≥ |X| for every subset X ⊆ V1.

Let’s construct a new graph G′ by adding new vertices s and t and connectings to each vertex in V1 and t to each vertex in V2.

Let Z be a set of vertices whose removal disconnects s and t. We shall provethat |Z| ≥ |V1| and then we shall apply Theorem 2.5 (ii).

The vertices in V1 \ Z cannot be connected to any vertices in V2 \ Z, sincethis would give a path from s to t, therefore Γ(V1 \ Z) ⊆ V2 ∩ Z. Byassumption |Γ(V1 \ Z| ≥ |V1 \ Z|, therefore |V1 \ Z| ≤ |V2 ∩ Z|. Hence|Z| = |V1 ∩ Z|+ |V2 ∩ Z| ≥ |V1 ∩ Z|+ |V1 \ Z| = |V1|.V1 itself is a set whose removal disconnects s and t, therefore by Theorem2.5 (ii), there exist |V1| vertex independent paths between s and t. Thesepaths must start by an edge to a vertex in V1, cross to V2 and then continueto t since all the vertices in V1 have already been used and the paths arevertex independent. Again because of vertex independence, different edgesbetween V1 and V2 on these paths must have different endpoints in V2, sothese edges give a matching from V1 to V2.

Theorem 2.7 (Hall’s theorem) (Jungnickel, Theorem 7.3.1, Bollobas79,Chapter III, Theorem 7’, Bollobas98, Chapter III, Theorem 8) (Not exam-inable) Let G be a finite group and H a subgroup of G. Let n = |G|/|H|.There exist elements x1, x2, . . . , xn ∈ G such that Hx1, Hx2, . . . , Hxn isthe complete set of right cosets of H in G and x1H, x2H, . . . , xnH is thecomplete set of left cosets of H in G.

Proof. Let V1 be the set of left cosets and V2 the set of right cosets. Anytwo left cosets are either equal or disjoint and similarly for right cosets, so|V1| = |V2| = n. Join A ∈ V1 and B ∈ V2 by an edge if and only if A∩B 6= ∅.This gives a bipartite graph with vertex classes V1 and V2.

21

Page 22: Graph Theorems

Let X = A1, A2, . . . , Ak ⊆ V1. Let Γ(X) = B1, B2, . . . , Bm ⊆ V2. Everyelement of A1 ∪ A2 ∪ . . . Ak is contained in B1 ∪B2 . . . ∪Bm, therefore

k|H| = |A1 ∪ A2 ∪ . . . Ak| ≤ |B1 ∪B2 . . . ∪Bm| = m|H|,

so k ≤ m. (Here we use again the fact that two cosets of the same side areeither equal or disjoint.) This means that |X| ≤ |Γ(X)| holds for all X ⊆ V1,therefore by Theorem 2.6, there exists a matching between V1 and V2. IfA ∈ V1 and B ∈ V2 are connected by the matching, then A ∩ B 6= ∅, andA = xH, B = Hx for any x ∈ A∩B. Therefore if we take one element fromthe intersection of each left coset and right coset connected by the matching,we get a suitable set x1, x2, . . . , xn.

Definition. Let G be a graph. An r-factor of G is a subgraph of G containingevery vertex of G such that every vertex of the subgraph has degree r.

In particular, a 1-factor means that all the vertices are paired up, analogouslya matching in a bipartite graph with |V1| = |V2|. The following theorem givesa criterion for the existence of a 1-factor. Similarly to Theorem 2.6, it turnsout that an obvious necessary condition is also sufficent, but the non-bipartitecase is much more complicated.

Theorem 2.8 (Tutte’s 1-factor theorem) (Jungnickel, Theorem 13.1.1, Bol-lobas79, Chapter III, Theorem 12, Bollobas98, Chapter III, Theorem 14)(Not examinable) Let G = (V,E) be a graph. For an arbitrary graph H,define q(H) to be the number of connected components of H which have anodd number of vertices. For S ⊆ V , let G \ S denote the graph obtained bydeleting S and all the edges incident with any element of S. Then G has a1-factor if and only if |q(G \ S)| ≤ |S| for any S ⊆ V .

22

Page 23: Graph Theorems

3 Extremal graph theory

(Bollobas79, Chapter IV, Bollobas98, Chapter IV)

Definition. The girth of a graph G is the length of the shortest cycle in G or∞ if G has no cycles, i. e., G is a forest.

Theorem 3.1 (Bollobas79, Chapter IV, Theorem 1, Bollobas98, ChapterIV, Theorem 1) Let δ ≥ 3, g ≥ 3 be integers. A graph G of girth g in whichevery vertex has degree at least δ has at least

1 +δ((δ − 1)(g−1)/2 − 1)

δ − 2

vertices if g is odd and at least

2((δ − 1)g/2 − 1)

δ − 2

vertices if g is even.

Proof. Assume first that g is odd.

The idea is to consider all paths of length ≤ (g − 1)/2 starting at a fixedvertex x and to prove that the other endpoints of these paths are different.

Let x ∈ V (G) and let’s consider all sequences of vertices x0x1 . . . xr such thatx0 = x, xi is adjacent to xi−1 for every i, 1 ≤ i ≤ r, xi−1 6= xi+1 for anyi, 1 ≤ i ≤ r − 1, and r ≤ (g − 1)/2. (These sequences are, in fact, vertexsequences of paths, but we are not assuming this.)

First we show that if two such sequences are different, then they have dif-ferent last terms. Assume to the contrary that x0x1 . . . xr and y0y1 . . . ys aredifferent sequences satisfying our conditions with xr = ys. Let k be maximalsuch that x0 = y0, x1 = y1, . . . , xk = yk and let

m = mini | i ≥ k,∃j ≥ k such that yj = xi, (i, j) 6= (k, k).

Let n be minimal such that yn = xm and (m,n) 6= (k, k). xkxk+1 . . . xm andykyk+1 . . . yn are paths, by the choice of m they have no vertex in commonother than their endpoints, therefore xkxk+1 . . . xmyn−1 . . . yk+1yk is a cycle,whose length is at most r + s ≤ g − 1, contradicting the assumption thatthe girth of G is g. Therefore different sequences have different last terms,as claimed.

For a sequence x0x1 . . . xr with r ≥ 1, there are at least δ choices for x1 andat least δ − 1 choices for xi for i ≥ 2, once we have x−1, we can choose as

23

Page 24: Graph Theorems

xi all the neighbours of xi−1 other than xi−2. Hence for a given r ≥ 1, thenumber of sequences x0x1 . . . xr is at least δ(δ − 1)r−1 and the total numberof sequences, including the one consisting of just x0, is

1 +

(g−1)/2∑r=1

δ(δ − 1)r−1 = 1 +δ((δ − 1)(g−1)/2 − 1)

δ − 2.

Since different sequences have different last terms, G has at least this numberof vertices. This proves the theorem for the case when g is odd.

(This second part of the proof is not examinable). Assume now that g iseven.

Let x and y be adjacent vertices and consider sequences x0x1 . . . xr such thatx0 = x or y, x1 6= x, x1 6= y, xi is adjacent to xi−1 for every i, 1 ≤ i ≤ r,xi−1 6= xi+1 for any i, 1 ≤ i ≤ r − 1, and r ≤ g/2− 1.

Again, we can show that if two such sequences are different, then they havedifferent last terms. If both start with x or both start with y, we can use thesame argument as in the case of g odd. If one starts with x and the otherwith y, then prepend x to the latter and consider them as two paths startingat x.

Now we have two choices for x0 and at least δ − 1 choices for xi for i ≥ 1,by the same argument as in the case of g odd. Therefore for each value of r,0 ≤ r ≤ g/2− 1, there are at least 2(δ− 1)r sequences and the total numberof sequences is at least

g/2−1∑r=0

2(δ − 1)r =2((δ − 1)g/2 − 1)

δ − 2.

As different sequences have different last terms, G has at least this numberof vertices. This proves the theorem for the case when g is even.

Note: The theorem only gives a lower bound on the the number of vertices.Graphs which achieve this lower bound are called Moore graphs , but theyonly exist for certain δ and g.

Definition. Let r ≥ 2 and n ≥ r be integers. Let n = qr + k, where q and kare integers, 0 ≤ k ≤ r − 1. The Turan graph Tn,r is a graph on n verticeswhose vertices are divided into r subsets, r − k of size q and k of size q + 1,and two vertices are connected if and only if they are in different subsets.The number of edges of Tn,r is denoted by tn,r.

24

Page 25: Graph Theorems

The figure above shows T7,3.

Theorem 3.2 (Turan) (Bollobas79, Chapter IV, Theorem 6, Bollobas98,Chapter IV, Theorem 8) Let r ≥ 2 and n ≥ r be integers. Any graph G onn vertices which does not contain a complete graph Kr+1 has at most tn,redges. Equality holds if and only if G is isomorphic to Tn,r.

Proof. See http://en.wikipedia.org/wiki/Turan_theorem for a nice proof.

Definition. Let s, t be positive integers. The complete bipartite graph Ks,t isa bipartite graph with vertex classes of size s and t such that every pair ofvertices in different vertex classes are connected by an edge.

Theorem 3.3 (Zarankiewicz problem) (Bollobas79, Chapter IV, Theorem10, Bollobas98, Chapter IV, Theorem 12) Let G be a bipartite graph with nvertices in each vertex class which does not contain a K2,2. Then the number

of edges of G is at mostn(1 +

√4n− 3)

2.

Proof. Let V1 and V2 be the vertex classes. Consider the set

S = (x, y, z) | x, y ∈ V1, x 6= y, z ∈ V2, x, y are adjacent to z.

For any pair x, y, there exists at most one suitable z, since G does notcontain a K2,2, therefore

|S| ≤(n

2

). (3.1)

For a given z, x and y can be any vertices adjacent to z, so the number of

choices is

(d(z)

2

). Let d1, d2, . . . dn be the degrees of the vertices in V2, then

|S| =n∑

i=1

(di2

). (3.2)

25

Page 26: Graph Theorems

Let m be the number of edges of G, then we have m =n∑

i=1

di, since each

edge has exactly one endpoint in V2.

We can define

(x

2

)=x(x− 1)

2for any real number x, then

n∑i=1

(di2

)− n

(m/n

2

)=

∑1≤i<j≤n

(di − dj)2

2n≥ 0.

(This identity can be verified by expanding both sides and using m =n∑

i=1

di,

but there are also other ways of provingn∑

i=1

(di2

)≥ n

(m/n

2

), it is a conse-

quence of the convexity of the function

(x

2

).)

By combining the above inequality with (3.1) and (3.2), we obtain

n

(m/n

2

)≤

n∑i=1

(di2

)= |S| ≤

(n

2

).

Hence

n

(m/n

2

)≤

(n

2

),

n(m/n)(m/n− 1)

2≤ n(n− 1)

2,

m2 −mn+ n2 − n3 ≤ 0

The roots of the quadratic equation m2 −mn+ n2 − n3 = 0 are

m =n±√n2 − 4n2 + 4n3

2=n(1±

√4n− 3)

2,

therefore the last inequality holds if and only if

n(1−√

4n− 3)

2≤ m ≤ n(1 +

√4n− 3)

2.

Remark. 1. From the proof it can be seen that equality holds if and onlyif all vertices have degree (1 +

√4n− 3)/2, in particular this number has to

be an integer, which implies that 4n − 3 has to be a perfect square. As it

26

Page 27: Graph Theorems

is an odd number, it has to be the square of an odd number 2q + 1, thenn = q2 + q + 1 and every vertex has to have degree q + 1, but there meynot be a bipartite graph without a K2,2 with these parameters. Nevertheless,equality can be attained for infinitely many n. If q is a prime or a primepower, then let the vertex classes of the graph G be the 1-dimensional and2-dimensional subspaces, resp., of a 3-dimensional vector space over the finitefield of q elements. Connect a 1-dimensional subspace and a 2-dimensionalsubspace if and only if the latter contains the former. This graph has vertexclasses of size n = q2 + q + 1 and every vertex has degree q + 1.

2. The more general Zarankiewicz problem is to find the maximum numberof edges in a bipartite graph vertex classes V1, V2 of size m, n, resp., whichdoes not contain a Ks,t with s vertices in V1 and t vertices in V2. The Kovari–Sos–Turan theorem (Bollobas79, Chapter IV, Theorem 10) gives an upperbound of (s− 1)1/t(n− t+ 1)m1−1/t + (t− 1)m.

27