Graph Theory
Chapter 7
Eulerian Graphs
大葉大學(Da-Yeh Univ.)
資訊工程系(Dept. CSIE)
黃鈴玲(Lingling Huang)
Outline
7.1 An Introduction to Eulerian
Graphs
7.2 Characterizing Eulerian Graphs
Again
7.3 The Chinese Postman Problem
Ch7-2
Copyright 黃鈴玲
7.1 An Introduction to
Eulerian Graphs
1736, Euler solved the Königsberg Bridge
Problem (七橋問題)
Q: 是否存在一
種走法,可以走
過每座橋一次,
並回到起點?
Ch7-3
Copyright 黃鈴玲
Königsberg Bridge Problem
陸地為點
C
A
D
橋為邊
B
Q: 是否存在一種走法,可以走過每條邊一次,並回
到起點?
Ans:
因為每次經過一個點,都需要從一條邊進入該點,再用另
一條邊離開,所以經過每個點一次要使用掉一對邊。
每個點上連接的邊數必須是偶數才行
此種走法不存在
Ch7-4
Copyright 黃鈴玲
Definition:
(1) An eulerian circuit of a connected
multigraph is a circuit (點可重複、邊不可重複)
of G that contains all the edges of G.
(2) A (multi)graph with an eulerian circuit is
called an eulerian (multi)graph.
(3) An eulerian trail of a connected multigraph
G is an open trail (起點終點不同的trail) of G
that contains all the edges of G.
Ch7-5
Copyright 黃鈴玲
u9
u8
u2
G1
u3
v1
G2
v2
u1
u4
u7
u5
u6
v6
v3
v5
v4
eulerian circuit:
eulerian trail:
Ch7-6
Copyright 黃鈴玲
Theorem 7.1:
A connected multigraph G is eulerian if
and only if the degree of each vertex is
even.
Pf: ()
G is eulerian eulerian circuit C
C 通過每一點時需用一條邊進入,用另一條邊離開
the degree of each vertex is even
()
Suppose every vertex of G is even.
(Now we construct an eulerian circuit.)
Ch7-7
Copyright 黃鈴玲
Choose any vertex v and begin a trail T (邊不
可重複) at v as far as possible.
If w is the last vertex of T, then any edge
incident with w must belong to T.
Claim: w=v
Pf. If wv, then each time w is encountered on
T before the last time, one edge is used to
enter w and another edge is used to exit
from w.
Since w has even degree. There must be at
least one edge incident with w that does not
belong to T, a contradiction.
If E(T) E(G), 在G-T中重複此法找出一個個的
circuit,連接起來即可得eulerian circuit.
Ch7-8
Copyright 黃鈴玲
Figure 7.4
(Algorithm 7.1, Eulerian circuit)
Step 1:
T1: v1, v2, v3, v4, v5, v1
v2
v1
v5
v3
v6
v4
Step 2:
T2: v3, v5, v6, v3
Step 3:
C = T1 T2
C: v1, v2, v3, v5, v6, v3, v4, v5, v1
T2
Ch7-9
Copyright 黃鈴玲
Theorem 7.2:
Let G be a nontrivial connected
multigraph. Then G contains an
eulerian trail if and only if G has
exactly two odd vertices.
Furthermore, the trail begins at one of
the odd vertices and terminates at the
other.
Ch7-10
Copyright 黃鈴玲
Homework
Exercise 7.1:
1, 2
Ch7-11
Copyright 黃鈴玲
Outline
7.1 An Introduction to Eulerian
Graphs
7.2 Characterizing Eulerian Graphs
Again
7.3 The Chinese Postman Problem
Ch7-12
Copyright 黃鈴玲
7.2 Characterizing
Eulerian Graphs Again
Theorem 7.3:
A connected graph G is eulerian if and only if
every edge of G lies on an odd number of
cycles of G.
Ch7-13
Copyright 黃鈴玲
Example (Figure 7.5)
Consider the edge uv,
it belongs to five cycles:
z
C1: u, v, x, u
x
u
y
v
a
w
C2: u, v, y, x, u
b
C3: u, v, y, z, x, u
C4: u, v, w, y, z, x, u
C5: u, v, w, y, x, u
Ch7-14
Copyright 黃鈴玲
Homework
Exercise 7.2: 4(a)
Ex4(a). Show that each edge of Kn belongs to
at least 2n-2 -1 cycles.
5 - 2 3
C3: 1 1 3 個
Example: K5
5 - 2 3
3 個
C4:
2 2
5 - 2 3
C5:
1 個
3 3
n - 2 n - 2 n - 2
n - 2
2 n - 2 - 1
1 2 3
n - 2
Ch7-15
Copyright 黃鈴玲
Outline
7.1 An Introduction to Eulerian
Graphs
7.2 Characterizing Eulerian Graphs
Again
7.3 The Chinese Postman Problem
Ch7-16
Copyright 黃鈴玲
7.3 The Chinese Postman
Problem
Chinese Postman Problem:
Suppose that a letter carrier must deliver mail
to every house in a small town. The carrier
would like to cover the route in the most
efficient way and then return to the post office.
Definition:
For a connected graph G, an eulerian walk is a
shortest closed walk covering all the edges of G.
finding an eulerian walk
Ch7-17
Copyright 黃鈴玲
An alternative way to solve the Chinese Postman
Problem:
For a given connected graph G, determine an
eulerian multigraph H of minimum size that
contains G as its underlying graph.
e. g., 將圖形G中的每個edge都複製一份
每點degree都會是偶數
新圖有eulerian circuit存在
the length of an eulerian walk of G
is at least q but no more than 2q.
Ch7-18
Copyright 黃鈴玲
If G is not eulerian, then G contains an even
number of odd vertices.
Let V0(G) = {u1, u2, …, u2n}, n 1,
be the set of odd vertices of G.
Definition:
A pair partition of V0(G) is a partition of V0(G) into
n two-element subsets. For a pair partition p,
given by p={{u11, u12}, {u21, u22}, …, {un1, un2}}.
n
Let us define
d (p ) d (ui1 , ui 2 )
i 1
and let m(G) = min { d(p) | p is a pair partition }.
Ch7-19
Copyright 黃鈴玲
m(G )代表的是eulerian walk中重複走的邊數
If G is eulerian, then m(G ) = 0.
Theorem 7.4
If G is a connected graph of size q, then an
eulerian walk of G has length q + m(G).
※ How to find an eulerian walk of G?
(1) Find a pair partition p with d(p) = m(G).
(2) If p={{u11, u12}, {u21, u22}, …, {un1, un2}},
determine shortest ui1- ui2 paths Qi.
(3) duplicate the edges of G that are on Qi.
(4) An eulerian circuit in the new graph provides
an eulerian walk of G.
Ch7-20
Copyright 黃鈴玲
※ How to find a pair partition p of
V0(G) for which m(G)=d(p)?
(1) Construct a complete weighted graph
F K2n of order 2n, where V(F) = V0(G),
the weight of an edge in F is defined as
the distance between the corresponding
vertices in G.
(2) Determine a perfect matching of F whose
weight is as small as possible.
(Let m be the maximum weight of F.
將F中每邊的weight w 改為m+1-w,
find a maximum matching 即可)
Ch7-21
Copyright 黃鈴玲
Example (Fig 7.6, solving the Chinese
Postman Problem)
(1) Find odd vertices
u1
u4
u2
v4
v1
v2
(3) Graph F’:
Max matching
4
1 2
u4
u2
1
u4
2
3 2
3
u3
(4) add Qi:
u4
u1
u2
v4
v1
2 3
u3
u2
4 3
u3
v3
u1
(2) Graph F: u1
v3
u3
v2
Ch7-22
Copyright 黃鈴玲
(5) Eulerian walk:
e1 u4
v4
e3
e2
e4
v3 e
7
e13
u1
e10
e12
e6
e5
v2
e8
u2
e11
v1
e9
u3
u1,e12, u2, e10, v3, e3, v4, e1, u4, e2, v4, e4, v3,
e7, v2, e8, u3, e5, v3, e6, u3, e9, v1, e11, u2, e13, u1
Ch7-23
Copyright 黃鈴玲
Homework
Exercise 7.3:
1, 3
Ex1. Prove that the length of an eulerian walk
for a tree of size q is 2q.
Ch7-24
Copyright 黃鈴玲
© Copyright 2026 Paperzz