SlideShare a Scribd company logo
1 of 34
Download to read offline
Trees
A.B.M. Ashikur Rahman
Wee-3: Trees 1
Definition
• A connected acyclic graph
Wee-3: Trees 2
Properties of Tree
• Theorem 3.1 – There is one and only one path between every pair of
vertices in a tree, T.
• Theorem 3.2 – If in a graph G there is one and only one path between
every pair of vertices, G is a tree.
• Theorem 3.3 – A tree with n vertices has n-1 edges.
Wee-3: Trees 3
Properties of Tree
• Theorem 3.4 – Any connected graph with n vertices and n-1 edges is a
tree.
• Theorem 3.5 – A graph is a tree if and only if it is minimally connected.
• Theorem 3.6 – A graph G with n vertices, n-1 edges and no circuits is
connected.
Wee-3: Trees 4
Summary of the Properties
• A graph G with n vertices is called a tree if –
• G is connected & is circuitless, or
• G is connected & has n-1 edges, or
• G is circuitless and has n-1 edges, or
• There is exactly one path between every pair of vertices in G, or
• G is a minimally connected graph.
Wee-3: Trees 5
Properties of tree
Question: Cycle in tree. Possible?
Answer:
Wee-3: Trees 6
In graph theory: Nope.
In jungle: May be.
Pendant Vertices in a Tree
• Theorem 3.7 – In any tree (with two or more vertices), there are at
least two pendant vertices.
• Finding monotonically increasing
subsequence of
4, 1, 13, 7, 0, 2, 8, 11, 3
Wee-3: Trees 7
Distance & Centers in a Tree
• Distance
• distance d(vi, vj) between two of its vertices vi and vj is the length of the
shortest path
• Metric – is a function f that satisfies the conditions below
• Nonnegativity: f(x,y) ≥ 0, and f(x,y) = 0 if and only if x = y.
• Symmetry: f(x,y) = f(y,x).
• Triangle inequality: f(x,y) ≤ f(x,z) + f(z,y) for any z.
Wee-3: Trees 8
Distance & Centers in a Tree
• Theorem 3.8 – The distance between vertices of a connected graph is a
metric.
• Eccentricity(also referred to as assosiated number or separation) E(v)
of a vertex v in a graph G is distance from v to the vertex farthest from
v in G; that is
• Center : A vertex with minimum eccentricity in graph G is called a
center of G.
Wee-3: Trees 9
Distance & Centers in a Tree
• Theorem 3.9 – Every tree has either one or two centers.
• Radius & Diameter
Wee-3: Trees 10
Rooted & Binary Trees
• Rooted trees with 4 vertices
• Binary Trees
• Internal Vertex
Wee-3: Trees 11
Properties Binary Trees
• The number of vertices n in a binary tree is always odd. This because
there is exactly one vertex of even degree and the remaining n-1
vertices are of odd degrees. Since the number of vertices of odd degree
is even, n-1 is even. Hence n is odd.
• Let p be the number of pendant vertices in a binary tree T. Then n-p-1
is the number of vertices of degree three. Therefore the number of
edges in T equals
Hence
Wee-3: Trees 12
Properties Binary Trees
• Height : The maximum level, lmax, of any vertex in a binary tree is
called the height of the tree.
Wee-3: Trees 13
Weighted Path Length
• Minimize: ∑wjlj
• A Coke machine is to identify, by a sequence of tests, the coin that is put
into the machine. Only pennies, nickels, dimes, and quarters can go
through the slot. Let us assume that the probabilities of a coin being a
penny, a nickel, a dime, and a quarter are .05, .15, .5, and .30,
respectively. Each test has the effect of partitioning the four types of coins
into two complementary sets and asserting the unknown coin to be in one
of the two sets. Thus for four coins we have 23 - 1 such tests. If the time
taken for each test is the same, what sequence of tests will minimize the
expected time taken by the Coke machine to identify the coin?
Wee-3: Trees 14
Weighted Path Length
• Minimize: ∑wjlj
Wee-3: Trees 15
Counting Trees
• On 1857, Arthur Cayley discovered tree while studying structural
isomers of saturated hydrocarbons CkH2k+2 molecule.
• The total number of vertices in such a graph is n = 3k + 2
• And total number of edge
• e = .5 x ( sum of degree )
• e = .5 x ( 4k + 2k +2)
• e = 3k + 1
This structure is tree.
Wee-3: Trees 16
Counting Trees
• When
• n = 4
• 16 labeled trees
• 2 unlabeled trees
Wee-3: Trees 17
Cayley’s Theorem
• Theorem 3.10 – The number of labeled trees with n(≥2) vertices is nn-2.
• Proof:
• Let the n vertices of the tree T be labeled 1, 2, 3, .., n.
• Remove the pendant vertex(and the edge incident on it) having the smallest
label.
• Repeat until n-2 steps or only 2 vertices are left.
• The tree T defines the sequence : (b1, b2, …, bn-2) uniquely.
Wee-3: Trees 18
Cayley’s Theorem
• Remove a1 = 2, get b1 = 1
• Remove a2 = 4, get b2 = 1
• Remove a3 = 1, get b3 = 3
• Remove a4 = 3, get b4 = 5
• Remove a5 = 6, get b5 = 5
• Remove a6 = 7, get b6 = 5
• Remove a7 = 5, get b7 = 9
• Only vertex 8 and 9 are left
• So our sequence of b = (1,1,3,5,5,5,9); is only unique to this labeled graph
Wee-3: Trees 19
5
24
3
7
6
8
9
1
Cayley’s Theorem
• Conversely given a sequence b of n-2 labels, an n-vertex tree can be
constructed uniquely
• First construct the sequence of a = (1, 2, 3, …, n).
• Pick the first number in sequence a which is not in b and pair them.
• Remove both the vertices from the list.
• Continue pairing until sequence of b has no element left.
• Finally join the last two remaining vertices of sequence a.
Wee-3: Trees 20
Cayley’s Theorem
Reconstruction:
b = (1,1,3,5,5,5,9)
a = (1,2,3,4,5,6,7,8,9)
*Follow the class lecture for reconstruction process
Wee-3: Trees 21
Cayley’s Theorem & Proof
• For example, given a sequence (4, 4, 3, 1, 1)
• Given sequence is the sequence of b
• So, we construct a = (1, 2, 3, 4, 5, 6, 7)
• Pair (2, 4) as a1 = 2, b1 = 4
• Pair (5, 4) as a2 = 5, b2 = 4
• Pair (4, 3) as a3 = 4, b3 = 3
• Pair (3, 1) as a4 = 3, b4 = 1
• Pair (6, 1) as a5 = 6, b5 = 1
• Finally pair (1, 7)
Wee-3: Trees 22
Cayley’s Theorem & Proof
• For each of the n-2 element in sequence b we can choose any one of
the n numbers, thus froming nn-2; (n-2) tuples, each defining a distinct
labeled tree of n vertices.
• Since each tree defines one of the sequence uniquely, there is a 1-to-1
correspondence between the trees and the nn-2 sequences.
• Thus the theorem is proved.
Wee-3: Trees 23
Spanning Trees
Wee-3: Trees 24
• A tree T is said to be a spanning tree of connected graph G if T is a
subgraph of G and T contains all vertices of G.
• Maxiaml Tree/Subgraph, skeleton
• Sppaning forest of disconnected graph
• Finding Spanning Tree
• Find Circuits
• delete an edge from the circuit
• continue
Spanning Trees
• Theroem 3.11 – Every connected graph has at least one spanning tree.
Wee-3: Trees 25
• Branch (an edge which is part of
spanning tree T and graph G),
• Chord (an edge which is not part of
spanning tree T but of graph G)
Spanning Trees
• Theroem 3.12 – With respect to any of its spanning trees, a connected
graph of n vertices and e edges has n-1 tree branches and e-n+1
chords.
• Electrical network with e edges and n nodes, how to be sure that we don’t have
a circuit?
• How many walls have to be broken to
drain the lands?
Wee-3: Trees 26
Spanning Trees: Rank & Nullity
• n, e, k are independent of each other except for two constrains
• n-k ≥ 0
• e-n+k ≥ 0
• Rank, r = n-k; number of branches
• Nullity, μ = e-n+k; number of chords
• Rank + Nullity = total number of edges
Wee-3: Trees 27
Fundamental Circuits
• Theroem 3.13 – A connected graph G is a tree if and only if adding an
edge between any two vertices in G creates exactly one circuit.
• Consider a spanning tree T in a connected graph G. Adding any chord
to T will create exactly one circuit. Such a circuit, formed by adding a
chord to a spanning tree, is called a fundamental circuit.
• How many fundamental circuits does a graph have?
Wee-3: Trees 28
Fundamental Circuits
• Has 8 fundamental circuits
• A circuit may be fundamental with respect to a spanning tree but not
other spanning tree of the same graph
• Has 75 total circuits
• A set of edges comprising
a circuit will not be
fundamental if it has
more than one chord
Wee-3: Trees 29
Finding All Spanning Tree
• Cyclic interchange:
• start with a given spanning tree
• add a chord forming a fundamental circuit
• delete an appropriate branch
Wee-3: Trees 30
Cyclic interchange
Wee-3: Trees 31
• Can we start from any spanning tree and get a desired spanning tree by
a number of cyclic exchanges?
• Can we get all spanning trees of a given graph in this fashion?
• How long will we have to continue exchanging edges?
• Is there a preferred spanning tree for starting?
Cyclic interchange
Wee-3: Trees 32
• The distance between two spanning trees of a graph G is defined as
the number of edges of G present in one tree but not in the other
• Written as d(Ti ,Tj)
d(Ti ,Tj) =
1
2
N(Ti ⊕ Tj )
*N(g) denote the number of edges in a graph g
Metric
Wee-3: Trees 33
The distance between the spanning trees of a graph is a metric. That is,
it satisfies-
1. d(Ti, Tj) ≥ 0 and d(Ti, Tj) = 0 if and only if Ti = Tj,
2. d(Ti, Tj) = d(Tj, Ti),
3. d(Ti, Tj) ≤ d(Ti, Tk) + d(Tk, Tj).
Spanning Trees In A Weighted Graph
• Edges have weights
• Minimal spanning tree
• Kruskal’s or Prim’s algorithm
Wee-3: Trees 34

