(Minimum) Spanning Trees

Similar documents
Spanning Trees. BFS, DFS spanning tree Minimum spanning tree. March 28, 2018 Cinda Heeren / Geoffrey Tien 1

Lecture 20: Minimum Spanning Trees (CLRS 23)

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

CMPS 2200 Fall Graphs. Carola Wenk. Slides courtesy of Charles Leiserson with changes and additions by Carola Wenk

Minimum Spanning Trees (CLRS 23)

The University of Sydney MATH 2009

COMP 250. Lecture 29. graph traversal. Nov. 15/16, 2017

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

Lecture II: Minimium Spanning Tree Algorithms

Improving Union. Implementation. Union-by-size Code. Union-by-Size Find Analysis. Path Compression! Improving Find find(e)

4.1 Interval Scheduling. Chapter 4. Greedy Algorithms. Interval Scheduling: Greedy Algorithms. Interval Scheduling. Interval scheduling.

Graph Search (6A) Young Won Lim 5/18/18

5/1/2018. Huffman Coding Trees. Huffman Coding Trees. Huffman Coding Trees. Huffman Coding Trees. Huffman Coding Trees. Huffman Coding Trees

Minimum Spanning Trees (CLRS 23)

Theorem 1. An undirected graph is a tree if and only if there is a unique simple path between any two of its vertices.

2 Trees and Their Applications

Strongly connected components. Finding strongly-connected components

CSE 332. Data Structures and Parallelism

CSE 332. Graphs 1: What is a Graph? DFS and BFS. Data Abstractions. CSE 332: Data Abstractions. A Graph is a Thingy... 2

23 Minimum Spanning Trees

Divided. diamonds. Mimic the look of facets in a bracelet that s deceptively deep RIGHT-ANGLE WEAVE. designed by Peggy Brinkman Matteliano

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

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

CMSC 451: Lecture 4 Bridges and 2-Edge Connectivity Thursday, Sep 7, 2017

Applications of trees

CS 103 BFS Alorithm. Mark Redekopp

Grade 7/8 Math Circles March 4/5, Graph Theory I- Solutions

Single Source Shortest Paths (with Positive Weights)

12/3/12. Outline. Part 10. Graphs. Circuits. Euler paths/circuits. Euler s bridge problem (Bridges of Konigsberg Problem)

CSE 332. Graphs 1: What is a Graph? DFS and BFS. Data Abstractions. CSE 332: Data Abstractions. A Graph is a Thingy... 2

5/9/13. Part 10. Graphs. Outline. Circuits. Introduction Terminology Implementing Graphs

In which direction do compass needles always align? Why?

An undirected graph G = (V, E) V a set of vertices E a set of unordered edges (v,w) where v, w in V

23 Minimum Spanning Trees

Minimum Spanning Trees

CSC Design and Analysis of Algorithms. Example: Change-Making Problem

V={A,B,C,D,E} E={ (A,D),(A,E),(B,D), (B,E),(C,D),(C,E)}

V={A,B,C,D,E} E={ (A,D),(A,E),(B,D), (B,E),(C,D),(C,E)}

Graph Search Algorithms

Outline. Circuits. Euler paths/circuits 4/25/12. Part 10. Graphs. Euler s bridge problem (Bridges of Konigsberg Problem)

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

17 Basic Graph Properties

COMP108 Algorithmic Foundations

CS 461, Lecture 17. Today s Outline. Example Run

The R-Tree. Yufei Tao. ITEE University of Queensland. INFS4205/7205, Uni of Queensland

Closed Monochromatic Bishops Tours

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

Planar convex hulls (I)

CSE 373. Graphs 1: Concepts, Depth/Breadth-First Search reading: Weiss Ch. 9. slides created by Marty Stepp

18 Basic Graph Properties

Graphs Depth First Search

An Introduction to Clique Minimal Separator Decomposition

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

5/7/13. Part 10. Graphs. Theorem Theorem Graphs Describing Precedence. Outline. Theorem 10-1: The Handshaking Theorem

PRECAST APPROACH SLAB NOTES

Math 166 Week in Review 2 Sections 1.1b, 1.2, 1.3, & 1.4

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

Platform Controls. 1-1 Joystick Controllers. Boom Up/Down Controller Adjustments

(4, 2)-choosability of planar graphs with forbidden structures

