Eulerian Assignmen
Eulerian Assignmen
Assignment #3 solutions
(1) Prove or disprove: Every Eulerian graph in which the degree of
every vertex is at least 3 is Hamiltonian.
Solution. This is false: take K4,6 . This graph is Eulerian since
every vertex has an even degree. The degree of each vertex is
eiher 4 or 6. It is not Hamiltonian, since every cycle has to
visit each of the two components of a bipartite graph the same
number of times.
(2) Is there a graph with a bridge in which every vertex has an even
degree? Prove your claim.
Solution. There is no such graph. Assume otherwise, let G
be a graph with a bridge e in which every vertex has an even
degree. Then G − e is not connected, and it has two components
(corresponding to the two vertices, v and w, incident with e).
Let H be the component containing v. In it the degree of v is
odd (being one less than the degree of v in G), and the degree
of any other vertex is even. This contradicts the Handshaking
Lemma.
(3) Find the shortest path from a to each of the other vertices in
the weighted graph of the figure below. Draw a spanning tree
rooted at a with smallest weight.
6 2
•a ❅ •b ❅ •c
❅❅ ❅❅
❅❅ 1 ❅❅ 4
2 ❅❅ 3 ❅❅ 1
❅❅ ❅❅
❅ ❅
5 7
•d •e •f
⑦⑦ ⑦⑦
⑦⑦⑦ ⑦⑦⑦
3 ⑦⑦ 8 ⑦⑦ 1
⑦ 4 ⑦ 2
⑦⑦ 3 ⑦⑦
2
•g •h •i
Solution. This one was straightforward - apply the ‘shortest
path algorithm’ first. One obtains the shortest path a-e-b-c-f-i.
Since we followed the algorithm, the obtain path is the shortest
possible.
(Note that it was required to provide all details. The details
are straightforward, and I did not have time to write them down.
If you are unsure about filling in the details and would like to
see a detailed solution, please let me know.)
To find the spanning tree of the minimal weight, apply the
‘greedy algorithm’ from §3.3. There are several correct solutions.
1
2
It was not required to find all of them. All of them are subtrees
of the following subgraph (it was not required to find this graph
either).
2
•a ❅ •b •c
❅❅
❅❅ 1
2 ❅❅ 3 1
❅❅
❅
•d •e •f
⑦
⑦⑦⑦
3 ⑦⑦ 1
⑦⑦⑦ 2
⑦
3 2
•g •h •i
Here are some of the spanning trees of minimal weight
2
•a ❅ •b •c
❅❅
❅❅ 1
2 ❅❅ 3 1
❅❅
❅
•d •e •f
⑦⑦
⑦⑦⑦
3 ⑦ 1
⑦⑦ 2
⑦⑦
•g •h •i
or
2
•a ❅ •b •c
❅❅
❅❅ 1
2 ❅❅ 3 1
❅❅
❅
•d •e •f
3 1
2
•g •h •i
or
2
•a ❅ •b •c
❅❅
❅❅ 1
2 ❅❅ 3 1
❅❅
❅
•d •e •f
⑦⑦
⑦⑦⑦
⑦ 1
⑦⑦⑦ 2
⑦
3
•g •h •i
and so on.
3
1At this point you may notice a legit minor improvement to the greedy algorithm. Suppose
that at any stage there are several edges that (i) haven’t been chosen yet (ii) they all have the
same weight (iii) this weight is minimal possible among the edges not chosen so far, and (iv) these
edges, together with the edges chosen so far, do not form a cycle. Then one can choose all of these
edges and add them to the spanning tree.
4
1 2
F G H
At this point, we move on to edges of the next smallest weight,
which is 3. The only edge of weight 3 is CF. After choosing it,
we obtain the spanning tree of minimal weight:
A B❅
❅❅
❅❅ 2
1 ❅❅
❅❅
❅
2
C❅ D E .
❅❅
❅❅ 3
❅❅ 2
❅❅
❅
1 2
F G H
Since we followed the greedy algorithm, either of the resulting
trees is a spanning tree of the minimal possible weight.