More Related Content

What's hot

What's hot (20)

Spanning trees
Spanning treesSpanning trees
Spanning trees
 
Graphs, Trees, Paths and Their Representations
Graphs, Trees, Paths and Their RepresentationsGraphs, Trees, Paths and Their Representations
Graphs, Trees, Paths and Their Representations
 
Minimum spanning Tree
Minimum spanning TreeMinimum spanning Tree
Minimum spanning Tree
 
Graph theory
Graph theoryGraph theory
Graph theory
 
minimum spanning tree
minimum spanning tree minimum spanning tree
minimum spanning tree
 
Graphs In Data Structure
Graphs In Data StructureGraphs In Data Structure
Graphs In Data Structure
 
Tree - Data Structure
Tree - Data StructureTree - Data Structure
Tree - Data Structure
 
Matrix Representation Of Graph
Matrix Representation Of GraphMatrix Representation Of Graph
Matrix Representation Of Graph
 
minimum spanning trees Algorithm
minimum spanning trees Algorithm minimum spanning trees Algorithm
minimum spanning trees Algorithm
 
Dijkstra’s algorithm
Dijkstra’s algorithmDijkstra’s algorithm
Dijkstra’s algorithm
 
Graph in data structure
Graph in data structureGraph in data structure
Graph in data structure
 
