Minimum Spanning Trees

Similar documents
Examples and applications on SSSP and MST

a g f 8 e 11 Also: Minimum degree, maximum degree, vertex of degree d 1 adjacent to vertex of degree d 2,...

Outlines: Graphs Part-4. Applications of Depth-First Search. Directed Acyclic Graph (DAG) Generic scheduling problem.

dy 1. If fx ( ) is continuous at x = 3, then 13. If y x ) for x 0, then f (g(x)) = g (f (x)) when x = a. ½ b. ½ c. 1 b. 4x a. 3 b. 3 c.

The second condition says that a node α of the tree has exactly n children if the arity of its label is n.

Week 3: Connected Subgraphs

10. EXTENDING TRACTABILITY

Trigonometric functions

Online Supplement: Advance Selling in a Supply Chain under Uncertain Supply and Demand

Combinatorial Networks Week 1, March 11-12

Edge-Triggered D Flip-flop. Formal Analysis. Fundamental-Mode Sequential Circuits. D latch: How do flip-flops work?

AP Calculus Multiple-Choice Question Collection

Final Exam Solutions

1 Minimum Cut Problem

CS 103 BFS Alorithm. Mark Redekopp

ENGR 7181 LECTURE NOTES WEEK 3 Dr. Amir G. Aghdam Concordia University

Analysis of Algorithms - Elementary graphs algorithms -

d e c b a d c b a d e c b a a c a d c c e b

priority queue ADT heaps 1

Outline. 1 Introduction. 2 Min-Cost Spanning Trees. 4 Example

Internet Algorithms. (Oblivious) Routing. Lecture 10 06/24/11. Wereferto. demands(requirements), forall vertex pairs,,

Additional Math (4047) Paper 2 (100 marks) y x. 2 d. d d

Chapter Finding Small Vertex Covers. Extending the Limits of Tractability. Coping With NP-Completeness. Vertex Cover

Analysis of Algorithms - Elementary graphs algorithms -

The Matrix Exponential

AP Calculus BC AP Exam Problems Chapters 1 3

CPS 616 W2017 MIDTERM SOLUTIONS 1

The Matrix Exponential

Exponential Functions

University of Washington Department of Chemistry Chemistry 453 Winter Quarter 2014 Lecture 20: Transition State Theory. ERD: 25.14

Physics 43 HW #9 Chapter 40 Key

3-2-1 ANN Architecture

The Transfer Function. The Transfer Function. The Transfer Function. The Transfer Function. The Transfer Function. The Transfer Function

MAT3707. Tutorial letter 201/1/2017 DISCRETE MATHEMATICS: COMBINATORICS. Semester 1. Department of Mathematical Sciences MAT3707/201/1/2017

Steinberg s Conjecture is false

CS 491 G Combinatorial Optimization

Multiple Short Term Infusion Homework # 5 PHA 5127

Introduction to Arithmetic Geometry Fall 2013 Lecture #20 11/14/2013

Searching Linked Lists. Perfect Skip List. Building a Skip List. Skip List Analysis (1) Assume the list is sorted, but is stored in a linked list.

Cycles and Simple Cycles. Paths and Simple Paths. Trees. Problem: There is No Completely Standard Terminology!

learning objectives learn what graphs are in mathematical terms learn how to represent graphs in computers learn about typical graph algorithms

Recall that by Theorems 10.3 and 10.4 together provide us the estimate o(n2 ), S(q) q 9, q=1

Walk Like a Mathematician Learning Task:

ON RIGHT(LEFT) DUO PO-SEMIGROUPS. S. K. Lee and K. Y. Park

Derangements and Applications

Depth First Search. Yufei Tao. Department of Computer Science and Engineering Chinese University of Hong Kong

Section 6.1. Question: 2. Let H be a subgroup of a group G. Then H operates on G by left multiplication. Describe the orbits for this operation.

ENGR 7181 LECTURE NOTES WEEK 5 Dr. Amir G. Aghdam Concordia University

Weighted Graphs. Weighted graphs may be either directed or undirected.

Maximum Matching Width: new characterizations and a fast algorithm for dominating set

