Trees.

Slides:



Advertisements
Similar presentations
Chapter 11 Trees Graphs III (Trees, MSTs) Reading: Epp Chp 11.5, 11.6.
Advertisements

CSE 211 Discrete Mathematics
CS 336 March 19, 2012 Tandy Warnow.
Coloring Warm-Up. A graph is 2-colorable iff it has no odd length cycles 1: If G has an odd-length cycle then G is not 2- colorable Proof: Let v 0, …,
Trees Chapter 11.
 Theorem 5.9: Let G be a simple graph with n vertices, where n>2. G has a Hamilton circuit if for any two vertices u and v of G that are not adjacent,
Chapter 8 Topics in Graph Theory
Lecture 5 Graph Theory. Graphs Graphs are the most useful model with computer science such as logical design, formal languages, communication network,
Introduction to Graph Theory Instructor: Dr. Chaudhary Department of Computer Science Millersville University Reading Assignment Chapter 1.
Walks, Paths and Circuits Walks, Paths and Circuits Sanjay Jain, Lecturer, School of Computing.
De Bruijn sequences Rotating drum problem:
Graph-02.
Graphs III (Trees, MSTs) (Chp 11.5, 11.6)
MCA 520: Graph Theory Instructor Neelima Gupta
Last time: terminology reminder w Simple graph Vertex = node Edge Degree Weight Neighbours Complete Dual Bipartite Planar Cycle Tree Path Circuit Components.
Applied Discrete Mathematics Week 12: Trees
Graph. Undirected Graph Directed Graph Simple Graph.
R. Bar-Yehuda © 1 קומבינטוריקה למדעי - המחשב – הרצאה #17 Chapter 2: TREES מבוסס על הספר : S. Even, "Graph Algorithms",
Section 3.1 Properties of Trees Sarah Graham. Tree Talk: Vocabulary oTree: a tree is a special type of graph that contains designated vertex called a.
Lists A list is a finite, ordered sequence of data items. Two Implementations –Arrays –Linked Lists.
Definition Hamiltonian graph: A graph with a spanning cycle (also called a Hamiltonian cycle). Hamiltonian graph Hamiltonian cycle.
Graphs and Trees This handout: Trees Minimum Spanning Tree Problem.
Graph Colouring Lecture 20: Nov 25.
Is the following graph Hamiltonian- connected from vertex v? a). Yes b). No c). I have absolutely no idea v.
CTIS 154 Discrete Mathematics II1 8.2 Paths and Cycles Kadir A. Peker.
1 Separator Theorems for Planar Graphs Presented by Shira Zucker.
MATH 310, FALL 2003 (Combinatorial Problem Solving) Lecture 10, Monday, September 22.
Discrete Mathematics Lecture 9 Alexander Bukharovich New York University.
Minimum Spanning Trees. Subgraph A graph G is a subgraph of graph H if –The vertices of G are a subset of the vertices of H, and –The edges of G are a.
Introduction to Graph Theory
GRAPH Learning Outcomes Students should be able to:
5.4 Shortest-path problem  Let G=(V,E,w) be a weighted connected simple graph, w is a function from edges set E to position real numbers set. We denoted.
Trees and Distance. 2.1 Basic properties Acyclic : a graph with no cycle Forest : acyclic graph Tree : connected acyclic graph Leaf : a vertex of degree.
7.1 and 7.2: Spanning Trees. A network is a graph that is connected –The network must be a sub-graph of the original graph (its edges must come from the.
Tree A connected graph that contains no simple circuits is called a tree. Because a tree cannot have a simple circuit, a tree cannot contain multiple.
Based on slides by Y. Peng University of Maryland
Discrete Structures Lecture 12: Trees Ji Yanyan United International College Thanks to Professor Michael Hvidsten.
5.5.2 M inimum spanning trees  Definition 24: A minimum spanning tree in a connected weighted graph is a spanning tree that has the smallest possible.
5.2 Trees  A tree is a connected graph without any cycles.
Introduction to Graph Theory
Fall 2015 COMP 2300 Discrete Structures for Computation Donghyun (David) Kim Department of Mathematics and Physics North Carolina Central University 1.
5.5.2 M inimum spanning trees  Definition 24: A minimum spanning tree in a connected weighted graph is a spanning tree that has the smallest possible.
Graph Colouring Lecture 20: Nov 25. This Lecture Graph coloring is another important problem in graph theory. It also has many applications, including.
Graph Theory and Applications
Discrete Mathematics Chapter 5 Trees.
 Quotient graph  Definition 13: Suppose G(V,E) is a graph and R is a equivalence relation on the set V. We construct the quotient graph G R in the follow.
Indian Institute of Technology Kharagpur PALLAB DASGUPTA Graph Theory: Trees Pallab Dasgupta, Professor, Dept. of Computer Sc. and Engineering, IIT
Graphs Definition: a graph is an abstract representation of a set of objects where some pairs of the objects are connected by links. The interconnected.
1. 期中测验时间和地点: 11 月 4 日, 上午 9:40—11 : 40 地点: 教室 2. 答疑时间和地点: 1)11 月 1 日 ( 周五 )13:00—15:00 软件楼 319 2)11 月 2 日和 3 日, 14:00—17:00 软件楼 3 楼 机房讨论室.
MCA 520: Graph Theory Instructor Neelima Gupta
An Introduction to Graph Theory
Outline 1 Properties of Planar Graphs 5/4/2018.
Applied Discrete Mathematics Week 14: Trees
Proof technique (pigeonhole principle)
Graph theory Definitions Trees, cycles, directed graphs.
12. Graphs and Trees 2 Summary
Introduction to Trees Section 11.1.
Advanced Algorithms Analysis and Design
Greedy Algorithms / Minimum Spanning Tree Yin Tat Lee
Chapter 5. Optimal Matchings
Trees.
Trees L Al-zaid Math1101.
Theorem 5.13: For vT‘, l’(v)= min{l(v), l(vk)+w(vk, v)}
5.4 T-joins and Postman Problems
Proof Techniques.
Simple Graphs: Connectedness, Trees
Warm Up – Tuesday Find the critical times for each vertex.
GRAPH THEORY Properties of Planar Graphs Ch9-1.
GRAPH THEORY Properties of Planar Graphs Ch9-1.
Presentation transcript:

