Minimum Spanning Trees COSC 594: Graph Algorithms Spring By Kevin Chiang and Parker Tooley

Similar documents
Theorem 2.9: nearest addition algorithm

Autumn Minimum Spanning Tree Disjoint Union / Find Traveling Salesman Problem

2 A Template for Minimum Spanning Tree Algorithms

Minimum Spanning Trees. CSE 373 Data Structures

Design and Analysis of Algorithms

Chapter 9 Graph Algorithms

11/22/2016. Chapter 9 Graph Algorithms. Introduction. Definitions. Definitions. Definitions. Definitions

Minimum Spanning Trees

1 Minimum Spanning Trees: History

Chapter 9 Graph Algorithms

Notes on Minimum Spanning Trees. Red Rule: Given a cycle containing no red edges, select a maximum uncolored edge on the cycle, and color it red.

Chapter 9 Graph Algorithms

Introduction to Algorithms

Minimum Spanning Trees

COMP 355 Advanced Algorithms

Introduction to Algorithms

Minimum Spanning Trees My T. UF

Introduction to Algorithms

2 Approximation Algorithms for Metric TSP

1 The Traveling Salesman Problem

22 Elementary Graph Algorithms. There are two standard ways to represent a

22 Elementary Graph Algorithms. There are two standard ways to represent a

Elementary Graph Algorithms: Summary. Algorithms. CmSc250 Intro to Algorithms

Minimum Spanning Trees. Minimum Spanning Trees. Minimum Spanning Trees. Minimum Spanning Trees

1 The Traveling Salesman Problem

Lecture 13. Reading: Weiss, Ch. 9, Ch 8 CSE 100, UCSD: LEC 13. Page 1 of 29

1 Minimum Spanning Trees (MST) b 2 3 a. 10 e h. j m

Homework 5: Graphs, Minimum Spanning Trees, and Dijkstra Shortest-Path

Undirected Graphs. Hwansoo Han

Spanning Trees. Lecture 20 CS2110 Spring 2015

Randomized Graph Algorithms

Lecture 8: The Traveling Salesman Problem

CS60020: Foundations of Algorithm Design and Machine Learning. Sourangshu Bhattacharya

Algorithms. Algorithms. Algorithms 4.3 MINIMUM SPANNING TREES

Lecture 10: Analysis of Algorithms (CS ) 1

Chapter 9. Greedy Technique. Copyright 2007 Pearson Addison-Wesley. All rights reserved.

Theory of Computing. Lecture 10 MAS 714 Hartmut Klauck

Minimum-Cost Spanning Tree. Example

Example. Minimum-Cost Spanning Tree. Edge Selection Greedy Strategies. Edge Selection Greedy Strategies

Chapter 4. Greedy Algorithms. Slides by Kevin Wayne. Copyright 2005 Pearson-Addison Wesley. All rights reserved.

Spanning Trees 4/19/17. Prelim 2, assignments. Undirected trees

Spanning Trees. Lecture 22 CS2110 Spring 2017

CS 561, Lecture 9. Jared Saia University of New Mexico

Minimum Spanning Tree (5A) Young Won Lim 5/11/18

Chapter 4. Greedy Algorithms. Slides by Kevin Wayne. Copyright 2005 Pearson-Addison Wesley. All rights reserved.

Spanning Trees, greedy algorithms. Lecture 22 CS2110 Fall 2017

Institute of Operating Systems and Computer Networks Algorithms Group. Network Algorithms. Tutorial 4: Matching and other stuff

Algorithm Design (8) Graph Algorithms 1/2

10/31/18. About A6, Prelim 2. Spanning Trees, greedy algorithms. Facts about trees. Undirected trees

Decreasing a key FIB-HEAP-DECREASE-KEY(,, ) 3.. NIL. 2. error new key is greater than current key 6. CASCADING-CUT(, )

Spanning Trees, greedy algorithms. Lecture 20 CS2110 Fall 2018

CS270 Combinatorial Algorithms & Data Structures Spring Lecture 19:

Spanning Tree. Lecture19: Graph III. Minimum Spanning Tree (MSP)

Algorithms for Minimum Spanning Trees

Polynomial time approximation algorithms

Minimum-Spanning-Tree problem. Minimum Spanning Trees (Forests) Minimum-Spanning-Tree problem

23.2 Minimum Spanning Trees

CS 5321: Advanced Algorithms Minimum Spanning Trees. Acknowledgement. Minimum Spanning Trees

CSE 521: Design and Analysis of Algorithms I

CSE 100: GRAPH ALGORITHMS

CSC 505, Fall 2000: Week 7. In which our discussion of Minimum Spanning Tree Algorithms and their data Structures is brought to a happy Conclusion.

