SlideShare a Scribd company logo
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 (20)

PPTX
Introduction to Graph Theory
Manash Kumar Mondal
 
PPT
Spanning trees
Shareb Ismaeel
 
PPTX
Dijkstra's algorithm presentation
Subid Biswas
 
PDF
Graph theory and its applications
Manikanta satyala
 
PPTX
Multi ways trees
SHEETAL WAGHMARE
 
PPTX
Graph representation
Tech_MX
 
PPTX
Graph Theory
Rashmi Bhat
 
PPTX
Graph Theory
Ehsan Hamzei
 
PDF
introduction to graph theory
Chuckie Balbuena
 
PPT
Graph theory
Thirunavukarasu Mani
 
PPTX
daa-unit-3-greedy method
hodcsencet
 
PPTX
Graph theory
AparnaKumari31
 
PDF
Recurrence relations
IIUM
 
PPTX
DFS and BFS
satya parsana
 
PPT
Floyd Warshall Algorithm
InteX Research Lab
 
PPTX
Introduction to Graph Theory
Premsankar Chakkingal
 
PPTX
Slides Chapter10.1 10.2
showslidedump
 
PDF
Artificial Intelligence - Hill climbing.
StephenTec
 
PPT
Graph colouring
Priyank Jain
 
PPTX
Trees and graphs
Lokesh Singrol
 
Introduction to Graph Theory
Manash Kumar Mondal
 
Spanning trees
Shareb Ismaeel
 
Dijkstra's algorithm presentation
Subid Biswas
 
Graph theory and its applications
Manikanta satyala
 
Multi ways trees
SHEETAL WAGHMARE
 
Graph representation
Tech_MX
 
Graph Theory
Rashmi Bhat
 
Graph Theory
Ehsan Hamzei
 
introduction to graph theory
Chuckie Balbuena
 
Graph theory
Thirunavukarasu Mani
 
daa-unit-3-greedy method
hodcsencet
 
Graph theory
AparnaKumari31
 
Recurrence relations
IIUM
 
DFS and BFS
satya parsana
 
Floyd Warshall Algorithm
InteX Research Lab
 
Introduction to Graph Theory
Premsankar Chakkingal
 
Slides Chapter10.1 10.2
showslidedump
 
Artificial Intelligence - Hill climbing.
StephenTec
 
Graph colouring
Priyank Jain
 
Trees and graphs
Lokesh Singrol
 

Similar to Graph Theory: Trees (20)

PPTX
TreesTreesTreesTreesTreesTreesTrees.pptx
rprahulcoder
 
PPTX
Discrete Mathematics Tree
Masud Parvaze
 
PPTX
B.TECH Math project
arunsarkar9
 
PPTX
Trees
Eleonora Ciceri
 
PPTX
Data structure using c module 2
smruti sarangi
 
PPTX
Tree Data Structure Tree Data Structure Details
ssusera8c91a
 
PPTX
non linear data structure -introduction of tree
Siddhi Viradiya
 
PPT
Lecture 5 trees
Victor Palmar
 
PPT
Unit 3.ppt
JITTAYASHWANTHREDDY
 
PDF
Module - 5_Trees.pdf
AnuradhaJadiya1
 
PPTX
Tree
knightofheart
 
PPTX
Introduction to tree ds
Viji B
 
PPTX
graphssssssssssssssssssssssssssssss.pptx
FarhanAli766749
 
PPTX
Data Structures Module 3 Binary Trees Binary Search Trees Tree Traversals AVL...
resming1
 
PDF
Mithfh lecturenotes 9
Praveen Kumar
 
PPTX
Trees krw
Kasun Ranga Wijeweera
 
PDF
trees-and-forest.pdf
albertfernandez44
 
PPT
Natural Trees for the future oil part 3.ppt
Thuyamani M
 
PDF
Trees amd properties slide for presentaton
SHARANSASI1
 
TreesTreesTreesTreesTreesTreesTrees.pptx
rprahulcoder
 
Discrete Mathematics Tree
Masud Parvaze
 
B.TECH Math project
arunsarkar9
 
Data structure using c module 2
smruti sarangi
 
Tree Data Structure Tree Data Structure Details
ssusera8c91a
 
non linear data structure -introduction of tree
Siddhi Viradiya
 
Lecture 5 trees
Victor Palmar
 
Module - 5_Trees.pdf
AnuradhaJadiya1
 
Introduction to tree ds
Viji B
 
graphssssssssssssssssssssssssssssss.pptx
FarhanAli766749
 
Data Structures Module 3 Binary Trees Binary Search Trees Tree Traversals AVL...
resming1
 
Mithfh lecturenotes 9
Praveen Kumar
 
trees-and-forest.pdf
albertfernandez44
 
Natural Trees for the future oil part 3.ppt
Thuyamani M
 
Trees amd properties slide for presentaton
SHARANSASI1
 
Ad

More from Ashikur Rahman (11)

PDF
Graph Theory: Matrix representation of graphs
Ashikur Rahman
 
PDF
SOP writing: What, Why & How
Ashikur Rahman
 
PDF
Graph Theory: Planarity & Dual Graph
Ashikur Rahman
 
PDF
Graph Theory: Connectivity & Isomorphism
Ashikur Rahman
 
PDF
Graph Theory: Cut-Set and Cut-Vertices
Ashikur Rahman
 
PDF
Graph Theory: Paths & Cycles
Ashikur Rahman
 
PPTX
Cybercrimes and Cybercriminals
Ashikur Rahman
 
PPT
E-Marketing and Advertising Concepts
Ashikur Rahman
 
