1 Number Theory and

Chapter 7

Graph properties

By

A. Satyanarayana Reddy

Department of Mathematics Shiv Nadar University Uttar Pradesh, India

E-mail: [email protected] 2

Module-1: Trees

Objectives

• Properties of trees

• Spanning trees of a connected graph

• Minimal spanning trees

Recall that a graph with no cycles is called acyclic. An acyclic graph is called a forest. A forest having only one is called a , i.e., a tree is a connected acyclic graph. A tree T with only one is called a trivial tree and is called non trivial, otherwise. The following are 6 non isomorphic trees on 6 vertices. 3

number of number of number of number of vertices non isomorphic trees vertices non isomorphic trees 1 1 9 47 2 1 10 106 3 1 11 235 4 2 12 551 5 3 13 1301 6 6 14 3159 7 11 15 7741 8 23 16 19320

Theorem 1. Let X be a simple graph on n vertices. Then, the following statements are equivalent.

1. X is a tree (connected acyclic graph).

2. There is a unique path between any two vertices of X.

3. X is connected and has exactly n − 1 edges.

4. X contains no cycles and has n − 1 edges.

5. X is minimally connected, i.e., every edge is a bridge.

Proof. 1 ⇒ 2 Let X be a tree. Then, X is connected and there is a path between any two vertices. Suppose there exists at least two distinct paths between a pair of vertices, say u,v ∈ V(X). Then, the union of these two paths produces a . A contradiction. 2 ⇒ 1 Let X be a graph with a unique path between any two vertices. Then, clearly X is connected. On the contrary assume that there is a cycle in the graph. Then, there exists at least two vertices on this cycle that have two distinct paths between them. Hence, a contradiction. 4

2 ⇒ 3 Let X be a connected graph with a unique path between any two vertices, then clearly X is connected. We will show that X has n − 1 edges by induction on n, the number of vertices. The result is clearly true if n = 1,2,3. Now, assume that the result is true for all graphs containing less than k vertices and let X be a graph with k vertices. Since there is a unique path between any two vertices, if we remove any edge e from the graph X, then X \{e} has k vertices, but has two

connected components, say X1 and X2 with vertices k1 ≥ 1 and k2 ≥, respectively, with k1 + k2 = k.

Thus, by induction X1 and X2 contain k1 − 1 and k2 − 1 edges, respectively. Thus, the number of

edges in X is (k1 − 1) + (k2 − 1) + 1 = k − 1. 3 ⇒ 4 Suppose X is connected and has exactly n − 1 edges. We have to show that X has no cycles. On the contrary assume that X has at least one cycle. Then, if we delete any edge from the cycle, the new graph is still connected and hence it has at least n −1 edges (see Corollary ??). Thus, we arrive at a contradiction. 4 ⇒ 5 Suppose X has k components. We show that k = 1. Since X is acyclic, each component is acyclic. That is, each component is a tree and hence (use 1 ⇔ 2 ⇒ 3) X contains n − k edges. Thus, k = 1 and therefore, X is a tree. Hence, there is a unique path between any two vertices in X (use 1 ⇔ 2). Hence, every edge is bridge. 5 ⇒ 1 Let X be minimally connected. Then, X is connected and there exists a unique path between any two vertices. Thus, X it tree (use 1 ⇔ 2).

Corollary 2. Every non trivial tree contains at least two vertices of degree 1.

