Minimum Spanning Tree Union-Find Data Structure. Feb 28, 2018 CSCI211 - Sprenkle. Comcast wants to lay cable in a neighborhood. Neighborhood Layout

Similar documents
CS 4407 Algorithms Greedy Algorithms and Minimum Spanning Trees

Proving correctness of Stable Matching algorithm Analyzing algorithms Asymptotic running times

Spatial Chaining Methods for International Comparisons of Prices and Real Expenditures D.S. Prasada Rao The University of Queensland

Text UI. Data Store Ø Example of a backend to a real Could add a different user interface. Good judgment comes from experience

CSCI211: Intro Objectives

Objec&ves. Usability Project Discussion. May 9, 2016 Sprenkle - CSCI335 1

Political Districting for Elections to the German Bundestag: An Optimization-Based Multi-Stage Heuristic Respecting Administrative Boundaries

Coalitional Game Theory

The Australian Society for Operations Research

Analyzing proofs Introduction to problem solving. Wiki: Everyone log in okay? Decide on either using a blog or wiki-style journal?

Kruskal's MST Algorithm with step-by-step execution

Prim's MST Algorithm with step-by-step execution

Designing a Social Network Prep for Lab 10. March 26, 2018 Sprenkle - CSCI Why classes and objects? How do we create new data types?

Uninformed search. Lirong Xia

CSCI 325: Distributed Systems. Objec?ves. Professor Sprenkle. Course overview Overview of distributed systems Introduc?on to reading research papers

ECE250: Algorithms and Data Structures Trees

Coverage tools Eclipse Debugger Object-oriented Design Principles. Oct 26, 2016 Sprenkle - CSCI209 1

Search Trees. Chapter 10. CSE 2011 Prof. J. Elder Last Updated: :51 PM

Constraint satisfaction problems. Lirong Xia

STUDY GUIDE FOR TEST 2

HASHGRAPH CONSENSUS: DETAILED EXAMPLES

Designing police patrol districts on street network

Estimating the Margin of Victory for Instant-Runoff Voting

Title: Solving Problems by Searching AIMA: Chapter 3 (Sections 3.1, 3.2 and 3.3)

A MINIMUM DISTANCE AND THE GENERALISED EKS APPROACHES TO MULTILATERAL COMPARISONS OF PRICES AND REAL INCOMES

Review: SoBware Development

Aggregating Dependency Graphs into Voting Agendas in Multi-Issue Elections

Priority Queues & Heaps

Satisfaction Approval Voting

Computational Social Choice: Spring 2017

arxiv: v1 [cs.gt] 11 Jul 2018

Hat problem on a graph

Quantum theory of scattering by a potential. Lecture notes 8 (based on CT, Sec4on 8)

Priority Queues & Heaps

How hard is it to control sequential elections via the agenda?

Combating Friend Spam Using Social Rejections

Midterm Review. EECS 2011 Prof. J. Elder - 1 -

Influence in Social Networks

Comparison Sorts. EECS 2011 Prof. J. Elder - 1 -

Adapting the Social Network to Affect Elections

Cloning in Elections

Cluster Analysis. (see also: Segmentation)

NEW YORK CITY COLLEGE OF TECHNOLOGY The City University of New York

Overview. Ø Neural Networks are considered black-box models Ø They are complex and do not provide much insight into variable relationships

Computational challenges in analyzing and moderating online social discussions

Lab 11: Pair Programming. Review: Pair Programming Roles

Support Vector Machines

File Systems: Fundamentals

Coalitional Game Theory for Communication Networks: A Tutorial

c M. J. Wooldridge, used by permission/updated by Simon Parsons, Spring

Dimension Reduction. Why and How

Bribery in voting with CP-nets

Priority Queues & Heaps

Tengyu Ma Facebook AI Research. Based on joint work with Rong Ge (Duke) and Jason D. Lee (USC)

Patterns in Congressional Earmarks

Online Appendix: Trafficking Networks and the Mexican Drug War

A Framework for the Quantitative Evaluation of Voting Rules

Improved Boosting Algorithms Using Confidence-rated Predictions

Real-Time Wireless Control Networks for Cyber-Physical Systems

11/15/13. Objectives. Review. Our Screen Saver Dependencies. Our Screen Saver Dependencies. Project Deliverables Timeline TEAM FINAL PROJECT

