• No results found

Definition. A tree is a connected graph containing no cycle

In document Invitation to Discrete Mathematics (Page 172-177)

Graphs: an introduction

5.1 Definition and characterizations of trees

5.1.1 Definition. A tree is a connected graph containing no cycle

Don’t worry if your definition doesn’t match ours. A tree can be defined in several rather different ways. Soon we will give even four more equivalent definitions.

Why should one define a tree in several different ways? First of all, the definition just given is somewhat unsuitable from several points of view. For instance, it is not clear from it how we can check whether a given graph is a tree or not. The connectedness can be verified by a simple algorithm, but deciding the existence of a cycle seems to be a problem. The alternative descriptions given below give very straight-forward algorithmic ways of recognizing trees, and they tell us several interesting properties of trees which may be useful in applications.

Second, while a proof of the equivalence of the various definitions is probably not very exciting reading, it provides good exercise mate-rial for students’ own proofs (according to our experience). The various implications in the proof are not formidably difficult, but they are not completely easy either, and a student trying to prove one such implica-tion has plenty of opportunities to make and discover errors or gaps in the proof. The proof given below also illustrates how one can proceed in proving the equivalence of several statements.

Third, the equivalent characterizations of trees below are simple but they show samples of “good” characterizations of a mathematical object one should look for; difficult major theorems in several areas have a formally similar pattern.

Here are the promised equivalent definitions of a tree. The most remarkable of them is perhaps the one saying that among connected graphs, a tree can be recognized simply by counting its edges and vertices.

5.1.2 Theorem (Tree characterizations). The following condi-tions are all equivalent for a graph G = (V, E):

(i) G is a tree.

(ii) (Path uniqueness)

For every two vertices x, y ∈ V , there exists exactly one path from x to y.

(iii) (Minimal connected graph)

The graph G is connected, and deleting any of its edges gives rise to a disconnected graph.

5.1 Definition and characterizations of trees 155 (iv) (Maximal graph without cycles)

The graph G contains no cycle, and any graph arising from G by adding an edge (i.e. a graph of the form G+e, where e∈V

2

\E) already contains a cycle.

(v) (Euler’s formula)

G is connected and |V | = |E| + 1.

Note that this theorem not only describes various properties of trees, such as “any tree on n vertices has n− 1 edges”, but also lists properties equivalent to Definition 5.1.1, so for instance it says “A graph on n vertices is a tree if and only if it is connected and has n− 1 edges”.

Proving equivalences of various pairs of statements in Theorem 5.1.2 seems far from trivial for beginners, and all sorts of shortcomings ap-pear in attempts at such proofs. Here is a (hypothetical) example. Con-sider the following implication: “If G is a tree, then any two vertices of G can be connected by exactly one path.” Most people quickly no-tice that since G is connected, any two verno-tices can be connected by at least one path. Then, if the proof is being created from the inter-action of a student with the teacher, dialog of the following sort often develops:

S.: “We proceed by contradiction. If u and v are two vertices in G that can be connected by two different paths, then G contains a cycle.

Hence the implication holds.”

T.: “But why must there be a cycle in G if u and v are connected by two distinct paths?”

S.: “Well, the two paths together contain a cycle.”

For the teacher, this is not at all easy to argue with, in particular because it’s true and, moreover, “obvious from a picture”.

T: “But why? Can you prove it rigorously? In your picture, there is indeed a cycle, and I can’t show you a graph with no cycle and with two paths between u and v either, but isn’t it possible that some extraterrestrians, much more clever than me and you and all other people together, can construct such a graph?”

(Suggestions of didactically more convincing ways of arguing are wel-come.) In fact, a rigorous proof is not entirely trivial, but it seems that the message most difficult to get through is that there really is some-thing to prove. As you will see, in our proof of Theorem 5.1.2 below we preferred to avoid this direct argument.

We now begin with the proof of Theorem 5.1.2. Since there are many implications to prove, it is important to organize the proof suitably. The basic idea in all steps is to proceed by induction on the number of vertices of the considered graph, and to “tear off”

a vertex of degree 1 in the inductive step. In a few simple lemmas below, we prepare the ground for this method.

Let us call a vertex of degree 1 in a graph G an end-vertex of G or a leaf of G. We begin with the following almost obvious observation:

5.1.3 Lemma (End-vertex lemma). Each tree with at least 2 ver-tices contains at least 2 end-verver-tices.

Proof. Let P = (v0, e1, v1, . . . , et, vt) be a path of the maximum possible length in a tree T = (V, E). Clearly the length of the path P is at least 1, and so in particular v0 = vt. We claim that both v0

and vt are end-vertices. This can be shown by contradiction: if, for example, v0is not an end-vertex, then there exists an edge e ={v0, v} containing the vertex v0and different from the first edge e1 ={v0, v1} of the path P . Then either v is one of the vertices of the path P , i.e.

v = vi, i≥ 2 (in this case the edge e together with the portion of the path P from v0 to vi form a cycle), or v∈ {v0, . . . , vt}—in that case we could extend P by adding the edge e. In both cases we thus

get a contradiction. 2

