PROBLEM 1)
Dijkstra’s algorithm for directed graph is like the one without directions.
The only difference is that a neighbor of a vertex v is now a vertex to which
one can go by an edge in the same direction as where one goes from v.
By running this algorithm we get the following matrix M , where Mij is the
minimal length path from i to j.
0 5 20
13 0 15
25 17 0
15 12 8
10 15 25
24 7
25 14
10 30
0 22
17 0
1
PROLBEM 2)
Take the 3-cycle with edge weights 1, 1 and −1.
Dijkstra’s algorithm runs as follows:
If we call the rightmost vertex in the second step v, then something in the
proof is wrong. In this case P is the edge uv and Q must be the u, v-path
via the upper vertex, which must be v 0 . Now w(Q) = 0 but w(uQv 0 ) = 1.
So the unequility is wrong.
2
PROBLEM 3)
Krustal’s algorithms says that we can find a minimum weights spanning
three, because we have a weighted connected graph. Assume that T1 and
T2 are different MWS-trees (minimum weight spanning trees).
Let e1 , e2 , ..., en be the edges in T1 − T2 in order from low to high weights.
Let e01 , e02 , ..., e0n be the edges in T2 − T1 in order from low to high weights.
If we add e01 to T1 , then we can remove some ei s.t. the remaining graph is
still a tree (replacement property).
It must hold that w(e01 ) ≥ w(ei ) because otherwise the remaining graph
would have lower total weight than T1 was, while T1 had already a minimum total weight. And w(ei ) ≥ w(e1 ).
In the same way it holds that w(e1 ) ≥ w(e0i ) ≥ w(e01 ). So w(e1 ) = w(e01 ).
But e1 6= e01 so this is a contradiction with the fact that all edges of G have
distinct weights.
3
PROBLEM 4)
We use observation 2.1. If M 0 also saturates S, we are done, because we
can repeat making new matchings being the symmetric difference between
the previous matching and an augmenting path. This goes on until we have
no augmenting paths anymore to make. Then by theorem 2.3 we have a
maximum matching, and this saturates S.
The edges from M which are not in M 0 are all in E(P ). Let xy be an edge
in E(P )∩M . Let p be the vertex in E(P ) which is the other neighbor vertex
of x and let q be the other neighbor vertex of y. Then x is saturated by
M 0 , because M 0 has the edge px for it, and similarly it has yq to saturate
y. So the fact that some edges from M are not in M 0 does not matter, M 0
saturates S.
It is not true that every maximum matching saturates S. Problem 8 states
that there is a 3-regular graph with no perfect matching, i.e. a matching
which does not saturate every vertex. Then there is also a maximum matching which does not saturate a vertex, say v. We can define a matching
which has only one edge, with endvertex v. Now we have a counterexample.
We come back to problem 8 later.
4
PROBLEM 5)
We make the asked matching as follows. First we pick all the edges from M
with an endvertex in S and call this set of edges N . We define T̃ being all
vertices of T not saturated by N . If this set is empty, we are done, so we
can assume it is not empty.
We unite N with all edges from M 0 which go from T̃ to X − S. We define
this union by N 0 . If there are no edges in M 0 going from T̃ to S, we are
done, because then N 0 is a matching saturating S ∪ T . So we can assume
that there are edges going from T̃ to S.
Let t̃s be such a vertex and define N 00 := N 0 ∪ {t̃s}. Then s has degree 2 in
(V, N 00 ) because there is also an edge in N with endvertex s and that edge
cannot have t̃ as endvertex by definition of T̃ . Since this edge goes from s
to T − T̃ , we can define a longest path P from s to say q, whose vertices
alternate between S and T − T̃ and whose edges alternate between M and
M 0 . If q is in S, then there is no edge in M with endvertex q to a vertex in
T − T̃ . Because if there would be one, and it is a vertex in V (P ) ∩ (T − T̃ )
then we have two different edges from M with a same endvertex in T − T̃ ,
contradicting that M is a matching, and if it is a vertex in (T − T̃ ) − V (P )
then we contradict the definition of P . Similarly, if q is a vertex in T − T̃ ,
then there is no edge with endvertex q from M 0 to a vertex in S.
Let e be an edge from q through M or M 0 if q is in S resp. T . We define N 000
being the symmetric difference between N 00 and V (P ), and then e added.
This is a matching (obs. 2.1) saturating T − T̃ , S, t̃ and all vertices in T̃
going to X − S through M 0 . We call this matching M (t̃).
We claim that the union of all matchings of the form M (t̃) − N over t̃ ∈ T̃
is a matching. If this is so, we obtain the asked matching by adding all the
edges from N which are not in the paths P constructed for all the M (t̃).
Let t̃1 , t̃2 be different vertices from T̃ to s1 resp. s2 in S. Get the alternating paths B1 resp. B2 between S and T as in the algorithm above, but
now to make M (t̃1 ) resp. M (t̃2 ). Let e1 resp. e2 be the edges as e in the
algorithm above, but now for M (t̃1 ) resp. M (t̃2 ).
We will show the claim by showing that t̃1 s1 B1 e1 and t̃2 s2 B2 e2 have no
vertices in common. Assume that x is the first vertex in common. By
5
definition this is not t̃1 (and t̃2 ). We know that x is saturated by M and
M 0 . By definition of a matching we have that the edge before x which lies in
t̃1 s1 B1 e1 and the edge before x which lies in t̃2 s2 B2 e2 are the same, because
they both lie in M or both lie in M 0 , and M, M 0 are matchings. Here we see
t̃1 and t̃2 as ’start’ vertices of t̃1 s1 B1 e1 and t̃2 s2 B2 e2 so that we can use the
words ’edge before x’. So the vertex before x is also a vertex in common.
By the choice of x, this is a contradiction.
6
PROBLEM 7)
Remark: If some Ai is infinite, then |cupi Ai | = ∞ ≥ |S|. Let Y = N,
A1 = N and Ai = {1} for the other i. We cannot find distinct elements as in
this problem. So it is time to cheat, i.e. we assume that all Ai have |Ai | < ∞.
We translate the problem into graph language as follows. We make a bipartite graph with m vertices corresponding to 1, 2, ..., m. They together
are class X. Let Y as in the problem correspond to the other class of the
bipartite graph. We let this graph have the property that vertex i ∈ X has
neighborhood Ai for all i. This graph having a matching saturating X is
having distinct elements as in the problem.
Let S ∈ {1, 2, ..., m} be arbitrary. The neighborhood of S ⊆ X is ∪i∈S Ai .
So | ∪i∈S Ai | ≥ |S| ∀S iff our graph has a matching saturating X (Hall).
Done.
7
PROBLEM 8)
Remark: if the degree is zero, then the statement of the problem is not true.
Let G = (V, E) be a regular bipartite graph with degree d ≥ 1. Let X, Y ⊆ V
be the two classes of it.
We claim that |X| = |Y |. From the definition of a bipartite graph we know
that each edge goes from X to Y , or we can also say from Y to X. So the
number of edges from X to Y is equal to the number of edges from Y to X.
If |X| > |Y |, then there are |X|d edges going from X to Y , which is more
than |Y |d, the number of edges from Y to X. This is a contradiction.
So if there is a matching saturating X, then this matching is perfect.
It suffices to show that |NG (S)| ≥ |S| ∀S ⊆ X (Hall).
Assume that for some S it holds that |NG (S)| < |S|.
There are exactly |S|d edges going from S, and they all arrive at NG (S).
So there are ≥ |S|d edges going from NG (S). But since |NG (S)| < |S| and
there are exactly |NG (S)|d going from NG (S), there are < d|S| edges going
from NG (S). This is a contradiction.
Example of a graph of degree 3 without perfect matching:
8
© Copyright 2026 Paperzz