SlideShare uma empresa Scribd logo
1 de 19
Lecture 12 Minimum Spanning Tree
Motivating Example: Point to Multipoint Communication ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],1 2
Spanning Tree ,[object Object],[object Object],[object Object],[object Object],[object Object]
Blue edge spanning tree is the minimum weight spanning tree 5 4 4 5
Properties of a Tree ,[object Object],[object Object],[object Object]
Minimum Spanning Tree Construction ,[object Object],[object Object],[object Object],[object Object]
Safe Edge Addition ,[object Object],[object Object],[object Object],{A,B,C}  {D,E,F} constitute a cut. Let I = {edge AB, edge EF}.Cut {A,B,C}, {D,E,F} respects set I Edge CD is a light weight edge in the example cut. A B C D E F 2 1 3 1
[object Object],[object Object],[object Object],[object Object]
Assume that all the edge weights are distinct. Let no MST containing A contain edge (u, v). Add the edge (u, v) to T Consider a MST T containing A Since (u, v) is not in T,  T    (u, v)  contains a cycle, and (u, v) is in the cycle. Edge (u, v) are in the opposite sides of the cut. Since any cycle must cross the cut even number of times, there exists at least one other edge (x, y) crossing the cut.  Clearly, w(x, y)  > w(u, v).
The edge (x, y) is not in A because (x, y) crosses the cut, and the cut respects A.  Removing (x, y) from the cycle, breaks the cycle and hence creates a spanning tree, T’, s.t. T’ = T    (u, v)  – (x, y) w(T’) = w(T) + w(u, v) – w(x, y)    w(T)  (as w(u, v)  < w(x, y)) This contradicts the fact that T is a MST.
[object Object],[object Object],[object Object]
Kruskals Algorithm  ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Complexity Analysis ,[object Object],[object Object],[object Object],[object Object],[object Object]
5 1 0 2 2 8 5 7 5 1 0 2 2 8 5 7 5 1 0 2 2 8 5 7 5 1 0 2 2 8 5 7 5 1 0 2 2 8 5 7
Prims Algorithm ,[object Object],[object Object],[object Object],[object Object]
[object Object],[object Object],[object Object]
Pseudo-Code For each u in V, key[u] =   S =   Pred[r] = NULL Key[r] = 0 ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
For each v in Adj[u]…. can be done in E complexity  Rest of the loop can be done in V 2  complexity So, overall O(V 2 ) Using heaps we can solve in O((V + E)logV)
Example 0 s 7 5 7 2 1 8 5 3 2 5 3 1 s 0 2 8 5 7 2 8 5 s 0 7 3 1 5 2 3 5 8 0 3 2 5 s 7 2 1 8 5 5 3 1 8 5 s 0 7 2 3 1 5 2 3 5 1 3 8 5 s 0 7 2 1 5 2 3 5 1

Mais conteúdo relacionado

Mais procurados

Pwerhitungan struktur kabel listrick
Pwerhitungan struktur kabel listrick Pwerhitungan struktur kabel listrick
Pwerhitungan struktur kabel listrick CARLES HUTABARAT
 
Grade 12 Unit1-L1-Kinematic Equations
Grade 12 Unit1-L1-Kinematic EquationsGrade 12 Unit1-L1-Kinematic Equations
Grade 12 Unit1-L1-Kinematic Equationsgruszecki1
 
Simple Pendulum MC Question
Simple Pendulum MC QuestionSimple Pendulum MC Question
Simple Pendulum MC QuestionMichael Wu
 
Motion Graph & equations
Motion Graph & equationsMotion Graph & equations
Motion Graph & equationsNurul Fadhilah
 
Grade 11, U1A-L1, Introduction to Kinematics
Grade 11, U1A-L1, Introduction to KinematicsGrade 11, U1A-L1, Introduction to Kinematics
Grade 11, U1A-L1, Introduction to Kinematicsgruszecki1
 
lecture 22
lecture 22lecture 22
lecture 22sajinsc
 
Ppt on equations of motion by graphival method made by mudit gupta
Ppt on equations of motion by graphival method made by mudit guptaPpt on equations of motion by graphival method made by mudit gupta
Ppt on equations of motion by graphival method made by mudit guptaMUDIT GUPTA
 