PPTX
Outlier analysis,Chapter-12, Data Mining: Concepts and Techniques
Ashikur Rahman
 
PPTX
Machine learning algorithms for data mining
Ashikur Rahman
 
PPTX
Signature verification Using SIFT Features
Ashikur Rahman
 
Graph Theory: Matrix representation of graphs
Ashikur Rahman
 
SOP writing: What, Why & How
Ashikur Rahman
 
Graph Theory: Planarity & Dual Graph
Ashikur Rahman
 
Graph Theory: Connectivity & Isomorphism
Ashikur Rahman
 
Graph Theory: Cut-Set and Cut-Vertices
Ashikur Rahman
 
Graph Theory: Paths & Cycles
Ashikur Rahman
 
Cybercrimes and Cybercriminals
Ashikur Rahman
 
E-Marketing and Advertising Concepts
Ashikur Rahman
 
Outlier analysis,Chapter-12, Data Mining: Concepts and Techniques
Ashikur Rahman
 
Machine learning algorithms for data mining
Ashikur Rahman
 
Signature verification Using SIFT Features
Ashikur Rahman
 
Ad

Recently uploaded (20)

PPTX
How to Convert an Opportunity into a Quotation in Odoo 18 CRM
Celine George
 
PPTX
Unit 2 COMMERCIAL BANKING, Corporate banking.pptx
AnubalaSuresh1
 
PDF
DIGESTION OF CARBOHYDRATES,PROTEINS,LIPIDS
raviralanaresh2
 
PPTX
THE TAME BIRD AND THE FREE BIRD.pptxxxxx
MarcChristianNicolas
 
PPTX
Views on Education of Indian Thinkers J.Krishnamurthy..pptx
ShrutiMahanta1
 
PDF
community health nursing question paper 2.pdf
Prince kumar
 
PDF
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 - GLOBAL SUCCESS - CẢ NĂM - NĂM 2024 (VOCABULARY, ...
Nguyen Thanh Tu Collection
 
PDF
SSHS-2025-PKLP_Quarter-1-Dr.-Kerby-Alvarez.pdf
AishahSangcopan1
 
PPTX
Stereochemistry-Optical Isomerism in organic compoundsptx
Tarannum Nadaf-Mansuri
 
PDF
CEREBRAL PALSY: NURSING MANAGEMENT .pdf
PRADEEP ABOTHU
 
PPTX
Cultivation practice of Litchi in Nepal.pptx
UmeshTimilsina1
 
PDF
Isharyanti-2025-Cross Language Communication in Indonesian Language
Neny Isharyanti
 
PPTX
A PPT on Alfred Lord Tennyson's Ulysses.
Beena E S
 
PPTX
How to Set Maximum Difference Odoo 18 POS
Celine George
 
PDF
ARAL_Orientation_Day-2-Sessions_ARAL-Readung ARAL-Mathematics ARAL-Sciencev2.pdf
JoelVilloso1
 
PDF
The dynastic history of the Chahmana.pdf
PrachiSontakke5
 
PPTX
SPINA BIFIDA: NURSING MANAGEMENT .pptx
PRADEEP ABOTHU
 
PPSX
HEALTH ASSESSMENT (Community Health Nursing) - GNM 1st Year
Priyanshu Anand
 
PPTX
Mathematics 5 - Time Measurement: Time Zone
menchreo
 
PPT
Talk on Critical Theory, Part One, Philosophy of Social Sciences
Soraj Hongladarom
 
How to Convert an Opportunity into a Quotation in Odoo 18 CRM
Celine George
 
Unit 2 COMMERCIAL BANKING, Corporate banking.pptx
AnubalaSuresh1
 
DIGESTION OF CARBOHYDRATES,PROTEINS,LIPIDS
raviralanaresh2
 
THE TAME BIRD AND THE FREE BIRD.pptxxxxx
MarcChristianNicolas
 
Views on Education of Indian Thinkers J.Krishnamurthy..pptx
ShrutiMahanta1
 
community health nursing question paper 2.pdf
Prince kumar
 
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 - GLOBAL SUCCESS - CẢ NĂM - NĂM 2024 (VOCABULARY, ...
Nguyen Thanh Tu Collection
 
SSHS-2025-PKLP_Quarter-1-Dr.-Kerby-Alvarez.pdf
AishahSangcopan1
 
Stereochemistry-Optical Isomerism in organic compoundsptx
Tarannum Nadaf-Mansuri
 
CEREBRAL PALSY: NURSING MANAGEMENT .pdf
PRADEEP ABOTHU
 
Cultivation practice of Litchi in Nepal.pptx
UmeshTimilsina1
 
Isharyanti-2025-Cross Language Communication in Indonesian Language
Neny Isharyanti
 
A PPT on Alfred Lord Tennyson's Ulysses.
Beena E S
 
How to Set Maximum Difference Odoo 18 POS
Celine George
 
ARAL_Orientation_Day-2-Sessions_ARAL-Readung ARAL-Mathematics ARAL-Sciencev2.pdf
JoelVilloso1
 
The dynastic history of the Chahmana.pdf
PrachiSontakke5
 
SPINA BIFIDA: NURSING MANAGEMENT .pptx
PRADEEP ABOTHU
 
HEALTH ASSESSMENT (Community Health Nursing) - GNM 1st Year
Priyanshu Anand
 
Mathematics 5 - Time Measurement: Time Zone
menchreo
 
Talk on Critical Theory, Part One, Philosophy of Social Sciences
Soraj Hongladarom
 

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