You are on page 1of 8

TECHNISCHE UNIVERSITEIT EINDHOVEN

Faculteit Wiskunde en Informatica

Eindtoets Grafentheorie en Combinatoriek (2WF61)


Woensdag 31 januari 2018, 13.30 - 16.30

Deze toets bestaat uit twee delen: Grafentheorie en Combinatoriek. Gelieve voor
deze twee delen gescheiden antwoordbladen te gebruiken, en ze gescheiden in te
leveren. Bij elk onderdeel van de toets staat tussen haakjes het maximaal aantal
punten dat behaald kan worden voor dat onderdeel. Je cijfer voor 2WF61 is het
totaal aantal behaalde punten gedeeld door 5, afgerond op 1 decimaal. Succes!

Solutions Graph Theory

Exercise 1 [11 punten]


Given is the directed graph D = (V, A) below, with capacity function c : A → Z
and s-t flow f : A → Z. Next to each arc a ∈ A, the flow f (a) and the capa-
city c(a) is given in the figure. The capacity c(a) is the number between brackets.

p 1(1) q 1(1) r

2(4) 2(2)
1(4) 1(2) 1(5)
3(8)

u 1(6)
s t
1(4) v
1(2) 0(9)
4(4) 3(3) 2(5)

w 1(1) x 2(4) y

1
(a) [4 pt] Determine an s–t flow under c of maximalum value and an s-t cut
of minimum capacity in the given network, starting from the given flow f .
Indicate which flow augmenting paths you have used. Argue why the flow
you have obtained has maximum value, and why the cut you have obtained
has minimum capacity.
Solution: After augmenting the flow on the flow-augmenting path (s, p, u, q, v, t),
the resulting flow has value 6. Because the capacity of the s-t cut δ + (U ) is
also 6, when U = {s, p, u, w}, and because the value of any s-t flow is below
the capacity of any s-t cut, it follows that the flow has maximum value and
the cut has minimum capacity.

(b) [3 pt] Prove that for an arbitrary s-t flow f in a directed graph D = (V, A),
where s, t ∈ V , it holds that
X X X X
f (a) − f (a) = f (a) − f (a)
a∈δ + (s) a∈δ − (s) a∈δ − (t) a∈δ + (t)

Solution: Let s and t be vertices of a directed graph D = (V, A). An s-t


flow is a function f : A → R+ such that for every vertex v ∈ V \ {s, t} flow
conservation holds:
X X
f (a) = f (a).
a∈δ − (v) a∈δ + (v)

Because of flow conservation in every v 6= s, t, we can add


X X
f (a) − f (a) = 0
a∈δ + (v) a∈δ − (v)

for all v ∈ V \ s, t to the expression on the left hand side and obtain
X X X X X X
f (a) − f (a) = f (a) − f (a)
a∈δ + (s) a∈δ − (s) v∈V \{t} a∈δ + (v) v∈V \{t} a∈δ − (v)

But since the contribution of any arc a = (u, v) with u, v ∈ V \{t} is canceled
in this expression, and since all arcs that leave the set V \{t} are arcs entering
the vertex t, and since all arcs entering the set V \ {t} are arcs leaving t, this
expression equals X X
f (a) − f (a),
a∈δ − (t) a∈δ + (t)

as required.

2
(c) [4 pt] Determine using Dijkstra’s algorithm the distance from s to all other
vertices in the given digraph D. Also determine a shortest-path-tree rooted
at the vertex s. Take the capacity function c (between brackets in the figure)
as the given length function. Give a table containing for each of the iterations
of the algorithm the vertex labels that are assigned in that iteration.
Solution: the shortest path tree consists of the arcs

(s, p), (s, w), (s, u), (w, x), (x, v), (v, q), (x, y), (q, r), (r, t)

Distance from s to t is 11.

Exercise 2 [6 punten]

(a) [3 pt] Find a minimum weight spanning tree in the graph G below, with
respect to the given weights of the edges. Use the Prim-Dijkstra algorithm
and start in vertex v1 = a. Your answer should consist of a list of edges
of a minimum spanning tree in the order in which they are chosen by the
Prim-Dijkstra algorithm, and it should state the total weight of this mini-
mum spanning tree explicitly.