Kinematics displacement velocity graphs
Kinematics   displacement velocity graphsKinematics   displacement velocity graphs
Kinematics displacement velocity graphsMohammed Ahmed
 
Grade 11, U1A-L5, Add/Sub Vectors in a Plane
Grade 11, U1A-L5, Add/Sub Vectors in a PlaneGrade 11, U1A-L5, Add/Sub Vectors in a Plane
Grade 11, U1A-L5, Add/Sub Vectors in a Planegruszecki1
 
Grade 11, U1A-L2 Motion Graphs
Grade 11, U1A-L2 Motion GraphsGrade 11, U1A-L2 Motion Graphs
Grade 11, U1A-L2 Motion Graphsgruszecki1
 

Mais procurados (20)

Daa chapter13
Daa chapter13Daa chapter13
Daa chapter13
 
Weighted graphs
Weighted graphsWeighted graphs
Weighted graphs
 
Module No. 6
Module No. 6Module No. 6
Module No. 6
 
Pwerhitungan struktur kabel listrick
Pwerhitungan struktur kabel listrick Pwerhitungan struktur kabel listrick
Pwerhitungan struktur kabel listrick
 
Grade 12 Unit1-L1-Kinematic Equations
Grade 12 Unit1-L1-Kinematic EquationsGrade 12 Unit1-L1-Kinematic Equations
Grade 12 Unit1-L1-Kinematic Equations
 
Simple Pendulum MC Question
Simple Pendulum MC QuestionSimple Pendulum MC Question
Simple Pendulum MC Question
 
Motion Graph & equations
Motion Graph & equationsMotion Graph & equations
Motion Graph & equations
 
Grade 11, U1A-L1, Introduction to Kinematics
Grade 11, U1A-L1, Introduction to KinematicsGrade 11, U1A-L1, Introduction to Kinematics
Grade 11, U1A-L1, Introduction to Kinematics
 
lecture 22
lecture 22lecture 22
lecture 22
 
Ppt on equations of motion by graphival method made by mudit gupta
Ppt on equations of motion by graphival method made by mudit guptaPpt on equations of motion by graphival method made by mudit gupta
Ppt on equations of motion by graphival method made by mudit gupta
 
Motion L1
Motion L1Motion L1
Motion L1
 
Kinematics displacement velocity graphs
Kinematics   displacement velocity graphsKinematics   displacement velocity graphs
Kinematics displacement velocity graphs
 
Introductiontomotion
IntroductiontomotionIntroductiontomotion
Introductiontomotion
 
Chapter 2
Chapter 2Chapter 2
Chapter 2
 
Lecture03
Lecture03Lecture03
Lecture03
 
Scalars and vectors
Scalars and vectorsScalars and vectors
Scalars and vectors
 
Grade 11, U1A-L5, Add/Sub Vectors in a Plane
Grade 11, U1A-L5, Add/Sub Vectors in a PlaneGrade 11, U1A-L5, Add/Sub Vectors in a Plane
Grade 11, U1A-L5, Add/Sub Vectors in a Plane
 
Lecture01
Lecture01Lecture01
Lecture01
 
Grade 11, U1A-L2 Motion Graphs
Grade 11, U1A-L2 Motion GraphsGrade 11, U1A-L2 Motion Graphs
Grade 11, U1A-L2 Motion Graphs
 
14210111030
1421011103014210111030
14210111030
 

Semelhante a lecture 16

Algorithm Design and Complexity - Course 9
Algorithm Design and Complexity - Course 9Algorithm Design and Complexity - Course 9
Algorithm Design and Complexity - Course 9Traian Rebedea
 
minimum spanning trees Algorithm
minimum spanning trees Algorithm minimum spanning trees Algorithm
minimum spanning trees Algorithm sachin varun
 
test pre
test pretest pre
test prefarazch
 
Graph_data_structure_information_engineering.pptx
Graph_data_structure_information_engineering.pptxGraph_data_structure_information_engineering.pptx
Graph_data_structure_information_engineering.pptxsahilpawar2426
 
