1comb Lecture6 Trees
1comb Lecture6 Trees
Trees
EX) Imagine that there is a network, and want to send a message to all people.
Suppose that sending a message costs 100 won.
How can we send a message with smallest cost?
So, a solution would be a tree connecting all vertices with minimum cost.
(This is called a ‘spanning tree’)
We will study the several characterizations of trees.
(1) G is a tree.
(2) (Unique path) For every two vertices x, y in G, there is a unique path from x to y.
(3) (Minimal connected) G is connected, and deleting any edge makes disconnected.
(4) (Maximal graph without cycle)
G contains no cycles, and any graph obtained by adding an edge contains a cycle.
(5) G is connected and | V(G) | = | E(G) | + 1.
We will use two lemmas. A vertex of degree 1 is called a leaf.
[Lemma 5.1.3] Every tree G with at least two vertices contains at least two leaves.
(1) G is a tree.
(2) (Unique path) For every two vertices x, y in G, there is a unique path from x to y.
(3) (Minimal connected) G is connected, and deleting any edge makes disconnected.
(4) (Maximal graph without cycle)
G contains no cycles, and any graph obtained by adding an edge contains a cycle.
(5) G is connected and | V(G) | = | E(G) | + 1.
(1)->(5)->(1)
(1) G is a tree.
(2) (Unique path) For every two vertices x, y in G, there is a unique path from x to y.
(1)->(2)
Let x, y be two vertices. Suppose there are two distinct paths P, Q from x to y.
Let P = a1a2⋯an and Q = b1b2⋯bm with a1 = b1 = x.
Let i be the minimum integer such that bi ∈ V(P) but bi+1 ∉ V(P).
Let j > i be the minimum integer such that bj ∈ V(P).
Such an integer exists as bm ∈ V(Q).
∑
For A ⊆ E(G), w(A) = w(e) is called the weight of A.
e∈A
For a subgraph F of G, we denote by w(F) = w(E(F)).
A spanning tree T of G
is called a minimum spanning tree if its weight w(T) is minimum.
History :
See [On the history of the minimum spanning tree problem, Graham, Hell 1985]
for more history.
Kruskal’s greedy algorithm:
T←∅
for k = 1 to m
if ek does not form a cycle together with some edges of T,
then append ek to T
We claim that there exists an edge e ∈ E*∖E′ such that (V, E′ ∪ {e}) is still a forest.
We claim that there exists an edge e ∈ E*∖E′ such that (V, E′ ∪ {e}) is still a forest.
They are called ‘running time / time complexity’ and ‘space complexity’.