Evaluation of election outcomes under uncertainty

Objec&ves. Tes&ng 11/8/16. by Frederick P. Brooks, Jr., 1986

Multi-Winner Elections: Complexity of Manipulation, Control, and Winner-Determination

MAC 2311 CALCULUS 1 FALL SEMESTER 2015

Tengyu Ma Facebook AI Research. Based on joint work with Yuanzhi Li (Princeton) and Hongyang Zhang (Stanford)

Decentralised solutions for renewable energies and water in developing countries

A constraint based dependancy parser for Sanskrit

Contact 3-Manifolds, Holomorphic Curves and Intersection Theory

Event Based Sequential Program Development: Application to Constructing a Pointer Program

Complexity of Manipulating Elections with Few Candidates

Real- Time Wireless Control Networks for Cyber- Physical Systems

Cloning in Elections 1

LED545-series TECHNICAL DATA. Specifications. Absolute Maximum Ratings (T a =25 C) Electro-Optical Characteristics (T a =25 C)

arxiv: v1 [cs.cc] 29 Sep 2015

LED1200-series TECHNICAL DATA. Specifications. Absolute Maximum Ratings (T a =25 C) Electro-Optical Characteristics (T a =25 C)

Need for a uniform European registra2on system for volunteer par2cipa2on? Annick Peremans Research Centre Aalst Belgium

From Argument Games to Persuasion Dialogues

Lab 3: Logistic regression models

Analyzing and Representing Two-Mode Network Data Week 8: Reading Notes

Agenda trees and sincere voting: a response to Schwartz

NETWORK ANALYSIS OF INTERNATIONAL MIGRATION

CS269I: Incentives in Computer Science Lecture #4: Voting, Machine Learning, and Participatory Democracy

A Mathematical View on Voting and Power

Evaluation of Election Outcomes under Uncertainty

LED700-series TECHNICAL DATA. Specifications. Absolute Maximum Ratings (T a =25 C) Electro-Optical Characteristics (T a =25 C)

Chapter. Sampling Distributions Pearson Prentice Hall. All rights reserved

Chapter 11. Weighted Voting Systems. For All Practical Purposes: Effective Teaching

Objec&ves. Review. So-ware Quality Metrics Sta&c Analysis Tools Refactoring for Extensibility

Graph Structurings. 16. How to Structure Large Models - Obligatory Reading. Ø T. Fischer, Jörg Niere, L. Torunski, and Albert Zündorf, 'Story

Do two parties represent the US? Clustering analysis of US public ideology survey

Connecting Voting Theory and Graph Theory