Algorithm Design and Complexity - Course 10
Algorithm Design and Complexity - Course 10Algorithm Design and Complexity - Course 10
Algorithm Design and Complexity - Course 10Traian Rebedea
 
spanningtreesapplications-120903115339-phpapp02 (1).pdf
spanningtreesapplications-120903115339-phpapp02 (1).pdfspanningtreesapplications-120903115339-phpapp02 (1).pdf
spanningtreesapplications-120903115339-phpapp02 (1).pdfYasirAli74993
 
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
 
The Total Strong Split Domination Number of Graphs
The Total Strong Split Domination Number of GraphsThe Total Strong Split Domination Number of Graphs
The Total Strong Split Domination Number of Graphsinventionjournals
 
Graph terminology and algorithm and tree.pptx
Graph terminology and algorithm and tree.pptxGraph terminology and algorithm and tree.pptx
Graph terminology and algorithm and tree.pptxasimshahzad8611
 

Semelhante a lecture 16 (20)

Algorithm Design and Complexity - Course 9
Algorithm Design and Complexity - Course 9Algorithm Design and Complexity - Course 9
Algorithm Design and Complexity - Course 9
 
Chapter 24 aoa
Chapter 24 aoaChapter 24 aoa
Chapter 24 aoa
 
lec6.pptx
lec6.pptxlec6.pptx
lec6.pptx
 
minimum spanning trees Algorithm
minimum spanning trees Algorithm minimum spanning trees Algorithm
minimum spanning trees Algorithm
 
Graph algorithms
Graph algorithmsGraph algorithms
Graph algorithms
 
test pre
test pretest pre
test pre
 
Graph_data_structure_information_engineering.pptx
Graph_data_structure_information_engineering.pptxGraph_data_structure_information_engineering.pptx
Graph_data_structure_information_engineering.pptx
 
Compactrouting
CompactroutingCompactrouting
Compactrouting
 
Algorithm Design and Complexity - Course 10
Algorithm Design and Complexity - Course 10Algorithm Design and Complexity - Course 10
Algorithm Design and Complexity - Course 10
 
spanningtreesapplications-120903115339-phpapp02 (1).pdf
spanningtreesapplications-120903115339-phpapp02 (1).pdfspanningtreesapplications-120903115339-phpapp02 (1).pdf
spanningtreesapplications-120903115339-phpapp02 (1).pdf
 
chapter23.ppt
chapter23.pptchapter23.ppt
chapter23.ppt
 
19 Minimum Spanning Trees
19 Minimum Spanning Trees19 Minimum Spanning Trees
19 Minimum Spanning Trees
 
graph.ppt
graph.pptgraph.ppt
graph.ppt
 
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
 
DIGITAL TEXT BOOK
DIGITAL TEXT BOOKDIGITAL TEXT BOOK
DIGITAL TEXT BOOK
 
Graph
GraphGraph
Graph
 
Graph
GraphGraph
Graph
 
The Total Strong Split Domination Number of Graphs
The Total Strong Split Domination Number of GraphsThe Total Strong Split Domination Number of Graphs
The Total Strong Split Domination Number of Graphs
 
Graph theory
Graph theoryGraph theory
Graph theory
 
Graph terminology and algorithm and tree.pptx
Graph terminology and algorithm and tree.pptxGraph terminology and algorithm and tree.pptx
Graph terminology and algorithm and tree.pptx
 

Mais de sajinsc

lecture 30
lecture 30lecture 30
lecture 30sajinsc
 
lecture 29
lecture 29lecture 29
lecture 29sajinsc
 
lecture 28
lecture 28lecture 28
lecture 28sajinsc
 
lecture 27
lecture 27lecture 27
lecture 27sajinsc
 
lecture 26
lecture 26lecture 26
lecture 26sajinsc
 
lecture 25
lecture 25lecture 25
lecture 25sajinsc
 
lecture 24
lecture 24lecture 24
lecture 24sajinsc
 
lecture 23
lecture 23lecture 23
lecture 23sajinsc
 