Propositional Logic. Combinatorial Problem Solving (CPS) Albert Oliveras Enric Rodríguez-Carbonell. May 17, 2018

CS553 Lecture Register Allocation I 3

(Upside-Down o Direct Rotation) β - Numbers

Lecture 20: Minimum Spanning Trees (CLRS 23)

On spanning trees and cycles of multicolored point sets with few intersections

a 1and x is any real number.

Case Study 1 PHA 5127 Fall 2006 Revised 9/19/06

Y 0. Standing Wave Interference between the incident & reflected waves Standing wave. A string with one end fixed on a wall

Recounting the Rationals

Mathematics 1110H Calculus I: Limits, derivatives, and Integrals Trent University, Summer 2018 Solutions to the Actual Final Examination

BINOMIAL COEFFICIENTS INVOLVING INFINITE POWERS OF PRIMES

f(x + h) f(x) f (x) = lim

MAT 270 Test 3 Review (Spring 2012) Test on April 11 in PSA 21 Section 3.7 Implicit Derivative

SPH4U Electric Charges and Electric Fields Mr. LoRusso

Discrete Fourier Transform. Discrete Fourier Transform. Discrete Fourier Transform. Discrete Fourier Transform. Discrete Fourier Transform

cycle that does not cross any edges (including its own), then it has at least

Atomic Physics. Final Mon. May 12, 12:25-2:25, Ingraham B10 Get prepared for the Final!

64. A Conic Section from Five Elements.

N1.1 Homework Answers

First order differential equation Linear equation; Method of integrating factors

Kernels. ffl A kernel K is a function of two objects, for example, two sentence/tree pairs (x1; y1) and (x2; y2)

16.unified Introduction to Computers and Programming. SOLUTIONS to Examination 4/30/04 9:05am - 10:00am

International Journal of Scientific & Engineering Research, Volume 6, Issue 7, July ISSN

Unit 6: Solving Exponential Equations and More

Rikkert Frederix. Figure 2: As in fig. 1, for the transverse momentum of the 1 st jet.

Schematic of a mixed flow reactor (both advection and dispersion must be accounted for)

Compton Scattering. There are three related processes. Thomson scattering (classical) Rayleigh scattering (coherent)

Carriers Concentration in Semiconductors - VI. Prof.P. Ravindran, Department of Physics, Central University of Tamil Nadu, India

Abstract Interpretation: concrete and abstract semantics

Basic Polyhedral theory

CMU Fall VLSI CAD

The tangent line and the velocity problems. The derivative at a point and rates of change. , such as the graph shown below:

Case Study Vancomycin Answers Provided by Jeffrey Stark, Graduate Student

OVERFLOW IN A CYLINDRICAL PIPE BEND. 1. Introduction. Fig. 1: Overflow in a cylindrical pipe bend

u x v x dx u x v x v x u x dx d u x v x u x v x dx u x v x dx Integration by Parts Formula

Lecture 37 (Schrödinger Equation) Physics Spring 2018 Douglas Fields

The University of Sydney MATH 2009

Security Constrained Optimal Power Flow

232 Calculus and Structures

CSE 373: More on graphs; DFS and BFS. Michael Lee Wednesday, Feb 14, 2018

Deift/Zhou Steepest descent, Part I

Shortest Paths in Graphs. Paths in graphs. Shortest paths CS 445. Alon Efrat Slides courtesy of Erik Demaine and Carola Wenk

Solutions to Homework 5

Outline. Computer Science 331. Computation of Min-Cost Spanning Trees. Costs of Spanning Trees in Weighted Graphs

CPSC 665 : An Algorithmist s Toolkit Lecture 4 : 21 Jan Linear Programming

Paths. Connectivity. Euler and Hamilton Paths. Planar graphs.

k m The reason that his is very useful can be seen by examining the Taylor series expansion of some potential V(x) about a minimum point:

Logarithmic functions

Priority Search Trees - Part I

Chapter 10. The singular integral Introducing S(n) and J(n)

Transcription:

Yufi Tao ITEE Univrsity of Qunslan