Proof. Let T be a tree on n vertices and let (d1,d2,...,dn) be the degree sequence of T. Then, using n First Theorem on Graph Theory, we get ∑ di = 2n − 2. Now, let ` be the number of vertices of i=1 degree 1 in the T. Then, the degree of the other vertices is at least 2. Hence,

2n − 2 = ∑ di + ` ≥ 2(n − `) + `. di>1 Therefore, ` ≥ 2. 5

Note that the path graphs have exactly two pendant vertices whereas the star graph on n vertices has n − 1 pendant vertices.

Theorem 3. Let X be a connected graph with degree sequence (d1,d2,...,dn). Then, X is a tree if n and only if ∑ di = 2n − 2. i=1 n Proof. If X is a tree then using First Theorem on Graph Theory, we see that ∑ di = 2n − 2. i=1 n Conversely, assume that ∑ di = 2n − 2. Then, we prove the result by induction on n. If n = 2, i=1 then d1 +d2 = 2 and since X is connected, one has d1,d2 ≥ 1. Thus, d1 = d2 = 1 and hence X = K2, a tree. So, let us assume that the result is true for all connected graphs on n = k ≥ 3 vertices. Now, consider a connected graph X on n = k + 1 vertices with degree of vertices as d1 ≥ d2 ≥ ··· ≥ k+1 dk ≥ dk+1. Then, by assumption, ∑ di = 2(k + 1) − 2. As di ≥ di+1, for each i = 1,2,...,k, one i=1 concludes that d1 ≥ 2 and dk = dk+1 = 1. Let u be the vertex with deg(u) = dk+1. As u is a pendant vertex, it is adjacent to a unique vertex, say v, with deg(v) = d`. Note that d` ≥ 2 as the graph is connected and k ≥ 3. So, now consider the graph Y = X \{u}. This graph is a connected graph on

k vertices with degree of its vertices being d1,...,d`−1,d` − 1,d`+1,...,dk. Also, note that

k+1 d1 + ··· + d`−1 + (d` − 1) + d`+1 + ··· + dk = ∑ di − 1 − dk+1 = 2(k + 1) − 2 − 2 = 2k − 2. i=1 Hence, by the induction hypothesis, the graph Y represents a tree. Thus, the graph X is indeed a tree on k + 1 vertices.

Theorem 4. Every tree is a bipartite graph.

Proof. As we know, a graph is bipartite if and only if every cycle in it is of even length. And a tree has no cycles, hence every cycle in a tree of even(zero) length. true. Alternate proof

Let T = {V,E} be a tree on n vertices. Let v ∈ V. Now we construct two sets V1,V2 such that

V = V1 ∪V2 and every edge in T contains one end vertex in V1 and the other in V2. We built these 6

sets recursively. Initially set V1 = V2 = /0. In the first step V1 = {v} and V2 = /0. In the second step, V1 = {v} and V2 = N(v), the neighborhood of v. In the third step, V1 = {v} ∪u∈V2 N(u) and

V2 = N(v). We continue this process till all vertices are traversed. Note that the process will end in at most n steps.

Theorem 5. Every tree has either one or two centers.

Proof. The result is clearly true if T has at most 3 vertices. So, consider a tree T with four or more vertices. Then, by Corollary 2, T has at least two pendant vertices, and they are not centers. Let T 0 be the graph obtained from T by deleting all pendant vertices of T. Then T 0 is still a tree and both T and T 0 have the same centers. Thus, we can use induction argument to prove the required result.

Definition 6. A of a graph is a spanning subgraph which is also a tree.

Theorem 7. Every finite graph is a connected graph if and only if it has a spanning tree.

Proof. If a graph contains a spanning tree, then clearly it is connected. So, it is sufficient to prove that every finite connected graph has a spanning tree. We will prove this by induction on the number of cycles, say c, in the graph. If the graph has no cycles and is connected, then, by definition, the graph is a tree and hence is its own spanning tree. This makes a good base step for a proof by induction on the number of cycles of the graph that every connected graph has a spanning tree. So, let the result be true for every graph X that has fewer than c > 0 cycles. Now, consider a graph X that has c cycles. Choose a cycle of X and choose an edge, say e, of that cycle. Then, X \{e} has fewer than c cycles and hence by the inductive hypothesis, the resulting graph has a spanning tree. But then this spanning tree is also a spanning tree of X. Therefore, by the principle of mathematical induction, every finite connected graph has a spanning tree.

Definition 8. Circuit of X: Let X be a connected graph on n vertices and m edges. As a spanning tree has n − 1 edges, the number m − (n − 1) = m − n + 1 is called the circuit rank of 7

X. That is, the circuit rank of X is the number of edges that must be removed from X to obtain a spanning tree of X.

Let T be a spanning tree of a graph X. Then, an edge of X that is also in T is called a branch of X. An edge of X that is not in T is called either a chord or a tie or a link of X with respect to T. The set of all chords of X is called a chord set or a tie set or a co-tree. Note that the number of elements in the tie set = the circuit rank of X. The concepts of the spanning tree, circuits and cut sets are closely related. To understand this relationship, we first note that the branches and chords are defined with respect to a given spanning tree, i.e., an edge which is a branch with respect to one spanning tree may be a chord with respect to another spanning tree. So, let X be a given graph with a spanning tree T. Then, we have the following definitions.

• Fundamental circuit: Any circuit of X that can be obtained by adding a chord to T is called a fundamental circuit of X. The set of m − n + 1 circuits obtained in this way is called the fundamental system of circuits relative to T. Since a fundamental circuit contains only one chord of T, it is referred to as the fundamental circuit corresponding to the chord.

• Fundamental cut-set: Since the removal of any branch from T decomposes T into two trees, it follows that corresponding to every branch of T, there is a cut-set. The set of n − 1 cut-sets obtained in this way is called the fundamental system of cut sets relative to T. Since a fundamental cut set contains only one branch of T, it is referred to as the fundamental cut set corresponding to that branch.

• As every chord of T defines a unique fundamental circuit, every branch of T defines a unique fundamental cut set. The ring sum of two cut sets in a graph is a third cut set or an edge disjoint union of cut sets.

A graph is said to be a weighted graph (in particular, edge weighted graph), if each of its edges is assigned a number called weight. Let X be a weighted graph. Then a spanning tree with minimum 8 weight is called a minimum spanning tree (MST(X)). That is, a minimum spanning tree, say T, of an undirected graph is a spanning tree with the total weight (sum of weights) of all edges in T being as low as possible. Kruskal’s Algorithm: This algorithm finds a minimal spanning tree in a weighted graph.

Input : A connected graph X with non-negative weights assigned to each edge.

Output : A minimal spanning tree for X.

Procedure 1. Select any edge of minimal value which is not a loop. This is the first edge of T [ if there is more than one edge of minimal value, arbitrarily choose one of them].

2. Now, from the remaining edge of X, select an edge which has minimal weight and that does not form a circuit with edges which are already included in T.

3. Continue Step 2 until T contains n − 1 edges, where n is the number of vertices of X.

In Kruskal’s algorithm, we have listed all edge weights in increasing order. The following algorithm does not require listing of edge weights. Prim’s Algorithm: This algorithm finds a minimal spanning tree in a weighted graph.

Input : A connected graph X with non-negative weights assigned to each edge.

Output : A minimal spanning tree for X.

Procedure 1. We choose a vertex arbitrarily, say v1. Then, we choose another vertex, say

v2 ∈ N(v1) (the neighborhood of v1), such that the weight of the edge {v1,v2} is the

least among the edges that are incident at v1.

2. Now we look at the vertices which are adjacent to either v1 or v2. Again, among all the

vertices in N(v1) ∪ N(v2), we choose a vertex, say v3 whose edge weight is the least.

Now the newly constructed graph contains three vertices v1,v2,v3 and two edges. One

of the edges is {v1,v2} and the other is either {v1,v3} or {v2,v3}. 9

3. Now, we choose a vertex v4 which is adjacent to v1 or v2 or v3 such that

(a) the new edge has minimum weight and

(b) this edge does not form a cycle with existing edges.

4. We continue the above process till all the vertices are traversed or n − 1 edges are added to get a spanning tree.

Observe that at any intermediate step Kruskal’s algorithm produces a forest where as Prim’s algorithm produces a tree.