lecture 20
lecture 20lecture 20
lecture 20sajinsc
 
lecture 19
lecture 19lecture 19
lecture 19sajinsc
 
lecture 18
lecture 18lecture 18
lecture 18sajinsc
 
lecture 17
lecture 17lecture 17
lecture 17sajinsc
 
lecture 15
lecture 15lecture 15
lecture 15sajinsc
 
lecture 14
lecture 14lecture 14
lecture 14sajinsc
 
lecture 13
lecture 13lecture 13
lecture 13sajinsc
 
lecture 12
lecture 12lecture 12
lecture 12sajinsc
 
lecture 11
lecture 11lecture 11
lecture 11sajinsc
 
lecture 10
lecture 10lecture 10
lecture 10sajinsc
 
lecture 9
lecture 9lecture 9
lecture 9sajinsc
 
lecture 8
lecture 8lecture 8
lecture 8sajinsc
 

Mais de sajinsc (20)

lecture 30
lecture 30lecture 30
lecture 30
 
lecture 29
lecture 29lecture 29
lecture 29
 
lecture 28
lecture 28lecture 28
lecture 28
 
lecture 27
lecture 27lecture 27
lecture 27
 
lecture 26
lecture 26lecture 26
lecture 26
 
lecture 25
lecture 25lecture 25
lecture 25
 
lecture 24
lecture 24lecture 24
lecture 24
 
lecture 23
lecture 23lecture 23
lecture 23
 
lecture 20
lecture 20lecture 20
lecture 20
 
lecture 19
lecture 19lecture 19
lecture 19
 
lecture 18
lecture 18lecture 18
lecture 18
 
lecture 17
lecture 17lecture 17
lecture 17
 
lecture 15
lecture 15lecture 15
lecture 15
 
lecture 14
lecture 14lecture 14
lecture 14
 
lecture 13
lecture 13lecture 13
lecture 13
 
lecture 12
lecture 12lecture 12
lecture 12
 
lecture 11
lecture 11lecture 11
lecture 11
 
lecture 10
lecture 10lecture 10
lecture 10
 
lecture 9
lecture 9lecture 9
lecture 9
 
lecture 8
lecture 8lecture 8
lecture 8
 

Último

ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxiammrhaywood
 
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdfVirtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdfErwinPantujan2
 
Transaction Management in Database Management System
Transaction Management in Database Management SystemTransaction Management in Database Management System
Transaction Management in Database Management SystemChristalin Nelson
 
Integumentary System SMP B. Pharm Sem I.ppt
Integumentary System SMP B. Pharm Sem I.pptIntegumentary System SMP B. Pharm Sem I.ppt
Integumentary System SMP B. Pharm Sem I.pptshraddhaparab530
 
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...Postal Advocate Inc.
 
Concurrency Control in Database Management system
Concurrency Control in Database Management systemConcurrency Control in Database Management system
Concurrency Control in Database Management systemChristalin Nelson
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatYousafMalik24
 
4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptx4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptxmary850239
 
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdfInclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdfTechSoup
 
Global Lehigh Strategic Initiatives (without descriptions)
Global Lehigh Strategic Initiatives (without descriptions)Global Lehigh Strategic Initiatives (without descriptions)
Global Lehigh Strategic Initiatives (without descriptions)cama23
 
ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4MiaBumagat1
 
AUDIENCE THEORY -CULTIVATION THEORY - GERBNER.pptx
AUDIENCE THEORY -CULTIVATION THEORY -  GERBNER.pptxAUDIENCE THEORY -CULTIVATION THEORY -  GERBNER.pptx
AUDIENCE THEORY -CULTIVATION THEORY - GERBNER.pptxiammrhaywood
 
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...Nguyen Thanh Tu Collection
 
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17Celine George
 
Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Celine George
 
ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...
ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...
ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...JojoEDelaCruz
 
Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for BeginnersSabitha Banu
 
Food processing presentation for bsc agriculture hons
Food processing presentation for bsc agriculture honsFood processing presentation for bsc agriculture hons
Food processing presentation for bsc agriculture honsManeerUddin
 
Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Mark Reed
 