Trees

Tree is connected graph without any circuits or cycles Ex. Trees with one, two, three and four vertices are A tree must have at least one vertex. A tree is a simple graph

Properties There is one and only one path between every pair of vertices in a tree Proof Let T be a tree  T is a connected graph There exists at least one path between every pair of vertices in T. Suppose that there are two distinct paths between two vertices a and b of T. Union of these two paths will contain a circuit, which is a contradiction that T is a tree. Hence the theorem.

Theorem If in a graph G, there is one and only one path between every pair of vertices, then G is a tree. Proof Since there exists a path between every pair of vertices in graph G.  G is connected. Suppose G is not a tree There is a circuit in G There are at least two vertices a and b in G, having two distinct paths But it is given that there is one and only one path between every pair of vertices in G. Hence the graph is a tree.

Theorem A tree with n vertices has (n - 1) edges Proof Let T be a tree with n vertices. T is a connected graph. To prove that T has (n - 1) edges. This theorem will be proved by induction method. For n = 1, T is a tree with one vertex. no. of edges = 0 the theorem is true for n = 1. For n = 2, T is a tree with two vertices. no. of edges = 1  The theorem is true for n = 2.

Suppose the theorem is true for n = k T, a tree with k vertices has (k – 1) edges. To prove the theorem is true for n = k + 1 Let e be an edge between two vertices v & w of T If e is deleted, there is no path between v and w. [∵ e is a unique path between v & w] The sub-graph (T – e) will have two components T1 and T2 with k1 and k2 vertices respectively, where k1 + k2 = k + 1 ; k1, k2  k.