graph theory
graph theory graph theory
graph theory
 
trees-and-forest.pdf
trees-and-forest.pdftrees-and-forest.pdf
trees-and-forest.pdf
 
Graph data structure and algorithms
Graph data structure and algorithmsGraph data structure and algorithms
Graph data structure and algorithms
 
Data structure - Graph
Data structure - GraphData structure - Graph
Data structure - Graph
 
Expression trees
Expression treesExpression trees
Expression trees
 
Graph theory presentation
Graph theory presentationGraph theory presentation
Graph theory presentation
 
SINGLE-SOURCE SHORTEST PATHS
SINGLE-SOURCE SHORTEST PATHS SINGLE-SOURCE SHORTEST PATHS
SINGLE-SOURCE SHORTEST PATHS
 
Graphs - Discrete Math
Graphs - Discrete MathGraphs - Discrete Math
Graphs - Discrete Math
 
Graph Theory
Graph TheoryGraph Theory
Graph Theory
 

Similar to Graph Theory: Trees

B.TECH Math project
B.TECH Math projectB.TECH Math project
B.TECH Math projectarunsarkar9
 
ANALYTIC-GEOMETRY(4).pptx
ANALYTIC-GEOMETRY(4).pptxANALYTIC-GEOMETRY(4).pptx
ANALYTIC-GEOMETRY(4).pptxBercasioKelvin
 