Barangay Council for the Protection of Children (BCPC) Orientation.pptx
Barangay Council for the Protection of Children (BCPC) Orientation.pptxBarangay Council for the Protection of Children (BCPC) Orientation.pptx
Barangay Council for the Protection of Children (BCPC) Orientation.pptxCarlos105
 

Último (20)

ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
 
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdfVirtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
 
Transaction Management in Database Management System
Transaction Management in Database Management SystemTransaction Management in Database Management System
Transaction Management in Database Management System
 
Integumentary System SMP B. Pharm Sem I.ppt
Integumentary System SMP B. Pharm Sem I.pptIntegumentary System SMP B. Pharm Sem I.ppt
Integumentary System SMP B. Pharm Sem I.ppt
 
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
 
Concurrency Control in Database Management system
Concurrency Control in Database Management systemConcurrency Control in Database Management system
Concurrency Control in Database Management system
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice great
 
4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptx4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptx
 
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdfInclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
 
Global Lehigh Strategic Initiatives (without descriptions)
Global Lehigh Strategic Initiatives (without descriptions)Global Lehigh Strategic Initiatives (without descriptions)
Global Lehigh Strategic Initiatives (without descriptions)
 
ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4
 
AUDIENCE THEORY -CULTIVATION THEORY - GERBNER.pptx
AUDIENCE THEORY -CULTIVATION THEORY -  GERBNER.pptxAUDIENCE THEORY -CULTIVATION THEORY -  GERBNER.pptx
AUDIENCE THEORY -CULTIVATION THEORY - GERBNER.pptx
 
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
 
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
 
Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17
 
ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...
ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...
ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...
 
Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for Beginners
 
Food processing presentation for bsc agriculture hons
Food processing presentation for bsc agriculture honsFood processing presentation for bsc agriculture hons
Food processing presentation for bsc agriculture hons
 
Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)
 
Barangay Council for the Protection of Children (BCPC) Orientation.pptx
Barangay Council for the Protection of Children (BCPC) Orientation.pptxBarangay Council for the Protection of Children (BCPC) Orientation.pptx
Barangay Council for the Protection of Children (BCPC) Orientation.pptx
 

lecture 16

  • 1. Lecture 12 Minimum Spanning Tree
  • 2.
  • 3.
  • 4. Blue edge spanning tree is the minimum weight spanning tree 5 4 4 5
  • 5.
  • 6.
  • 7.
  • 8.
  • 9. Assume that all the edge weights are distinct. Let no MST containing A contain edge (u, v). Add the edge (u, v) to T Consider a MST T containing A Since (u, v) is not in T, T  (u, v) contains a cycle, and (u, v) is in the cycle. Edge (u, v) are in the opposite sides of the cut. Since any cycle must cross the cut even number of times, there exists at least one other edge (x, y) crossing the cut. Clearly, w(x, y) > w(u, v).
  • 10. The edge (x, y) is not in A because (x, y) crosses the cut, and the cut respects A. Removing (x, y) from the cycle, breaks the cycle and hence creates a spanning tree, T’, s.t. T’ = T  (u, v) – (x, y) w(T’) = w(T) + w(u, v) – w(x, y)  w(T) (as w(u, v) < w(x, y)) This contradicts the fact that T is a MST.
  • 11.
  • 12.
  • 13.
  • 14. 5 1 0 2 2 8 5 7 5 1 0 2 2 8 5 7 5 1 0 2 2 8 5 7 5 1 0 2 2 8 5 7 5 1 0 2 2 8 5 7
  • 15.
  • 16.
  • 17.
  • 18. For each v in Adj[u]…. can be done in E complexity Rest of the loop can be done in V 2 complexity So, overall O(V 2 ) Using heaps we can solve in O((V + E)logV)
  • 19. Example 0 s 7 5 7 2 1 8 5 3 2 5 3 1 s 0 2 8 5 7 2 8 5 s 0 7 3 1 5 2 3 5 8 0 3 2 5 s 7 2 1 8 5 5 3 1 8 5 s 0 7 2 3 1 5 2 3 5 1 3 8 5 s 0 7 2 1 5 2 3 5 1