In tis lctur, w will stuy anotr classic prolm: finin a minimum spannin tr of an unirct wit rap. Intrstinly, vn tou t prolm appars ratr iffrnt from SSSP (sinl sourc sortst pat), it can solv y an aloritm tat is rminiscnt of Dijkstra s aloritm.

Unirct Wit Graps Lt G = (V, E) an unirct rap. Lt w a function tat maps ac of G to a positiv intr valu. Spcifically, for ac, w() is a positiv intr valu, wic w call t wit of. A unirct wit rap is fin as t pair (G, w). W will not an twn vrtics u an v in G as {u, v} insta of (u, v) to mpasiz tat t orrin of u, v os not mattr. W consir tat G is connct, namly, tr is a pat twn any two vrtics in V.

Exampl a 7 f 8 0 c 6 T intr on ac inicats its wit. For xampl, t wit of {, } is 9, an tat of {, } is.

Spannin Trs Rmmr tat a tr is fin as a connct unirct rap wit no cycls. Givn a connct unirct wit rap (G, w) wit G = (V, E), a spannin tr T is a tr satisfyin t followin conitions: T vrtx st of T is V. Evry of T is an in G. T cost of T is fin as t sum of t wits of all t s in T (not tat T must av V s).

Exampl a 7 f 8 0 c 6 a f a f a 8 7 f c 6 c 6 c T scon row sows tr spannin trs (of t rap in t first row). T cost of t first two trs is 7, an tat of t rit tr is 48.

T Minimum Spannin Tr Prolm Givn a connct unirct wit rap (G, w) wit G = (V, E), t oal of t minimum spannin tr (MST) prolm is to fin a spannin tr of t smallst cost. Suc a tr is call an MST of (G, w).

Exampl a 7 f 8 0 c 6 a f a f c 6 c 6 Bot trs in t scon row ar MSTs. Tis mans tat MSTs may not uniqu.

Prim s Aloritm Nxt, w will iscuss an aloritm call Prim s aloritm for solvin t MST prolm. W assum tat G is stor in t ajacncy list format. Rcall tat an {u, v} is rprsnt twic: onc y placin u in t ajacncy list of of v, an anotr tim y placin v in t ajacncy list of u. T wit of {u, v} is stor in ot placs.

Prim s Aloritm T aloritm rows a tr T mst y incluin on vrtx at a tim. At any momnt, it ivis t vrtx st V into two parts: T st S of vrtics tat ar alray in T mst. T st of otr vrtics: V \ S. At t n of t aloritm, S = V. If an conncts a vrtx in V an a vrtx in V \ S, w call it an xtnsion. At all tims, t aloritm nforcs t followin litst xtnsion principl: For vry vrtx v V \ S, it rmmrs wic xtnsion of v as t smallst wit rfrr to as t litst xtnsion of v, an not as st-xt(v).

Prim s Aloritm. Lt {u, v} an wit t smallst wit amon all s.. St S = {u, v}. Initializ a tr T mst wit only on {u, v}.. Enforc t litst xtnsion principl: For vry vrtx z of V \ S If z is a nior of u, ut not of v st-xt(z) = {z, u} If z is a nior of v, ut not of u st-xt(z) = {z, v} Otrwis st-xt(z) = t litr twn {z, u} an {z, v}

Prim s Aloritm 4. Rpat t followin until S = V : 5. Gt an xtnsion {u, v} wit t smallst wit /* Witout loss of nrality, suppos u S an v / S */ 6. A v into S, an a {u, v} into T mst /* Nxt, w rstor t litst xtnsion principl. */ 7. for vry {v, z} of v: If z / S tn If st-xt(z) is avir tan {v, z} tn St st-xt(z) = {v, z}

Exampl E {a, } is t litst of all. So, at t innin S = {a, }. T MST w ar rowin now as on {a, }. a 7 f 8 0 c 6 vrtx v st-xt(v) an wit a c {c, a}, nil, {, }, 0 f {a, f }, 7 {, }, {a, }, 8 Not: Es {c, a} an {c, } av t sam wit. Eitr of tm can st-xt(c).

Exampl E {c, a} is t litst xtnsion. So, w a c to S, wic is now S = {a,, c}. A {c, a} into t MST. a 7 f 8 0 c 6 vrtx v st-xt(v) an wit a c nil, {, }, 0 f {c, f }, 5 {, }, {c, }, 6