Graphs. Graphs. Graphs: Basic Terminology. Directed Graphs. Dr Papalaskari 1

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

MATERIAL SEE BOM ANGLES = 2 FINISH N/A

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

Graphs Breadth First Search

CS 241 Analysis of Algorithms

MINI POST SERIES BALUSTRADE SYSTEM INSTALLATION GUIDE PRODUCT CODE: MPS-RP

, each of which is a tree, and whose roots r 1. , respectively, are children of r. Data Structures & File Management

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

b. How many ternary words of length 23 with eight 0 s, nine 1 s and six 2 s?

ECE COMBINATIONAL BUILDING BLOCKS - INVEST 13 DECODERS AND ENCODERS

L.3922 M.C. L.3922 M.C. L.2996 M.C. L.3909 M.C. L.5632 M.C. L M.C. L.5632 M.C. L M.C. DRIVE STAR NORTH STAR NORTH NORTH DRIVE

Graphs. CSC 1300 Discrete Structures Villanova University. Villanova CSC Dr Papalaskari

CS61B Lecture #33. Administrivia: Autograder will run this evening. Today s Readings: Graph Structures: DSIJ, Chapter 12

Having a glimpse of some of the possibilities for solutions of linear systems, we move to methods of finding these solutions. The basic idea we shall

Constructive Geometric Constraint Solving

Solutions for HW11. Exercise 34. (a) Use the recurrence relation t(g) = t(g e) + t(g/e) to count the number of spanning trees of v 1

CSCI 104 Graph Representation and Traversals. Mark Redekopp David Kempe

DOCUMENT STATUS: RELEASE

Problem solving by search

On Hamiltonian Tetrahedralizations Of Convex Polyhedra

Preview. Graph. Graph. Graph. Graph Representation. Graph Representation 12/3/2018. Graph Graph Representation Graph Search Algorithms

Instruction Scheduling, Register Allocation, Partial Redundancy Removal

Math 61 : Discrete Structures Final Exam Instructor: Ciprian Manolescu. You have 180 minutes.

Exam 1 Solution. CS 542 Advanced Data Structures and Algorithms 2/14/2013

OpenMx Matrices and Operators

Copyright 2000, Kevin Wayne 1

Data-Parallel Primitives for Spatial Operations Using PM. Quadtrees* primitives that are used to construct the data. concluding remarks.

N=4 L=4. Our first non-linear data structure! A graph G consists of two sets G = {V, E} A set of V vertices, or nodes f

The Constrained Longest Common Subsequence Problem. Rotem.R and Rotem.H

DOCUMENT STATUS: LA-S5302-XXXXS LA, SSS, TRICEPS EXTENSION VERY

CS200: Graphs. Graphs. Directed Graphs. Graphs/Networks Around Us. What can this represent? Sometimes we want to represent directionality:

Instruction Scheduling

MATERIAL SEE BOM ANGLES = 2 > 2000 DATE MEDIUM FINISH

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

SAMPLE CSc 340 EXAM QUESTIONS WITH SOLUTIONS: part 2

DOCUMENT STATUS: CORE HEALTH & FITNESS, LLC IL-D2002-XXAAX IP,DUAL ADJUSTIBLE PULLEY MATERIAL SEE BOM FINISH N/A N/A SHEET SIZE: B SCALE: 1:33.

Straight-line Grid Drawings of 3-Connected 1-Planar Graphs

Dental PBRN Study: Reasons for replacement or repair of dental restorations

Graph Search Algorithms CSE

Priority Search Trees - Part I

Transcription:

(Mnmum) Spnnn Trs Spnnn trs Kruskl's lortm Novmr 23, 2017 Cn Hrn / Gory Tn 1

Spnnn trs Gvn G = V, E, spnnn tr o G s onnt surp o G wt xtly V 1 s mnml sust o s tt onnts ll t vrts o G G = Spnnn trs Novmr 23, 2017 Cn Hrn / Gory Tn 2

Spnnn tr proprts A spnnn tr G = V, E must: ontn ll t vrts o G onnt not ontn yls A tr, ut not spnnn tr G = Contns ll t vrts n s t orrt numr o s, ut s yl n s not onnt Novmr 23, 2017 Cn Hrn / Gory Tn 3