APznzaZLM_MVouyxM4cxHPJR5BC-TAxTWqhQJ2EywQQuXStxJTDoGkHdsKEQGd4Vo7BS3Q1npCOMV...
APznzaZLM_MVouyxM4cxHPJR5BC-TAxTWqhQJ2EywQQuXStxJTDoGkHdsKEQGd4Vo7BS3Q1npCOMV...APznzaZLM_MVouyxM4cxHPJR5BC-TAxTWqhQJ2EywQQuXStxJTDoGkHdsKEQGd4Vo7BS3Q1npCOMV...
APznzaZLM_MVouyxM4cxHPJR5BC-TAxTWqhQJ2EywQQuXStxJTDoGkHdsKEQGd4Vo7BS3Q1npCOMV...KUSHDHIRRA2111026030
 
Area and Perimeter.pptx
Area and Perimeter.pptxArea and Perimeter.pptx
Area and Perimeter.pptxAbbyXiong
 
lecture10 date structure types of graph and terminology
lecture10 date structure types of graph and terminologylecture10 date structure types of graph and terminology
lecture10 date structure types of graph and terminologyKamranAli649587
 
Problems in parallel computations of tree functions
Problems in parallel computations of tree functionsProblems in parallel computations of tree functions
Problems in parallel computations of tree functionsDr Sandeep Kumar Poonia
 
Graph Algorithms
Graph AlgorithmsGraph Algorithms
Graph AlgorithmsAshwin Shiv
 
Minimum enclosingdisk
Minimum enclosingdiskMinimum enclosingdisk
Minimum enclosingdiskAnirban Mitra
 
ADA - Minimum Spanning Tree Prim Kruskal and Dijkstra
ADA - Minimum Spanning Tree Prim Kruskal and Dijkstra ADA - Minimum Spanning Tree Prim Kruskal and Dijkstra
ADA - Minimum Spanning Tree Prim Kruskal and Dijkstra Sahil Kumar
 
Ram minimum spanning tree
Ram   minimum spanning treeRam   minimum spanning tree
Ram minimum spanning treeRama Prasath A
 
MinSpanningTreespresantion.ppt
MinSpanningTreespresantion.pptMinSpanningTreespresantion.ppt
MinSpanningTreespresantion.pptbaciprek
 

Similar to Graph Theory: Trees (20)

B.TECH Math project
B.TECH Math projectB.TECH Math project
B.TECH Math project
 
Ds lec 5_chap4
Ds lec 5_chap4Ds lec 5_chap4
Ds lec 5_chap4
 
Unit ix graph
Unit   ix    graph Unit   ix    graph
Unit ix graph
 
7 Trees.pptx
7 Trees.pptx7 Trees.pptx
7 Trees.pptx
 
ANALYTIC-GEOMETRY(4).pptx
ANALYTIC-GEOMETRY(4).pptxANALYTIC-GEOMETRY(4).pptx
ANALYTIC-GEOMETRY(4).pptx
 
Unit 9 graph
Unit   9 graphUnit   9 graph
Unit 9 graph
 
APznzaZLM_MVouyxM4cxHPJR5BC-TAxTWqhQJ2EywQQuXStxJTDoGkHdsKEQGd4Vo7BS3Q1npCOMV...
APznzaZLM_MVouyxM4cxHPJR5BC-TAxTWqhQJ2EywQQuXStxJTDoGkHdsKEQGd4Vo7BS3Q1npCOMV...APznzaZLM_MVouyxM4cxHPJR5BC-TAxTWqhQJ2EywQQuXStxJTDoGkHdsKEQGd4Vo7BS3Q1npCOMV...
APznzaZLM_MVouyxM4cxHPJR5BC-TAxTWqhQJ2EywQQuXStxJTDoGkHdsKEQGd4Vo7BS3Q1npCOMV...
 
Lecture_1_matrix_operations.pdf
Lecture_1_matrix_operations.pdfLecture_1_matrix_operations.pdf
Lecture_1_matrix_operations.pdf
 
Area and Perimeter.pptx
Area and Perimeter.pptxArea and Perimeter.pptx
Area and Perimeter.pptx
 