Exampl E {c, f } is t litst xtnsion. So, w a f to S, wic is now S = {a,, c, f }. A {c, f } into t MST. a 7 f 8 0 c 6 vrtx v st-xt(v) an wit a c nil, {, f }, f {, }, {c, }, 6

Exampl E {, f } is t litst xtnsion. So, w a to S, wic is now S = {a,, c, f, }. A {, f } into t MST. a 7 f 8 0 c 6 vrtx v st-xt(v) an wit a c {, }, f {, }, {c, }, 6

Exampl E {c, } is t litst xtnsion. So, w a to S, wic is now S = {a,, c, f,, }. A {c, } into t MST. a 7 f 8 0 c 6 vrtx v st-xt(v) an wit a c {, }, f {, }, 9

Exampl E {, } is t litst xtnsion. So, w a to S, wic is now S = {a,, c, f,, }. A {, } into t MST. a 7 f 8 0 c 6 vrtx v st-xt(v) an wit a c {, }, f

Exampl Finally, {, } is t litst xtnsion. So, w a to S, wic is now S = {a,, c, f,,,, }. A {, } into t MST. a 7 f 8 0 c 6 vrtx v a c f st-xt(v) an wit W av otain our final MST.

Nxt w will prov tat t aloritm is corrct, namly, t tr output is in an MST. W will o so y inuction on t squnc of t s a to t tr. Spcifically, t claim to provn is: Claim: For any i [, V ], tr must an MST containin all t first i s cosn y our aloritm. Tn t aloritm s corrctnss follows from t aov claim at i = V.

Corrctnss Proof Lt us first rcall a funamntal proprty of unirct raps: Lmma: Lt T a tr of n vrtics. Ain an aritrary twn two vrtics in T introucs a cycl. Proof: Suppos tat t is a twn u an v. Bfor t was a, tr is alray a pat allowin us to o from u to v in T. Trfor, t {u, v} allows us to mov from v ack to u, tus witnssin a cycl.

Corrctnss Proof Now w proc to prov t claim on Sli 0. Bas Cas: i =. Lt {u, v} an wit t smallst wit in t rap. W will prov tat t must xist in som MST. Tak any MST T tat os not contain {u, v}. A t to T, wic crats a cycl. Rmov an aritrary in T suc tat {u, v}, wic ivs a nw tr T. Sinc {u, v} as t smallst wit, t cost of T is smallr tan or qual to tat of T. Tis mans tat T is also an MST. Hnc, t claim ols for i =.

Corrctnss Proof Inuctiv Cas: Assumin tat t claim ols for i k (k ), nxt w prov tat it also ols for i = k. Lt {u, v} t k-t a y our aloritm, an S t st of vrtics alray in t aloritm s tr for t aition of {u, v}. Witout loss of nrality, suppos tat u S, an v / S. By t inuctiv assumption, w know tat tr is som MST T tat inclus all t first k s. If T also inclus {u, v}, tn t claim alray ols. Nxt, w consir t cas wr T os not av {u, v}.

Corrctnss Proof W a {u, v} to T, wic crats a cycl. Lt us walk on tis cycl startin from v, cross {u, v} into S, kp walkin witin S until travlin out of S for t first tim. Lt t tat rout us out of S {u, v }. S u v V \ S u v Not tat ot {u, v} an {u, v } ar xtnsion s rit for t momnt our aloritm picks t k-t. Sinc {u, v} as t smallst wit amon all t xtnsion s, w know tat t wit of {u, v} is smallr tan or qual to tat of {u, v }.

Corrctnss Proof Now, rmov {u, v } from T, wic ivs anotr tr T. T cost of T cannot mor tan tat of T. Tis mans tat T must also an MST. W tus av prov tat t claim ols for i = k as wll.

Runnin Tim It will lft as an xrcis for you to apply t ata structurs you av larn to implmnt Prim s aloritm in O(( V + E ) lo V ) tim. Rmark: Usin aain an avanc ata structur (call t Fionacci Hap) tat will not covr in tis cours, w can improv t runnin tim to O( V lo V + E ).