Construtn spnnn trs Bk to trvrsls Spnnn trs n onstrut y prormn trvrsl strtn rom ny vrtx, mrkn trvl s n vst vrts.. Brt-rst sr, Dpt-rst sr Novmr 23, 2017 Cn Hrn / Gory Tn 4

DFS spnnn tr Root t DFS spnnn tr t ny vrtx,.. Mrk vrts n s us n DFS trvrsl,,,,,,,, E,,,, Rturn G = V, E Novmr 23, 2017 Cn Hrn / Gory Tn 5

BFS spnnn tr Root t DFS spnnn tr t ny vrtx,.. Mrk vrts n s us n BFS trvrsl,,,,,,,, E,,,, Rturn G = V, E Novmr 23, 2017 Cn Hrn / Gory Tn 6

Mnmum spnnn trs T suprm rulr o Grpln s pskt Prolm: nstlln wtrwys n Grpln to supply ll t rsntl/ommrl/t. strts ut t osts $5 pr unt stn to onstrut t wtrwy Fn onurton o mnml ost tt onnts ll t strts Ts s mnml spnnn tr Novmr 23, 2017 Cn Hrn / Gory Tn 7

Mnml spnnn tr Gvn onnt rp G = V, E wt unonstrn wts Output rp G = V, E wt t ollown rtrsts G s spnnn surp o G Alortm rqurmnts G s onnt n yl (.. tr) T sum o t wts o E s mnml mon ll su spnnn trs A A A 8 2 4 4 2 B 7 C 1 D B C 1 D B C 1 D 2 3 9 5 2 3 5 2 3 5 E F E F E F Wt = 15 Wt = 13 Novmr 23, 2017 Cn Hrn / Gory Tn 8

Kruskl's lortm or mnmum spnnn trs Gry lortm, puls n 1956 Buls spnnn tr rom svrl onnt omponnts Rptly ooss t mnmum-wt jonn two onnt omponnts, w os not orm yl, untl st s V 1 s KrusklsAlortm() { st E = ø wl ( E V 1) { Fn mnmum wt E su tt E A to E } } os not ontn yls Novmr 23, 2017 Cn Hrn / Gory Tn 9

Kruskl's lortm Dt typs or mplmntton KrusklsAlortm() { st E = ø wl ( E V 1) { Fn mnmum wt E su tt E A to E } } os not ontn yls W n ADTs tt support our rqur oprtons ntly How o w n t mnmum wt? Prorty quu! How n w k or yls n prorm unon? Dsjont sts! Novmr 23, 2017 Cn Hrn / Gory Tn 10

Kruskl's lortm Exmpl D 16 9 A 8 12 G 6 10 2 C 13 F 4 B 3 17 5 11 H 7 16 E MST wt: 38 13 A prq A, B 2 B, C 3 G, H 4 E, F 5 F, G 10 F, H 11 D, F 12 B, G 13 E B C D G A, C 6 C, F 13 F H B, E 7 A, D 16 prq ost p orr rry ul rmovmn Not tt no nsrtons prorm tr ul C, D 8 E, H 16 Ovrll ost? D, G 9 C, E 17 Not: only on rton lst n prq or omptnss n ts sl Novmr 23, 2017 Cn Hrn / Gory Tn 11

A slt tnnt mz onstruton Wt mks oo mz? A un o jnt rooms E room s vrtx Opn wll twn rooms orm n Unprtl, not sly solv Hly rnn, mny ns Just nou wlls to t rom ny room to ny otr room Esplly strt n ns out Novmr 23, 2017 Cn Hrn / Gory Tn 12

Mz unr onstruton So r, numr o wlls v n knok own, wl otrs rmn Now w onsr t wll twn rooms A n B Soul w knok t own? I A n B r otrws onnt I A n B r not otrws onnt A B Alortm: Wl s rmn n E Rmov rnom = u, v rom E I u n v v not n onnt A to E Mrk u n v s onnt Ts s lot lk Kruskl's lortm! Solv t usn sjont sts n rnom slton Novmr 23, 2017 Cn Hrn / Gory Tn 13

Rns or ts lsson Wkp ttps://n.wkp.or/wk/kruskl%27s_lortm Nxt lss: Komn Cptr 12.6 (Prm's lortm, sortst pts) Novmr 23, 2017 Cn Hrn / Gory Tn 14