lecture10 date structure types of graph and terminology
lecture10 date structure types of graph and terminologylecture10 date structure types of graph and terminology
lecture10 date structure types of graph and terminology
 
Problems in parallel computations of tree functions
Problems in parallel computations of tree functionsProblems in parallel computations of tree functions
Problems in parallel computations of tree functions
 
LEC 12-DSALGO-GRAPHS(final12).pdf
LEC 12-DSALGO-GRAPHS(final12).pdfLEC 12-DSALGO-GRAPHS(final12).pdf
LEC 12-DSALGO-GRAPHS(final12).pdf
 
Graph Algorithms
Graph AlgorithmsGraph Algorithms
Graph Algorithms
 
Lec33
Lec33Lec33
Lec33
 
UNIT III.pptx
UNIT III.pptxUNIT III.pptx
UNIT III.pptx
 
Minimum enclosingdisk
Minimum enclosingdiskMinimum enclosingdisk
Minimum enclosingdisk
 
Unit V - ppt.pptx
Unit V - ppt.pptxUnit V - ppt.pptx
Unit V - ppt.pptx
 
ADA - Minimum Spanning Tree Prim Kruskal and Dijkstra
ADA - Minimum Spanning Tree Prim Kruskal and Dijkstra ADA - Minimum Spanning Tree Prim Kruskal and Dijkstra
ADA - Minimum Spanning Tree Prim Kruskal and Dijkstra
 
Ram minimum spanning tree
Ram   minimum spanning treeRam   minimum spanning tree
Ram minimum spanning tree
 
MinSpanningTreespresantion.ppt
MinSpanningTreespresantion.pptMinSpanningTreespresantion.ppt
MinSpanningTreespresantion.ppt
 

More from Ashikur Rahman

Graph Theory: Matrix representation of graphs
Graph Theory: Matrix representation of graphsGraph Theory: Matrix representation of graphs
Graph Theory: Matrix representation of graphsAshikur Rahman
 
SOP writing: What, Why & How
SOP writing: What, Why & HowSOP writing: What, Why & How
SOP writing: What, Why & HowAshikur Rahman
 
Graph Theory: Planarity & Dual Graph
Graph Theory: Planarity & Dual GraphGraph Theory: Planarity & Dual Graph
Graph Theory: Planarity & Dual GraphAshikur Rahman
 
Graph Theory: Connectivity & Isomorphism
Graph Theory: Connectivity & Isomorphism Graph Theory: Connectivity & Isomorphism
Graph Theory: Connectivity & Isomorphism Ashikur Rahman
 
Graph Theory: Cut-Set and Cut-Vertices
Graph Theory: Cut-Set and Cut-VerticesGraph Theory: Cut-Set and Cut-Vertices
Graph Theory: Cut-Set and Cut-VerticesAshikur Rahman
 
Graph Theory: Paths & Cycles
Graph Theory: Paths & CyclesGraph Theory: Paths & Cycles
Graph Theory: Paths & CyclesAshikur Rahman
 
Cybercrimes and Cybercriminals
Cybercrimes and CybercriminalsCybercrimes and Cybercriminals
Cybercrimes and CybercriminalsAshikur Rahman
 
E-Marketing and Advertising Concepts
E-Marketing and Advertising ConceptsE-Marketing and Advertising Concepts
E-Marketing and Advertising ConceptsAshikur Rahman
 
Outlier analysis,Chapter-12, Data Mining: Concepts and Techniques
Outlier analysis,Chapter-12, Data Mining: Concepts and TechniquesOutlier analysis,Chapter-12, Data Mining: Concepts and Techniques
Outlier analysis,Chapter-12, Data Mining: Concepts and TechniquesAshikur Rahman
 
Machine learning algorithms for data mining
Machine learning algorithms for data miningMachine learning algorithms for data mining
Machine learning algorithms for data miningAshikur Rahman
 
Signature verification Using SIFT Features
Signature verification Using SIFT FeaturesSignature verification Using SIFT Features
Signature verification Using SIFT FeaturesAshikur Rahman
 

More from Ashikur Rahman (11)

Graph Theory: Matrix representation of graphs
Graph Theory: Matrix representation of graphsGraph Theory: Matrix representation of graphs
Graph Theory: Matrix representation of graphs
 
SOP writing: What, Why & How
SOP writing: What, Why & HowSOP writing: What, Why & How
SOP writing: What, Why & How
 