Let us remark that the end-vertex lemma does not hold for infinite trees (the proof just given fails because a path of the maximum length need not exist). For instance, the “one-sided infinite path” has only one end-vertex

. . .

and the “two-sided infinite path” has none:

. . . . . .

We only consider finite graphs here, however.

Next, we recall a notation from Section 4.6: if G = (V, E) is a graph and v is a vertex of G, then G− v stands for the graph arising from G by deleting the vertex v and all edges containing it. In case v is an end-vertex of a tree T , the graph T− v arises by deleting the vertex v and the single edge containing v.

5.1.4 Lemma (Tree-growing lemma). The following two state-ments are equivalent for a graph G and its end-vertex v:

(i) G is a tree (ii) G− v is a tree.

5.1 Definition and characterizations of trees 157 Proof. This is also quite easy. First we prove the implication (i)⇒ (ii).

The graph G is a tree, and we want to prove that G− v is a tree as well. Consider two vertices x, y of G−v. Since G is connected, x and y are connected by a path in G. This path cannot contain a vertex of degree 1 different from both x and y, and so it doesn’t contain v.

Therefore it is completely contained in G− v, and we conclude that G− v is connected. Since G has no cycle, obviously G − v cannot contain a cycle, and thus it is a tree.

It remains to prove the implication (ii)⇒ (i). Let G − v be a tree.

By adding the end-vertex v back to it, no cycle can be created. We must also check the connectedness of G, but this is obvious too: any two vertices distinct from v were connected already in G− v, and a path to v from any other vertex x is obtained by considering the (single) neighbor v of v in G, connecting it to x by a path in G− v, and extending this path by the edge {v, v}. 2 This lemma allows us to reduce a given tree to smaller and smaller trees by removing end-vertices successively. Now we are going to apply this device.

Proof of Theorem 5.1.2. We prove that each of the statements (ii)–(v) is equivalent to (i). This, of course, proves the mutual equiva-lence of all the statements. The proofs go by induction on the number of vertices of G using the tree-growing lemma 5.1.4. As for the in-duction basis, we note that all the statements are valid for the graph with a single vertex.

First let us see that (i) implies all of (ii)–(v). To this end, let G be a tree with at least 2 vertices, let v be one of its end-vertices, and let v be the single neighbor of v in G. Suppose that the graph G− v already satisfies (ii)–(v); this is our inductive hypothesis.

In this situation, the validity of (ii), (iii), and (v) for G can be considered obvious (we leave a detailed argument to the reader).

As for (iv), we do not even need the inductive hypothesis for G−v.

Since G is connected, any two vertices x, y∈ V (G) can be connected by a path, and if {x, y} ∈ E(G) then the edge {x, y} together with the just-mentioned path creates a cycle. This proves the implication (i)⇒ (iv).

Let us now prove that each of the conditions (ii)–(v) implies (i).

In (ii) and (iii) we already assume connectedness. Moreover, a graph satisfying (ii) or (iii) cannot contain a cycle. For (ii), this is because two vertices in a cycle can be connected by two distinct paths, and

for (iii), the reason is that by omitting an edge in a cycle we obtain a connected graph. Thus we have already proved the equivalence of (i)–(iii).

In order to verify the implication (iv)⇒(i), it suffices to check that G is connected. For this, we can use the argument by which we have proved (i)⇒(iv) turned upside down. If x, y ∈ V (G) are two vertices, either they are connected by an edge, or the graph G+{x, y}

contains a cycle, and removing the edge {x, y} from this cycle gives a path from x to y in G.

Finally the implication (v)⇒(i) is again proved by induction on the number of vertices. Let us consider a connected graph G satisfy-ing |V | = |E| + 1 ≥ 2. The sum of the degrees of all vertices is thus 2|V | − 2 (why?). This means that not all vertices can have degree 2 or larger, and since all the degrees are at least 1 (by connectedness!), there exists a vertex v of degree exactly 1, i.e. an end-vertex of the graph G. The graph G = G− v is again connected and it satisfies

|V (G)| = |E(G)| + 1. Hence it is a tree by the inductive hypothesis,

and thus G is a tree as well. 2

Exercises

1. Draw all trees with vertex set {1, 2, 3, 4}, and all pairwise noniso-morphic trees on 6 vertices.

2. Prove that any graph G = (V, E) having no cycles and satisfying

|V | = |E| + 1 is a tree.

3. Let n≥ 3. Prove that a graph G on n vertices is a tree if and only if it is not isomorphic to Kn and adding any edge (on the same vertex set) not present in G creates exactly one cycle.

4. Prove that a graph on n vertices with c components has at least n− c edges.

5. Suppose that a tree contains a vertex of degree k. Show that it has at least k end-vertices.

6. Let T be a tree with n vertices, n≥ 2. For a positive integer i, let pi

be the number of vertices of T of degree i. Prove p1− p3− 2p4− · · · − (n − 3)pn−1= 2.

(This provides an alternative proof of the end-vertex lemma.)

7. King Uxamhwiashurh had 4 sons, 10 of his male descendants had 3 sons each, 15 had 2 sons, and all others died childless. How many male descendants did King Uxamhwiashurh have?

In document Invitation to Discrete Mathematics (Page 172-177)