a 1 b
8 9
3
f g
4 6
9 2
9 4
2 5
9 k 8
j 7 h
e 3 5 c
i
5 7 2

d
Solution: add edges in the following order:

({a, b}, {a, e}, {e, d}, {d, c}, {d, i}), {j, i}, {j, k}, {k, g}, {f, g}, {g, h}).

The resulting tree has weight 33

3
(b) [3 pt] Determine the vertex coloring number χ(G) of the graph G. Give a
complete argument. (For this item, you may ignore the weights of the edges.)
Solution: χ(G) ≤ 4 because the following is a correct coloring of the vertices
with 4 colors
3 2

2 3

1
4 2
2 3
3

4
Moreover, χ(G) ≥ 4 because at least three colors are needed for the odd
circuit (f, g, h, i, j, f ) and since vertex k is a neighbor of each of the vertices
in the odd circuit, it needs a fourth color.

Opgave 3 [8 punten]
Let H = (V, E) be a bipartite graph with bipartition V = U ∪ W (so every edge
of H has one endpoint in U and one endpoint in W ) and without isolated vertices.
Let |U | = n1 and |W | = n2 . It is given moreover, that every vertex u ∈ U has
degree k1 , and that every vertex w ∈ W has degree k2 , where 1 ≤ k1 < k2 .
For the following items, give a complete argument for every claim that you
make. You may refer to theorems, but in that case explicitly mention every theo-
rems you use (either by name, or by giving its complete formulation).
(a) [1 pt] Show that n1 > n2 .
k2
Solution: |E| = |U |k1 = |W |k2 , so n1 k1 = n2 k2 , so n1 = n
k1 2
> n2 (since by
assumption, k1 < k2 ).
(b) [1 pt] What is the line coloring number χ0 (H) of H?
Solution: The line coloring theorem of König claims that χ0 (G) = ∆(G) (the
max degree) in a bipartite graph G. So in this case,
χ0 (H) = k2

4
(c) [3 pt] Prove that H has a matching that covers every vertex of W .
Solution: Color the edges of H using k2 colors, such that edges that have a
vertex in common receive distinct colors. Such an edge colouring exists by
(b). Each vertex of W has degree k2 , so there is exactly one edge of each
color incident to each vertex of W . The set of edges of one colour in an edge
colouring forms a matching. So any one of the k2 > 1 colors is a matching
covering each vertex of W . In particular, such a matching exists.
Alternatively, one may use Hall’s theorem to prove the statement (see Exer-
cise 3 from Exercises Bipartite Matching). By that theorem, it suffices to
prove that for every subset X ⊆ W its set of neighbors Γ(X) satisfies

|Γ(X)| ≥ |X|.

(d) [3 pt] Determine the coclique number α(H) van H, that is, determine the
cardinality of the largest coclique (stable set) in H.
Solution: since H is bipartite, the maximum size of a matching ν(H) is by
König’s Matching theorem equal to the minimum size of a vertex cover τ (H),
and since H does not have any isolated vertices, Gallai’s theorem claims that
α(H) + τ (H) = |V |. So α(H) = |V | − τ (H) = |V | − |W | = (n1 + n2 ) − n2 =
n1 . Indeed, there is a matching covering all vertices from W by (c), and
obviously no larger matching exists, so ν(H) = τ (H) = |W |. Mentioning
Gallai’s theorem is not really necessary: it suffices to claim/argue that the
complement of a (minimum size) vertex cover is a (maximum size) coclique,
which is obvious.

5
Solutions Combinatorics

Exercise 4. [9 points]
The sequence an , n ∈ N is given by a0 = 0, a1 = 2, and the recurrence relation
an = 2an−1 − λan−2 , for n > 1.
a) [3 pt] Determine an explicit expression for an as a function of λ ∈ R (distin-
guish three cases).
Solution: The characteristic, or auxiliary equation√is r2 − 2r + λ = 0. If λ < 1,
then we find two different real solutions,√r12 = 1 ± 1 − λ and so an = Ar1n√ + Br2n ,
with A + B =√0 and A + B + (A − B) 1 − λ = 2. It follows that A = 1/ 1 − λ
and B = −1/ 1 − λ.
If λ = 1, then we find the double solution r = 1 and now the general solution is
an = (A + Bn). It follows that A = a0 = 0 and B = a1 = 2, so an = 2n. √
Finally, if λ > 1 we find two conjugate complex solutions,
√ r12 = 1 ± √ λ − 1 and
i
n n
as before we find, an =√Ar1 + Br2 , withp A = −i/ λ − 1 en B = i/ n/2
λ − 1. If we
define θ by cos θ = 1/ λ and sin θ √ = (λ − 1)/λ, we find an = λ (A cos(nθ) +
B sin(nθ)), with A = 0 and B = 2/ λ − 1.
   