Graph Theory: Planarity & Dual Graph
Graph Theory: Planarity & Dual GraphGraph Theory: Planarity & Dual Graph
Graph Theory: Planarity & Dual Graph
 
Graph Theory: Connectivity & Isomorphism
Graph Theory: Connectivity & Isomorphism Graph Theory: Connectivity & Isomorphism
Graph Theory: Connectivity & Isomorphism
 
Graph Theory: Cut-Set and Cut-Vertices
Graph Theory: Cut-Set and Cut-VerticesGraph Theory: Cut-Set and Cut-Vertices
Graph Theory: Cut-Set and Cut-Vertices
 
Graph Theory: Paths & Cycles
Graph Theory: Paths & CyclesGraph Theory: Paths & Cycles
Graph Theory: Paths & Cycles
 
Cybercrimes and Cybercriminals
Cybercrimes and CybercriminalsCybercrimes and Cybercriminals
Cybercrimes and Cybercriminals
 
E-Marketing and Advertising Concepts
E-Marketing and Advertising ConceptsE-Marketing and Advertising Concepts
E-Marketing and Advertising Concepts
 
Outlier analysis,Chapter-12, Data Mining: Concepts and Techniques
Outlier analysis,Chapter-12, Data Mining: Concepts and TechniquesOutlier analysis,Chapter-12, Data Mining: Concepts and Techniques
Outlier analysis,Chapter-12, Data Mining: Concepts and Techniques
 
Machine learning algorithms for data mining
Machine learning algorithms for data miningMachine learning algorithms for data mining
Machine learning algorithms for data mining
 
Signature verification Using SIFT Features
Signature verification Using SIFT FeaturesSignature verification Using SIFT Features
Signature verification Using SIFT Features
 

Recently uploaded

Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...fonyou31
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxheathfieldcps1
 
General AI for Medical Educators April 2024
General AI for Medical Educators April 2024General AI for Medical Educators April 2024
General AI for Medical Educators April 2024Janet Corral
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactdawncurless
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDThiyagu K
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...christianmathematics
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3JemimahLaneBuaron
 
Class 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfClass 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfAyushMahapatra5
 
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...PsychoTech Services
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxVishalSingh1417
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeThiyagu K
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfsanyamsingh5019
 
social pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajansocial pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajanpragatimahajan3
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactPECB
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Sapana Sha
 

Recently uploaded (20)

Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
General AI for Medical Educators April 2024
General AI for Medical Educators April 2024General AI for Medical Educators April 2024
General AI for Medical Educators April 2024
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SD
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3
 
Class 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfClass 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdf
 
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptx
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptxINDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 
social pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajansocial pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajan
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
 

