SlideShare a Scribd company logo
Introduction to Algorithms Second Edition by Cormen, Leiserson, Rivest & Stein Chapter 23
Minimum Spanning Tree We then wish to find an acyclic subset  T  є   E  that connects all of the vertices and whose total weight is minimized.
Copyright  © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Minimum Spanning Tree Assume that we have a connected, undirected graph  G  = ( V, E ) with a weight function  w  :  E  ->  R , and we wish to find a minimum spanning tree for  G . At each step, we determine an edge ( u, v ) that can be added to  A  without violating this invariant, in the sense that  A U  {( u, v )} is also a subset of a minimum spanning tree.
Copyright  © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Minimum Spanning Tree A  cut  ( S, V  -  S ) of an undirected graph  G  = ( V ,  E ) is a partition of  V . We say that an edge ( u ,  v )  ε   E  crosses  the cut ( S ,  V  -  S ) if one of its endpoints is in  S  and the other is in  V  -  S .
Minimum Spanning Tree We say that a cut  respects  a set  A  of edges if no edge in  A  crosses the cut.  An edge is a  light edge  crossing a cut if its weight is the minimum of any edge crossing the cut.
Copyright  © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Copyright  © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Copyright  © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Minimum Spanning Tree It finds a safe edge to add to the growing forest by finding, of all the edges that connect any two trees in the forest, an edge ( u ,  v ) of least weight.
Kruskal’s Algorithm It uses a disjoint-set data structure to maintain several disjoint sets of elements. Each set contains the vertices in a tree of the current forest. The operation FIND-SET( u ) returns a representative element from the set that contains  u . Thus, we can determine whether two vertices  u  and  v  belong to the same tree by testing whether FIND-SET( u ) equals FIND-SET( v ). The combining of trees is accomplished by the UNION procedure.
Copyright  © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Copyright  © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Copyright  © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Copyright  © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.

More Related Content

What's hot (19)

PPT
Unit26 shortest pathalgorithm
meisamstar
 
PPTX
Dijkstra's Algorithm
Rashik Ishrak Nahian
 
PPTX
Data structure and algorithm
sakthibalabalamuruga
 
PPTX
Minimum spanning tree
STEFFY D
 
PPTX
Spanning trees & applications
Tech_MX
 
PPTX
Shortest path algorithm
Subrata Kumer Paul
 
PDF
Dijkstra's Algorithm
ArijitDhali
 
PPTX
Discrete Mathematics Presentation
Salman Elahi
 
PPTX
Aplicaciones de la derivada
JOELSEBASTIANANDRADE
 
PPTX
Dijkstra's algorithm presentation
Subid Biswas
 
PPT
KRUSKAL'S algorithm from chaitra
guest1f4fb3
 
PPTX
Aplicaciones de la derivada
JOELSEBASTIANANDRADE
 
PDF
All pairs shortest path algorithm
Srikrishnan Suresh
 
PPTX
Networks dijkstra's algorithm- pgsr
Linawati Adiman
 
PPTX
Dijkstra s algorithm
mansab MIRZA
 
PPTX
Dijkstra’s algorithm
faisal2204
 
PDF
Performance of the Viterbi Algorithm on a Polya ChannelExample
Nestor Barraza
 
PPT
Biconnected components (13024116056)
Akshay soni
 
Unit26 shortest pathalgorithm
meisamstar
 
Dijkstra's Algorithm
Rashik Ishrak Nahian
 
Data structure and algorithm
sakthibalabalamuruga
 
Minimum spanning tree
STEFFY D
 
Spanning trees & applications
Tech_MX
 
Shortest path algorithm
Subrata Kumer Paul
 
Dijkstra's Algorithm
ArijitDhali
 
Discrete Mathematics Presentation
Salman Elahi
 
Aplicaciones de la derivada
JOELSEBASTIANANDRADE
 
Dijkstra's algorithm presentation
Subid Biswas
 
KRUSKAL'S algorithm from chaitra
guest1f4fb3
 
Aplicaciones de la derivada
JOELSEBASTIANANDRADE
 
All pairs shortest path algorithm
Srikrishnan Suresh
 
Networks dijkstra's algorithm- pgsr
Linawati Adiman
 
Dijkstra s algorithm
mansab MIRZA
 
Dijkstra’s algorithm
faisal2204
 
Performance of the Viterbi Algorithm on a Polya ChannelExample
Nestor Barraza
 
Biconnected components (13024116056)
Akshay soni
 

Similar to chapter23.ppt (10)

PPT
Algorithm Design and Complexity - Course 9
Traian Rebedea
 
PPT
lecture 16
sajinsc
 
PDF
19 Minimum Spanning Trees
Andres Mendez-Vazquez
 
PPT
minimum spanning trees Algorithm
sachin varun
 
PDF
Daa chapter13
B.Kirron Reddi
 
PPT
Chapter 24 aoa
Hanif Durad
 
PPT
Graph algorithms
University of Haripur
 
PPT
Weighted graphs
Core Condor
 
PDF
spanningtreesapplications-120903115339-phpapp02 (1).pdf
YasirAli74993
 