9. Which situation is true regarding a cascading cut that produces c trees for a Fibonacci heap?

CAD Algorithms. Categorizing Algorithms

(Refer Slide Time: 01:00)

Minimum Spanning Trees

Week 11: Minimum Spanning trees

Assignment 5: Solutions

Chapter 4. Greedy Algorithms. Slides by Kevin Wayne. Copyright 2005 Pearson-Addison Wesley. All rights reserved.

Announcements Problem Set 5 is out (today)!

COS 226 Lecture 19: Minimal Spanning Trees (MSTs) PFS BFS and DFS examples. Classic algorithms for solving a natural problem

Algorithms and Theory of Computation. Lecture 5: Minimum Spanning Tree

Topics. Trees Vojislav Kecman. Which graphs are trees? Terminology. Terminology Trees as Models Some Tree Theorems Applications of Trees CMSC 302

CSE 100 Minimum Spanning Trees Prim s and Kruskal

Index. stack-based, 400 A* algorithm, 325

Algorithms and Theory of Computation. Lecture 5: Minimum Spanning Tree

looking ahead to see the optimum

Algorithm Design and Analysis

Traveling Salesperson Problem (TSP)

Discrete mathematics

Advanced Algorithms Class Notes for Monday, October 23, 2012 Min Ye, Mingfu Shao, and Bernard Moret

Minimum Spanning Trees

Model Answer. Section A Q.1 - (20 1=10) B.Tech. (Fifth Semester) Examination Analysis and Design of Algorithm (IT3105N) (Information Technology)

Artificial Intelligence

Traveling Salesman Problem. Algorithms and Networks 2014/2015 Hans L. Bodlaender Johan M. M. van Rooij

Approximation Algorithms

Department of Computer Applications. MCA 312: Design and Analysis of Algorithms. [Part I : Medium Answer Type Questions] UNIT I

Algorithms. Algorithms 4.3 MINIMUM SPANNING TREES. introduction greedy algorithm edge-weighted graph API Kruskal's algorithm Prim's algorithm context

Introduction to Optimization

Chapter 4. Greedy Algorithms. Slides by Kevin Wayne. Copyright 2005 Pearson-Addison Wesley. All rights reserved.

The minimum spanning tree problem

CS261: A Second Course in Algorithms Lecture #16: The Traveling Salesman Problem

CSE 100: B+ TREE, 2-3 TREE, NP- COMPLETNESS

CHAPTER 23. Minimum Spanning Trees

SPANNING TREES. Lecture 21 CS2110 Spring 2016

val(y, I) α (9.0.2) α (9.0.3)

Travelling Salesman Problem. Algorithms and Networks 2015/2016 Hans L. Bodlaender Johan M. M. van Rooij

Representations of Weighted Graphs (as Matrices) Algorithms and Data Structures: Minimum Spanning Trees. Weighted Graphs

Outline. CS38 Introduction to Algorithms. Approximation Algorithms. Optimization Problems. Set Cover. Set cover 5/29/2014. coping with intractibility

COP 4531 Complexity & Analysis of Data Structures & Algorithms

4. GREEDY ALGORITHMS II

Transcription:

Minimum Spanning Trees COSC 594: Graph Algorithms Spring 2017 By Kevin Chiang and Parker Tooley

Test Questions 1. What is one NP-Hard problem for which Minimum Spanning Trees is a good approximation for? 2. What was the purpose for the first development of a Minimum Spanning Tree algorithm? 3. Who initially wrote Prim's algorithm?

Parker Tooley

Kevin Chiang

Outline 1. 2. 3. 4. 5. 6. 7. Overview History Algorithms Implementations Applications Open Issues Discussion

Overview Spanning Tree - a subgraph of a undirected graph that is a tree including all vertices of the graph, with a minimum number of edges

Overview Minimum Spanning Tree - same as spanning tree, but with minimum total edge weights as well Note - MSTs with directed graphs is a different but analogous problem known as minimum spanning arborescence or optimum branching.

Overview Properties of spanning trees Fundamental cycle - adding any edge to a spanning tree forms a cycle All spanning trees of a graph have V -1 edges Fundamental cutset - deleting one edge of a spanning tree forms two disjoints sets

History First algorithm implementation was by Otakar Borůvka in 1926 purposed for electrical coverage of Moravia in the Czech Republic Otakar Borůvka

History Prim s algorithm was first discovered by Vojtěch Jarnik in 1930, later rediscovered by Robert C. Prim in 1957 Kruskal's algorithm was published in a paper by Joseph Kruskal in 1956 Faster, more complex algorithms have been found. Robert C. Prim Joseph Kruskal

Algorithms Classic, greedy algorithms: Prim's Algorithm Kruskal's Algorithm Borůvka's Algorithm Linear time algorithms Karger, Klein, and Tarjan's Algorithm Chazelle's Algorithm