Graph Theory: Trees

  • 2. Definition • A connected acyclic graph Wee-3: Trees 2
  • 3. Properties of Tree • Theorem 3.1 – There is one and only one path between every pair of vertices in a tree, T. • Theorem 3.2 – If in a graph G there is one and only one path between every pair of vertices, G is a tree. • Theorem 3.3 – A tree with n vertices has n-1 edges. Wee-3: Trees 3
  • 4. Properties of Tree • Theorem 3.4 – Any connected graph with n vertices and n-1 edges is a tree. • Theorem 3.5 – A graph is a tree if and only if it is minimally connected. • Theorem 3.6 – A graph G with n vertices, n-1 edges and no circuits is connected. Wee-3: Trees 4
  • 5. Summary of the Properties • A graph G with n vertices is called a tree if – • G is connected & is circuitless, or • G is connected & has n-1 edges, or • G is circuitless and has n-1 edges, or • There is exactly one path between every pair of vertices in G, or • G is a minimally connected graph. Wee-3: Trees 5
  • 6. Properties of tree Question: Cycle in tree. Possible? Answer: Wee-3: Trees 6 In graph theory: Nope. In jungle: May be.
  • 7. Pendant Vertices in a Tree • Theorem 3.7 – In any tree (with two or more vertices), there are at least two pendant vertices. • Finding monotonically increasing subsequence of 4, 1, 13, 7, 0, 2, 8, 11, 3 Wee-3: Trees 7
  • 8. Distance & Centers in a Tree • Distance • distance d(vi, vj) between two of its vertices vi and vj is the length of the shortest path • Metric – is a function f that satisfies the conditions below • Nonnegativity: f(x,y) ≥ 0, and f(x,y) = 0 if and only if x = y. • Symmetry: f(x,y) = f(y,x). • Triangle inequality: f(x,y) ≤ f(x,z) + f(z,y) for any z. Wee-3: Trees 8
  • 9. Distance & Centers in a Tree • Theorem 3.8 – The distance between vertices of a connected graph is a metric. • Eccentricity(also referred to as assosiated number or separation) E(v) of a vertex v in a graph G is distance from v to the vertex farthest from v in G; that is • Center : A vertex with minimum eccentricity in graph G is called a center of G. Wee-3: Trees 9
  • 10. Distance & Centers in a Tree • Theorem 3.9 – Every tree has either one or two centers. • Radius & Diameter Wee-3: Trees 10
  • 11. Rooted & Binary Trees • Rooted trees with 4 vertices • Binary Trees • Internal Vertex Wee-3: Trees 11
  • 12. Properties Binary Trees • The number of vertices n in a binary tree is always odd. This because there is exactly one vertex of even degree and the remaining n-1 vertices are of odd degrees. Since the number of vertices of odd degree is even, n-1 is even. Hence n is odd. • Let p be the number of pendant vertices in a binary tree T. Then n-p-1 is the number of vertices of degree three. Therefore the number of edges in T equals Hence Wee-3: Trees 12
  • 13. Properties Binary Trees • Height : The maximum level, lmax, of any vertex in a binary tree is called the height of the tree. Wee-3: Trees 13
  • 14. Weighted Path Length • Minimize: ∑wjlj • A Coke machine is to identify, by a sequence of tests, the coin that is put into the machine. Only pennies, nickels, dimes, and quarters can go through the slot. Let us assume that the probabilities of a coin being a penny, a nickel, a dime, and a quarter are .05, .15, .5, and .30, respectively. Each test has the effect of partitioning the four types of coins into two complementary sets and asserting the unknown coin to be in one of the two sets. Thus for four coins we have 23 - 1 such tests. If the time taken for each test is the same, what sequence of tests will minimize the expected time taken by the Coke machine to identify the coin? Wee-3: Trees 14
  • 15. Weighted Path Length • Minimize: ∑wjlj Wee-3: Trees 15
  • 16. Counting Trees • On 1857, Arthur Cayley discovered tree while studying structural isomers of saturated hydrocarbons CkH2k+2 molecule. • The total number of vertices in such a graph is n = 3k + 2 • And total number of edge • e = .5 x ( sum of degree ) • e = .5 x ( 4k + 2k +2) • e = 3k + 1 This structure is tree. Wee-3: Trees 16
  • 17. Counting Trees • When • n = 4 • 16 labeled trees • 2 unlabeled trees Wee-3: Trees 17
  • 18. Cayley’s Theorem • Theorem 3.10 – The number of labeled trees with n(≥2) vertices is nn-2. • Proof: • Let the n vertices of the tree T be labeled 1, 2, 3, .., n. • Remove the pendant vertex(and the edge incident on it) having the smallest label. • Repeat until n-2 steps or only 2 vertices are left. • The tree T defines the sequence : (b1, b2, …, bn-2) uniquely. Wee-3: Trees 18
  • 19. Cayley’s Theorem • Remove a1 = 2, get b1 = 1 • Remove a2 = 4, get b2 = 1 • Remove a3 = 1, get b3 = 3 • Remove a4 = 3, get b4 = 5 • Remove a5 = 6, get b5 = 5 • Remove a6 = 7, get b6 = 5 • Remove a7 = 5, get b7 = 9 • Only vertex 8 and 9 are left • So our sequence of b = (1,1,3,5,5,5,9); is only unique to this labeled graph Wee-3: Trees 19 5 24 3 7 6 8 9 1
  • 20. Cayley’s Theorem • Conversely given a sequence b of n-2 labels, an n-vertex tree can be constructed uniquely • First construct the sequence of a = (1, 2, 3, …, n). • Pick the first number in sequence a which is not in b and pair them. • Remove both the vertices from the list. • Continue pairing until sequence of b has no element left. • Finally join the last two remaining vertices of sequence a. Wee-3: Trees 20
  • 21. Cayley’s Theorem Reconstruction: b = (1,1,3,5,5,5,9) a = (1,2,3,4,5,6,7,8,9) *Follow the class lecture for reconstruction process Wee-3: Trees 21
  • 22. Cayley’s Theorem & Proof • For example, given a sequence (4, 4, 3, 1, 1) • Given sequence is the sequence of b • So, we construct a = (1, 2, 3, 4, 5, 6, 7) • Pair (2, 4) as a1 = 2, b1 = 4 • Pair (5, 4) as a2 = 5, b2 = 4 • Pair (4, 3) as a3 = 4, b3 = 3 • Pair (3, 1) as a4 = 3, b4 = 1 • Pair (6, 1) as a5 = 6, b5 = 1 • Finally pair (1, 7) Wee-3: Trees 22
  • 23. Cayley’s Theorem & Proof • For each of the n-2 element in sequence b we can choose any one of the n numbers, thus froming nn-2; (n-2) tuples, each defining a distinct labeled tree of n vertices. • Since each tree defines one of the sequence uniquely, there is a 1-to-1 correspondence between the trees and the nn-2 sequences. • Thus the theorem is proved. Wee-3: Trees 23
  • 24. Spanning Trees Wee-3: Trees 24 • A tree T is said to be a spanning tree of connected graph G if T is a subgraph of G and T contains all vertices of G. • Maxiaml Tree/Subgraph, skeleton • Sppaning forest of disconnected graph • Finding Spanning Tree • Find Circuits • delete an edge from the circuit • continue
  • 25. Spanning Trees • Theroem 3.11 – Every connected graph has at least one spanning tree. Wee-3: Trees 25 • Branch (an edge which is part of spanning tree T and graph G), • Chord (an edge which is not part of spanning tree T but of graph G)
  • 26. Spanning Trees • Theroem 3.12 – With respect to any of its spanning trees, a connected graph of n vertices and e edges has n-1 tree branches and e-n+1 chords. • Electrical network with e edges and n nodes, how to be sure that we don’t have a circuit? • How many walls have to be broken to drain the lands? Wee-3: Trees 26
  • 27. Spanning Trees: Rank & Nullity • n, e, k are independent of each other except for two constrains • n-k ≥ 0 • e-n+k ≥ 0 • Rank, r = n-k; number of branches • Nullity, μ = e-n+k; number of chords • Rank + Nullity = total number of edges Wee-3: Trees 27
  • 28. Fundamental Circuits • Theroem 3.13 – A connected graph G is a tree if and only if adding an edge between any two vertices in G creates exactly one circuit. • Consider a spanning tree T in a connected graph G. Adding any chord to T will create exactly one circuit. Such a circuit, formed by adding a chord to a spanning tree, is called a fundamental circuit. • How many fundamental circuits does a graph have? Wee-3: Trees 28
  • 29. Fundamental Circuits • Has 8 fundamental circuits • A circuit may be fundamental with respect to a spanning tree but not other spanning tree of the same graph • Has 75 total circuits • A set of edges comprising a circuit will not be fundamental if it has more than one chord Wee-3: Trees 29
  • 30. Finding All Spanning Tree • Cyclic interchange: • start with a given spanning tree • add a chord forming a fundamental circuit • delete an appropriate branch Wee-3: Trees 30
  • 31. Cyclic interchange Wee-3: Trees 31 • Can we start from any spanning tree and get a desired spanning tree by a number of cyclic exchanges? • Can we get all spanning trees of a given graph in this fashion? • How long will we have to continue exchanging edges? • Is there a preferred spanning tree for starting?
  • 32. Cyclic interchange Wee-3: Trees 32 • The distance between two spanning trees of a graph G is defined as the number of edges of G present in one tree but not in the other • Written as d(Ti ,Tj) d(Ti ,Tj) = 1 2 N(Ti ⊕ Tj ) *N(g) denote the number of edges in a graph g
  • 33. Metric Wee-3: Trees 33 The distance between the spanning trees of a graph is a metric. That is, it satisfies- 1. d(Ti, Tj) ≥ 0 and d(Ti, Tj) = 0 if and only if Ti = Tj, 2. d(Ti, Tj) = d(Tj, Ti), 3. d(Ti, Tj) ≤ d(Ti, Tk) + d(Tk, Tj).
  • 34. Spanning Trees In A Weighted Graph • Edges have weights • Minimal spanning tree • Kruskal’s or Prim’s algorithm Wee-3: Trees 34