PDF
lecture 23 algorithm design and analysis
bluebirdrish666
 
Algorithm Design and Complexity - Course 9
Traian Rebedea
 
lecture 16
sajinsc
 
19 Minimum Spanning Trees
Andres Mendez-Vazquez
 
minimum spanning trees Algorithm
sachin varun
 
Daa chapter13
B.Kirron Reddi
 
Chapter 24 aoa
Hanif Durad
 
Graph algorithms
University of Haripur
 
Weighted graphs
Core Condor
 
spanningtreesapplications-120903115339-phpapp02 (1).pdf
YasirAli74993
 
lecture 23 algorithm design and analysis
bluebirdrish666
 
Ad

More from Tareq Hasan (20)

PPTX
Grow Your Career with WordPress
Tareq Hasan
 
PDF
Caching in WordPress
Tareq Hasan
 
PDF
How to Submit a plugin to WordPress.org Repository
Tareq Hasan
 
PDF
Composer - The missing package manager for PHP
Tareq Hasan
 
PDF
WordPress Theme & Plugin development best practices - phpXperts seminar 2011
Tareq Hasan
 
PPT
08 c++ Operator Overloading.ppt
Tareq Hasan
 
PPT
02 c++ Array Pointer
Tareq Hasan
 
PPT
01 c++ Intro.ppt
Tareq Hasan
 
PPT
chapter - 6.ppt
Tareq Hasan
 
PPT
Algorithm.ppt
Tareq Hasan
 
PPT
chapter-8.ppt
Tareq Hasan
 
PPT
Algorithm: priority queue
Tareq Hasan
 
PPT
Algorithm: Quick-Sort
Tareq Hasan
 
PPT
Java: GUI
Tareq Hasan
 
PPT
Java: Inheritance
Tareq Hasan
 
PPT
Java: Exception
Tareq Hasan
 
PPT
Java: Introduction to Arrays
Tareq Hasan
 
PPT
Java: Class Design Examples
Tareq Hasan
 
PPT
Java: Objects and Object References
Tareq Hasan
 
PPT
Java: Primitive Data Types
Tareq Hasan
 
Grow Your Career with WordPress
Tareq Hasan
 
Caching in WordPress
Tareq Hasan
 
How to Submit a plugin to WordPress.org Repository
Tareq Hasan
 
Composer - The missing package manager for PHP
Tareq Hasan
 
WordPress Theme & Plugin development best practices - phpXperts seminar 2011
Tareq Hasan
 
08 c++ Operator Overloading.ppt
Tareq Hasan
 
02 c++ Array Pointer
Tareq Hasan
 
01 c++ Intro.ppt
Tareq Hasan
 
chapter - 6.ppt
Tareq Hasan
 
Algorithm.ppt
Tareq Hasan
 
chapter-8.ppt
Tareq Hasan
 
Algorithm: priority queue
Tareq Hasan
 
Algorithm: Quick-Sort
Tareq Hasan
 
Java: GUI
Tareq Hasan
 
Java: Inheritance
Tareq Hasan
 
Java: Exception
Tareq Hasan
 
Java: Introduction to Arrays
Tareq Hasan
 
Java: Class Design Examples
Tareq Hasan
 
Java: Objects and Object References
Tareq Hasan
 
Java: Primitive Data Types
Tareq Hasan
 
Ad

chapter23.ppt

  • 1. Introduction to Algorithms Second Edition by Cormen, Leiserson, Rivest & Stein Chapter 23
  • 2. Minimum Spanning Tree We then wish to find an acyclic subset T є E that connects all of the vertices and whose total weight is minimized.
  • 3. Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
  • 4. Minimum Spanning Tree Assume that we have a connected, undirected graph G = ( V, E ) with a weight function w : E -> R , and we wish to find a minimum spanning tree for G . At each step, we determine an edge ( u, v ) that can be added to A without violating this invariant, in the sense that A U {( u, v )} is also a subset of a minimum spanning tree.
  • 5. Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
  • 6. Minimum Spanning Tree A cut ( S, V - S ) of an undirected graph G = ( V , E ) is a partition of V . We say that an edge ( u , v ) ε E crosses the cut ( S , V - S ) if one of its endpoints is in S and the other is in V - S .
  • 7. Minimum Spanning Tree We say that a cut respects a set A of edges if no edge in A crosses the cut. An edge is a light edge crossing a cut if its weight is the minimum of any edge crossing the cut.
  • 8. Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
  • 9. Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
  • 10. Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
  • 11. Minimum Spanning Tree It finds a safe edge to add to the growing forest by finding, of all the edges that connect any two trees in the forest, an edge ( u , v ) of least weight.
  • 12. Kruskal’s Algorithm It uses a disjoint-set data structure to maintain several disjoint sets of elements. Each set contains the vertices in a tree of the current forest. The operation FIND-SET( u ) returns a representative element from the set that contains u . Thus, we can determine whether two vertices u and v belong to the same tree by testing whether FIND-SET( u ) equals FIND-SET( v ). The combining of trees is accomplished by the UNION procedure.
  • 13. Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
  • 14. Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
  • 15. Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
  • 16. Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.