Algorithms Prim s Algorithm Very similar to Dijkstra s algorithm Process: Start with a random vertex Repeatedly add the closest isolated vertex until the tree spans all nodes O(E + V Log V) using a fibonacci heap O(E Log V) Good with dense graphs

Algorithms Kruskal s algorithms Connects disjoint sets Process Sort edges in non-decreasing order Repeatedly include smallest unincluded edge, discard if cycle forms O(E Log V) Better with sparse graphs Works with spanning forests

Algorithms Borůvka s algorithm Broken into Borůvka s steps All edge weights must be distinct Process Each vertex initially its own set For each set, find the lowest cost edge combine sets, repeat O(ELogV)

Algorithms Classic, greedy algorithms: Prim's Algorithm O(E + VLogV) Kruskal's Algorithm O(ELogV) Borůvka's Algorithm O(ELogV) Linear time algorithms Karger, Klein, and Tarjan's Algorithm Chazelle's Algorithm

Algorithms Karger, Klein, and Tarjan's Algorithm Randomly creates two subgraphs Recursively find minimum spanning forests using Borůvka s steps Expected runtime, O(E) Worst-case O(min{V2, ELogV})

Algorithms Chazelle's Algorithm Fastest non-randomized, comparison based algorithm with known complexity Uses a data structure developed by Chazelle called a soft heap Amortized constant operations O(M*α(m,n)) -- α(m,n) is inverse Ackermann function, extremely slow growth

Implementation Timings Idea: compare Prim's and Kruskal's algorithms on graphs with the primary metric being density Standard implementation of Kruskal's with Union-Find, standard implementation of Prim's with binary heap

Implementations Dataset: 50 graphs with 500 vertices and random density (up to 400,000) edges Observation: Kruskal's is generally faster, though Prim's supposed to be faster as graphs become more dense Possible explanation: Python's sorting algorithm (timsort) is very efficient

Implementations Further tests confirm Kruskal having much better runtime than Prim's in Python 2000 vertices, 2 million edges for the densest graphs

Applications Networking Spanning Tree Protocol prevents loops and redundant paths in a switched network Laying out electrical grids Water supply networks Roads..etc Airports in the U.S.

Approximating TSP These algorithms approximate metric TSP (a NP-Hard problem), which are TSP problems with triangle-inequality: The least cost path from vertex i to j is always the path from i to j, rather than through some other vertex k

Approximating TSP Basic algorithm that is 2-approximate: Create a MST from root of TSP Perform a preorder traversal starting from the start point of the salesman, then add the salesman to the traversal as the end point

Approximating TSP How is it 2-approximate? An optimal TSP with an edge removed is a spanning tree Therefore, the weight of the MST <= TSP with edge removed Due to triangle inequality, 2->4 must be less than 2->1->4

Approximating TSP with Christofides Christofides Algorithm approximates TSP within a factor of 1.5 Algorithm Overview: 1. Create a minimum spanning tree T of graph G 2. Create a set of vertices O with odd degree vertices of T

Approximating TSP with Christofides 3. Find a minimum-weight perfect matching M of the induced subgraph given by vertices O

Approximating TSP with Christofides 4. Combine the edges of the minimum weight perfect matching and the minimum spanning tree to form multigraph H

Approximating TSP with Christofides 5. Form an Eulerian circuit of H 6. Create the Hamiltonian circuit by skipping repeated vertices

Applications Math expression handwriting recognition Symbols found using stroke analysis Need to find baselines Symbols have attraction points Use a minimum spanning tree algorithm Use a dominance function to better associate symbols with each other

Initial spanning tree of strokes Final tree of spacial relations

Applications Assisting Real-time salient object identification

Open issues Can the Euclidean minimum spanning tree of n points in d be computed in time close to the lower bound of Ω(V log V)

References https://en.wikipedia.org/wiki/minimum_spanning_tree https://en.wikipedia.org/wiki/soft_heap https://en.wikipedia.org/wiki/expected_linear_time_mst_algorithm https://en.wikipedia.org/wiki/bor%c5%afvka%27s_algorithm https://github.com/robert-emerson/6161_final/tree/master/boruvka_tree https://sites.google.com/site/wctu1009/cvpr16_mstsaliency http://www.geeksforgeeks.org/travelling-salesman-problem-set-2-approximate-using-mst/ https://en.wikipedia.org/wiki/christofides_algorithm http://page.mi.fu-berlin.de/rojas/2003/grec03.pdf

Discussion

Implementations 15 test graphs from class with random weights assigned to edges Varying V, E, density Python code

Implementations 15 test graphs from class with random weights assigned to edges Varying V, E, density