HANDS ACROSS BORDERS. An International Workshop on. Alterna(ve Mechanisms to Establish and Govern Transboundary Conserva(on Ini(a(ves

Computational Social Choice: Spring 2007

arxiv: v5 [cs.gt] 21 Jun 2014

Sector Discrimination: Sector Identification with Similarity Digest Fingerprints

Randomized Pursuit-Evasion in Graphs

ÔÖ Î µ ÛÖ Î Ø Ø Ó ÚÖØ ÖÔ Ø Ø Ó º ØØ Û Ö ÚÒ Ø Ò Ú ¼ ½ Ú ½ ¾ Ú ¾ Ú Ú ½ ÒÒ ÙÒØÓÒ Eº ÏÐ Ò Ø ÖÔ ÕÙÒ Ú ÛÖ Ú ¼ Ú ¾ Î ½ ¾ Ò E µ Ú ½ Ú º Ì ÛÐ ÐÓ Ø Ö Ø Ò Ð Ø ÚÖ

Are Friends Overrated? A Study for the Social News Aggregator Digg.com

A Network Theory of Military Alliances

A Calculus for End-to-end Statistical Service Guarantees

Transcription:

Objec&ves Minimum Spanning Tree Union-Find Data Structure Feb, 0 CSCI - Sprenkle Started teasing out some algorithms. Laying Cable Focus on commonality: what should our final solution look like? Comcast wants to lay cable in a neighborhood Ø Reach all houses Ø Least cost Neighborhood Layout Cost of laying cable btw houses depends on amount of cable, landscaping, obstacles, etc. 9 Feb, 0 CSCI - Sprenkle

Minimum Spanning Tree (MST) Spanning tree: spans all nodes in graph Given a connected graph G = (V, E) with posi&ve edge weights c e, an MST is a subset of the edges T E such that T is a spanning tree whose sum of edge weights is minimized 0 G = (V, E) 9 9 T, Σ e T c e = 0 Feb, 0 CSCI - Sprenkle Examples Identify spanning trees and which is the minimal spanning tree. Graph A B C D Feb, 0 CSCI - Sprenkle

Examples Identify spanning trees and which is the minimal spanning tree. Graph A B A B MST: C D C D Other Spanning Trees: A B A B C D C D Feb, 0 CSCI - Sprenkle MST Applica&ons Network design Ø telephone, electrical, hydraulic, TV cable, computer, road Approxima&on algorithms for NP-hard problems Ø traveling salesperson problem, Steiner tree Indirect applica&ons Ø max bozleneck paths Ø image registra&on with Renyi entropy Ø learning salient features for real-&me face verifica&on Ø reducing data storage in sequencing amino acids in a protein Ø model locality of par&cle interac&ons in turbulent fluid flows Cluster analysis http://www.ics.uci.edu/ ~eppstein/gina/mst.html Feb, 0 CSCI - Sprenkle

Ideas for Solu&ons? Cayley's Theorem. There are n n- spanning trees Towards a solu&on Ø Where to start? can't solve by brute force 0 9 G = (V, E) Feb, 0 CSCI - Sprenkle Minimum Spanning Tree Given a connected graph G = (V, E) with posi&ve edge weights c e, an MST is a subset of the edges T E such that T is a spanning tree whose sum of edge weights is minimized 0 G = (V, E) 9 Why must the solution be a tree? Feb, 0 CSCI - Sprenkle T, Σ e T c e = 0 9

Minimum Spanning Tree Assume have a minimal solu&on that is not a tree, i.e., it has a cycle What could we do? Ø What do we know about the edges? Ø How does that change the cost of the solu&on? Feb, 0 CSCI - Sprenkle 9 Minimum Spanning Tree Proof by Contradic&on. Assume have a minimal solu&on V that is not a tree, i.e., it has a cycle Contains edges to all nodes because solu&on must be connected (spanning) Remove an edge from the cycle Ø Can s&ll reach all nodes (could go long way around ) Ø But at lower total cost Ø Contradic&on to our minimal solu&on Feb, 0 CSCI - Sprenkle 0

Greedy Algorithms All three algorithms produce a MST Prim's algorithm. Ø Start with some root node s and greedily grow a tree T from s outward Ø At each step, add cheapest edge e to T that has exactly one endpoint in T Ø Similar to Dijkstra s (but simpler) Kruskal's algorithm. Ø Start with T = φ Ø Consider edges in ascending order of cost Ø Insert edge e in T unless doing so would create a cycle Reverse-Delete algorithm. Ø Start with T = E Ø Consider edges in descending order of cost Ø Delete edge e from T unless doing so would disconnect T What do these algorithms have/do/check in common? Feb, 0 CSCI - Sprenkle What Do These Algorithms Have in Common? When is it safe to include an edge in the minimum spanning tree? Cut Property When is it safe to eliminate an edge from the minimum spanning tree? Cycle Property Feb, 0 CSCI - Sprenkle

Cut and Cycle Proper&es Simplifying assump&on: All edge costs c e are dis&nct MST is unique Cut property. Let S be any subset of nodes, and let e be the min cost edge with exactly one endpoint in S. Then MST contains e. Cycle property. Let C be any cycle, and let f be the max cost edge belonging to C. Then MST does not contain f. f C S e Cut Property: e is in MST Cycle Property: f is not in MST Let s try to prove these Feb, 0 CSCI - Sprenkle Cycles and Cuts Cycle. Set of edges in the form a-b, b-c, c-d,, y-z, z-a Cycle C = -, -, -, -, -, - Feb, 0 CSCI - Sprenkle

Cycles and Cuts Cycle. Set of edges in the form a-b, b-c, c-d,, y-z, z-a Cycle C = -, -, -, -, -, - Cutset. A cut is a subset of nodes S. The corresponding cutset D is the subset of edges with exactly one endpoint in S. Feb, 0 CSCI - Sprenkle Cut S = {,, } Cutset D = -, -, -, -, - Cycle-Cut Intersec&on Claim. A cycle and a cutset intersect in an even number of edges Cycle C = -, -, -, -, -, - Cut S = {,, } Cutset D = -, -, -, -, - Intersection = -, - What are the possibilities for the cycle? Feb, 0 CSCI - Sprenkle

Cycle-Cut Intersec&on Claim. A cycle and a cutset intersect in an even number of edges Proof sketch Cycle C = -, -, -, -, -, - Cut S = {,, } Cutset D = -, -, -, -, - Intersection = -, -. Cycle all in S. Cycle not in S. Cycle has to go from SàV-S and back (Cut) S Edges link to not-cut V - S Feb, 0 CSCI - Sprenkle Proving Cut Property: OK to Include Edge Simplifying assump&on: All edge costs c e are dis&nct. Cut property. Let S be any subset of nodes, and let e be the min cost edge with exactly one endpoint in S. Then the MST T* contains e. Pf.? Feb, 0 CSCI - Sprenkle 9

Proving Cut Property: OK to Include Edge Simplifying assump&on: All edge costs c e are dis&nct. Cut property. Let S be any subset of nodes, and let e be the min cost edge with exactly one endpoint in S. Then the MST T* contains e. Pf. (exchange argument) Ø Suppose there is an MST T* that does not contain e What do we know about T, by defn? What do we know about the nodes e connects? Feb, 0 CSCI - Sprenkle 9 Proving Cut Property: OK to Include Edge Cut property. Let S be any subset of nodes, and let e be the min cost edge with exactly one endpoint in S. Then the MST T* contains e. Pf. (exchange argument) Ø Suppose there is an MST T* that does not contain e Ø Adding e to T* creates a cycle C in T* Ø Edge e is in cycle C and in cutset corresponding to S there exists another edge, say f, that is in both C and S s cutset Which means? e Feb, 0 CSCI - Sprenkle 0 S f 0

Proving Cut Property: OK to Include Edge Cut property. Let S be any subset of nodes, and let e be the min cost edge with exactly one endpoint in S. Then the MST T* contains e. Pf. (exchange argument) Ø Suppose there is an MST T* that does not contain e Ø Adding e to T* creates a cycle C in T* Ø Edge e is in cycle C and in cutset corresponding to S there exists another edge, say f, that is in both C and S s cutset Ø T' = T* { e } - { f } is also a spanning tree Ø Since c e < c f, cost(t') < cost(t*) f Ø This is a contradic&on. S e Feb, 0 CSCI - Sprenkle Proving Cycle Property: OK to Remove Edge Simplifying assump&on: All edge costs c e are dis&nct Cycle property. Let C be any cycle in G, and let f be the max cost edge belonging to C. Then the MST T* does not contain f. Ideas about approach? Feb, 0 CSCI - Sprenkle

Cycle Property: OK to Remove Edge Cycle property. Let C be any cycle in G, and let f be the max cost edge belonging to C. Then the MST T* does not contain f. Pf. (exchange argument) Ø Suppose f belongs to T* Ø Dele&ng f from T* creates a cut S in T* Ø Edge f is both in the cycle C and in the cutset S there exists another edge, say e, that is in both C and S Ø T' = T* { e } - { f } is also a spanning tree Ø Since c e < c f, cost(t') < cost(t*) f Ø This is a contradic&on. S Feb, 0 CSCI - Sprenkle e Summary of What Just Proved Simplifying assump&on: All edge costs c e are dis&nct MST is unique Cut property. Let S be any subset of nodes, and let e be the min cost edge with exactly one endpoint in S. Then MST contains e. Cycle property. Let C be any cycle, and let f be the max cost edge belonging to C. Then MST does not contain f. f C S e Cut Property: e is in MST Cycle Property: f is not in MST Feb, 0 CSCI - Sprenkle

Prim s Algorithm [Jarník 90, Dijkstra 9, Prim 99] Start with some root node s and greedily grow a tree T from s outward. At each step, add the cheapest edge e to T that has exactly one endpoint in T. How can we prove its correctness? Feb, 0 CSCI - Sprenkle Prim s Algorithm: Proof of Correctness Ini&alize S to be any node Apply cut property to S Ø Add min cost edge (v, u) in cutset corresponding to S, and add one new explored node u to S S Ideas about implementation? Feb, 0 CSCI - Sprenkle

Looking Ahead Problem Set due Friday Feb, 0 CSCI - Sprenkle