∵ T1 is a tree with k1 vertices.  T1 has (k1 - 1) edges. Also T2 is a tree with k2 vertices.  T2 has (k2 - 1) edges. Number of edges in T1 and T2 = (k1 - 1) + (k2 - 1) = k1 + k1 – 2 = k + 1 – 2 = k - 1 Thus, the number of edges in T = (k - 1) + 1 = k The theorem is true for n = k + 1. Hence by induction method, the theorem is true for every positive integer n.

Theorem Any connected graph with n vertices and (n - 1) edges is a tree. Proof Suppose the connected graph T with n vertices and (n - 1) edges is not a tree. T has an edge e that is not a bridge. If e is deleted, the subgraph T – e is still a connected graph with n vertices and (n - 2) edges.

We continue this process of locating edges that are not bridges and deleting them until we get a connected subgraph T’ with n vertices and (n - k) edges, where k  1 in which every edge is a bridge. Now, T’ is a tree with n vertices. T’ has (n - 1) edges. Thus, n – 1 = n – k where k  1 k = 1 but k  1 Which can not be true. Hence T is a tree.

Theorem In any tree (with two or more vertices), there are at least two pendant vertices. Proof Let T be a tree with n vertices. T has (n - 1) edges. Sum of degrees of n vertices in T = 2 (n - 1) Suppose di is the degree of ith vertex where i = 1, 2, …, n d1 + d2 + … + dn = 2n – 2

Distance If degree of each vertex is more than 1, then sum of the degrees of n vertices is at least 2n. But the sum of degrees of all the vertices = 2n – 2. There are at least two vertices with degree 1. [∵ no vertex can be of degree zero] Hence there are at least two pendant vertices. Distance In a connected graph G, the distance d(v1, v2) between two vertices v1 and v1 is the length of the shortest path between them.

Rooted Trees A tree in which one vertex (called the root) is distinguished from all the others is called a rooted tree. Rooted trees with four vertices Non-rooted trees are called free trees or simply trees.

Binary Tree A tree with n vertices (n  3) is called binary tree in which there is exactly one vertex of degree two, each of the remaining vertices is of degree one or three. The vertex of degree 2 is called the root as it is distinct from all other vertices, it serves as a root. Binary tree is always a rooted tree. Non-pendant vertex is called Internal Vertex

Properties The number of vertices in a binary tree is always odd Proof Let n be the number of vertices in a binary tree. Since there is exactly one vertex of even degree.  All the remaining (n -1) vertices are of odd degrees. Since the number of odd degree vertices in a graph is always even. (n - 1) is even. Hence n is odd.

Theorem Number of pendant vertices in a binary tree is (n+1)/2 Proof Let T be the binary tree of n vertices and p be the number of pendant vertices in T. Also there is one vertex of degree two in T. n – p – 1 is the number of vertices of degree three Sum of degrees of all vertices in T = p + 3(n – p - 1) + 2 = 3n – 2p – 1 Since sum of degrees of all vertices in a graph is twice the number of edges.

Number of edges in T = ½(3n – 2p - 1) Also, number of edges in a tree of n vertices = n – 1 ½(3n – 2p - 1) = n – 1 p = (n + 1)/2 The number of internal vertices in a binary tree is one less than the number of pendant vertices. In a binary tree, a vertex vi is said to be at level li if vi is at a distance of li from the root.

Height of Tree The maximum level, lmax in a binary tree is called the height of the tree. Minimum possible height of an n-vertex binary tree is min lmax =  log2(n + 1) - 1 Maximum possible height of an n-vertex binary tree is max lmax = (n - 1)/2.

Path Length Also called external path length of a tree = Sum of the path lengths from the root to all pendant vertices. The path length of a binary tree is often directly related to the execution time of an algorithm. A binary tree with minimum possible height gives the minimum path length for a given n.