0 1 0 2
In addition we define the following matrices A = and B = .
−λ 2 2 4
 
n an an+1
b) [3 pt] Show that for all n ≥ 0: A B = .
an+1 an+2
0 0
Solution: 
 We prove this by induction: For n = 0 we get
 A = Iand
 AB=B= 
a0 a1 n n−1 0 1 an−1 an
. For n > 0 we have A B = AA B =
a1 a2   −λ 2 an an+1
an an+1
and this of course is exactly .
an+1 an+2
c) [3 pt] Use (or don’t use) the result from part b) to show that for all n ≥ 0:
an+2 an − a2n+1 = −4λn .
Solution: an+2 an − a2n+1 = det(An B) = det(A)n det(B) = −4λn .
Exercise 5. [9 points]

6
To produce a certain schedule the following table has to be completed.
1, 2 3, 4 · · · 2n − 1, 2n
···
More specifically, we have to enter the numbers 1, . . . , 2n in the empty cells, two
in every cell. The order within a cell is irrelevant, the restriction is that no cell
may contain the same two numbers as the cell above. So the first empty cell may
contain the pair 1,3 (which is the same as 3,1) and also 3,5, but 1,2 is not allowed.
Let an be the number of ways to complete the schedule? (so a1 = 0 en a2 = 5).
a) [3 pt] Determine a3 and a4 .
b) [6 pt] Determine, for instance using inclusion/exclusion a formula for an .
Solution: Let V be the set of all ways to put the numbers in the schedule, where we
temporarily forget about the restriction, so |V | = (2n)!/2n : for every permutation
of 1, 2, . . . , 2n we find 2n ways that only differ in the order within a cell. De
sets we don’t want are Vi , i = 1, . . . , n, with the property that beneath the i-th
cell (with in the top row {2i − 1, 2i}) we have these two same symbols. We now
have a homogeneous inclusion/exclusion problem, with vk = |V1 ∩ V2 ∩ · · · ∩ Vk | =
(2n − 2k)!/2n−k . For the solution we find
n  
k n (2n − 2k)!
X
an = (−1) .
k=0
k 2n−k

To be on the safe side check: a1 = 2/2 − 1/1 = 0 and a2 = 4!/4 − 2 ∗ 2!/2 + 1 = 5,


also we find, as the answer to a): a3 = 6!/8 − 3 ∗ 4!/4 + 3 ∗ 2!/2 − 1 = 74 and
a4 = 8!/16 − 4 ∗ 6!/8 + 6 ∗ 4!/4 − 4 ∗ 2!/2 + 1 = 2193.
Exercise 6. [7 points]
In a certain country you can pay with coins of 1, 2, 5, or 10 florins. Let fn be the
number of ways to pay with these coints the sum of n florins, so (f0 = 1,) f1 = 1,
f2 = 2 and f3 = 2 viz. 1 + 1 + 1 = 3 of 1 + 2 = 3.
Give a closed expression of the
P form P (x)/Q(x) with P and Q polynomials for
the generating function F (x) = fn xn .
Solution: We define for each coin the generating function that tells in how many
ways you can pay n florins, when you only use these coing. One florin:
1
E(x) = 1 + x + x2 + x3 + · · · + xn + · · · = ,
1−x
since every sum can be payed in exactly one way with one-florin coins. Two:
1
D(x) = 1 + x2 + x4 + · · · + x2n + · · · = ,
1 − x2

7
since only even amounts can be payed using just doubloons (two-florin coins). Five
and ten:
1 1
V (x) = 5
, T (x) = .
1−x 1 − x10
For the generating function F (x) we find, as was explained in the lecture:
1
F (x) = E(x)D(x)V (x)T (x) = .
(1 − x)(1 − x2 )(1 − x5 )(1 − x10 )

You might also like