Lecture19: Graph III Bohyung Han CSE, POSTECH CSED233: Data Structures (2014F)

Slides:



Advertisements
Similar presentations
O(N 1.5 ) divide-and-conquer technique for Minimum Spanning Tree problem Step 1: Divide the graph into  N sub-graph by clustering. Step 2: Solve each.
Advertisements

Minimum Spanning Trees (MSTs) Prim's Algorithm For each vertex not in the tree, keep track of the lowest cost edge that would connect it to the tree This.
Lecture13: Tree III Bohyung Han CSE, POSTECH CSED233: Data Structures (2014F)
10.4 Spanning Trees. Def Def: Let G be a simple graph. A spanning tree of G is a subgraph of G that is a tree containing every vertex of G See handout.
IKI 10100: Data Structures & Algorithms Ruli Manurung (acknowledgments to Denny & Ade Azurat) 1 Fasilkom UI Ruli Manurung (Fasilkom UI)IKI10100: Lecture10.
Graph Algorithms: Minimum Spanning Tree We are given a weighted, undirected graph G = (V, E), with weight function w:
Approximation Algorithms Lecture for CS 302. What is a NP problem? Given an instance of the problem, V, and a ‘certificate’, C, we can verify V is in.
MATH 310, FALL 2003 (Combinatorial Problem Solving) Lecture 15, Friday, October 3.
Is the following graph Hamiltonian- connected from vertex v? a). Yes b). No c). I have absolutely no idea v.
Minimum Spanning Trees CIS 606 Spring Problem A town has a set of houses and a set of roads. A road connects 2 and only 2 houses. A road connecting.
1 CSE 417: Algorithms and Computational Complexity Winter 2001 Lecture 10 Instructor: Paul Beame.
1 CSE 417: Algorithms and Computational Complexity Winter 2001 Lecture 11 Instructor: Paul Beame.
Graphs. Graph A “graph” is a collection of “nodes” that are connected to each other Graph Theory: This novel way of solving problems was invented by a.
Design and Analysis of Algorithms Minimum Spanning trees
Discrete Mathematics Lecture 9 Alexander Bukharovich New York University.
Minimum Spanning Trees. Subgraph A graph G is a subgraph of graph H if –The vertices of G are a subset of the vertices of H, and –The edges of G are a.
Minimum Spanning Tree Algorithms. What is A Spanning Tree? u v b a c d e f Given a connected, undirected graph G=(V,E), a spanning tree of that graph.
Minimum Spanning Trees What is a MST (Minimum Spanning Tree) and how to find it with Prim’s algorithm and Kruskal’s algorithm.
Chapter 15 Graph Theory © 2008 Pearson Addison-Wesley. All rights reserved.
Lecture20: Graph IV Bohyung Han CSE, POSTECH CSED233: Data Structures (2014F)
Minimum Spanning Tree Dr. Bernard Chen Ph.D. University of Central Arkansas Fall 2008.
Minimum Spanning Trees and Clustering By Swee-Ling Tang April 20, /20/20101.
1.1 Data Structure and Algorithm Lecture 13 Minimum Spanning Trees Topics Reference: Introduction to Algorithm by Cormen Chapter 13: Minimum Spanning Trees.
Nirmalya Roy School of Electrical Engineering and Computer Science Washington State University Cpt S 223 – Advanced Data Structures Graph Algorithms: Minimum.
Theory of Computing Lecture 10 MAS 714 Hartmut Klauck.
SPANNING TREES Lecture 21 CS2110 – Spring
Problem Solving with Networks 18/08/2012 Jamie Sneddon
Lecture17: Graph I Bohyung Han CSE, POSTECH CSED233: Data Structures (2014F)
0 Course Outline n Introduction and Algorithm Analysis (Ch. 2) n Hash Tables: dictionary data structure (Ch. 5) n Heaps: priority queue data structures.
Spanning Trees Introduction to Spanning Trees AQR MRS. BANKS Original Source: Prof. Roger Crawfis from Ohio State University.
Spanning Trees Introduction to Spanning Trees AQR MRS. BANKS Original Source: Prof. Roger Crawfis from Ohio State University.
Spring 2015 Mathematics in Management Science Network Problems Networks & Trees Minimum Networks Spanning Trees Minimum Spanning Trees.
7.1 and 7.2: Spanning Trees. A network is a graph that is connected –The network must be a sub-graph of the original graph (its edges must come from the.
Module 5 – Networks and Decision Mathematics Chapter 23 – Undirected Graphs.
Minimum spanning trees Aims: To know the terms: tree, spanning tree, minimum spanning tree. To understand that a minimum spanning tree connects a network.
Prim's Algorithm This algorithm starts with one node. It then, one by one, adds a node that is unconnected to the new graph to the new graph, each time.
Lecture 19 Greedy Algorithms Minimum Spanning Tree Problem.
Introduction to Graph Theory
Minimum Spanning Trees CS 146 Prof. Sin-Min Lee Regina Wang.
WK15. Vertex Cover and Approximation Algorithm By Lin, Jr-Shiun Choi, Jae Sung.
CSC 213 – Large Scale Programming. Minimum Spanning Tree (MST)  Spanning subgraph  Subgraph w/ all vertices ORD PIT ATL STL DEN DFW DCA
Spring 2015 Mathematics in Management Science Network Problems Networks & Trees Minimum Networks Spanning Trees Minimum Spanning Trees.
SPANNING TREES Lecture 20 CS2110 – Fall Spanning Trees  Definitions  Minimum spanning trees  3 greedy algorithms (incl. Kruskal’s & Prim’s)
SPANNING TREES Lecture 21 CS2110 – Fall Nate Foster is out of town. NO 3-4pm office hours today!
Lecture 25 NP Class. P = ? NP = ? PSPACE They are central problems in computational complexity.
Prims Algorithm for finding a minimum spanning tree
Lecture 19 Minimal Spanning Trees CSCI – 1900 Mathematics for Computer Science Fall 2014 Bill Pine.
Graphs Definition: a graph is an abstract representation of a set of objects where some pairs of the objects are connected by links. The interconnected.
1 Minimum Spanning Tree: Solving TSP for Metric Graphs using MST Heuristic Soheil Shafiee Shabnam Aboughadareh.
Minimum Spanning Tree Graph Theory Basics - Anil Kishore.
Minimum Spanning Trees
Greedy Technique.
Minimum Spanning Tree Chapter 13.6.
Spanning Trees Discrete Mathematics.
Graph Algorithm.
CSCE350 Algorithms and Data Structure
Minimum Spanning Tree.
Minimum Spanning Trees
Connected Components Minimum Spanning Tree
Minimum Spanning Tree.
Minimum Spanning Tree.
4-4 Graph Theory Trees.
Kruskal’s Algorithm for finding a minimum spanning tree
A path that uses every vertex of the graph exactly once.
Minimum Spanning Tree Neil Tang 4/3/2008
CSC 380: Design and Analysis of Algorithms
Minimum spanning trees
Minimum Spanning Trees (MSTs)
Spanning Trees Lecture 20 CS2110 – Spring 2015.
Spanning Tree.
Presentation transcript:

Lecture19: Graph III Bohyung Han CSE, POSTECH CSED233: Data Structures (2014F)

CSED233: Data Structures by Prof. Bohyung Han, Fall 2014 Spanning Tree Definition and property  Subgraph that contains all vertices of the original graph and is a tree  Often, a graph has many different spanning trees.  Cost of spanning tree: the sum of the edge weights in the spanning tree: = 57  Useful in constructing networks: a minimum spanning tree gives the way to connect a set of points with the smallest total amount of wire 2 CB A E D F 10 8 Graph CB A E D F 10 8 Spanning tree

CSED233: Data Structures by Prof. Bohyung Han, Fall 2014 Minimum Spanning Tree (MSP) A spanning tree with the minimum cost  Cost: = 28 Finding the minimum spanning tree  Prim’s algorithm  Kruskal’s algorithms 3 CB A E D F 10 8 Graph CB A E D F 8 Minimum spanning tree

CSED233: Data Structures by Prof. Bohyung Han, Fall 2014 Prim’s Algorithm 4

CSED233: Data Structures by Prof. Bohyung Han, Fall 2014 Prim’s Algorithm 5

CSED233: Data Structures by Prof. Bohyung Han, Fall 2014 An Example Find a minimum spanning tree of the following weighted graph using Prim’s algorithm. 6 C B A D E F

CSED233: Data Structures by Prof. Bohyung Han, Fall 2014 An Example Starting from A 7 C B A D E F VertexBCDEF Priority12inf Edge(A,B)(A,C)---

CSED233: Data Structures by Prof. Bohyung Han, Fall 2014 An Example Add the first priority vertex, B. 8 C B A D E F VertexCDEF Priority2inf1 Edge(A,C)-(B,E)-

CSED233: Data Structures by Prof. Bohyung Han, Fall 2014 An Example 9 C B A D E F VertexCDF Priority1inf2 Edge(A,C)-(E,F)

CSED233: Data Structures by Prof. Bohyung Han, Fall 2014 An Example 10 C B A D E F VertexDF Priority21 Edge(C,D)(E,F)

CSED233: Data Structures by Prof. Bohyung Han, Fall 2014 An Example 11 C B A D E F VertexD Priority1 Edge(C,D)

CSED233: Data Structures by Prof. Bohyung Han, Fall 2014 An Example 12 C B A D E F

CSED233: Data Structures by Prof. Bohyung Han, Fall 2014 Kruskal’s Algorithm 13

CSED233: Data Structures by Prof. Bohyung Han, Fall 2014 An Example Find a minimum spanning tree of the following weighted graph using Kruskal’s algorithm. 14 C B A D E F Edge(A,B)(A,C)(B,C)(B,E)(C,E)(C,D)(C,F)(E,F)(D,F) Priority

CSED233: Data Structures by Prof. Bohyung Han, Fall 2014 An Example Start with the edge with minimum weight. 15 C B A D E F Edge(A,B)(A,C)(B,C)(C,E)(C,D)(C,F)(E,F)(D,F) Priority

CSED233: Data Structures by Prof. Bohyung Han, Fall 2014 An Example Add the first priority edge as long as it does not create a cycle. 16 C B A D E F Edge(A,B)(A,C)(B,C)(C,E)(C,D)(C,F)(E,F) Priority

CSED233: Data Structures by Prof. Bohyung Han, Fall 2014 An Example 17 C B A D E F Edge(A,C)(B,C)(C,E)(C,D)(C,F)(E,F) Priority142562

CSED233: Data Structures by Prof. Bohyung Han, Fall 2014 An Example 18 C B A D E F Edge(B,C)(C,E)(C,D)(C,F)(E,F) Priorityinf 231

CSED233: Data Structures by Prof. Bohyung Han, Fall 2014 An Example 19 C B A D E F Edge(B,C)(C,E)(C,D)(C,F) Priorityinf

CSED233: Data Structures by Prof. Bohyung Han, Fall 2014 Analysis of MST Algorithms 20

CSED233: Data Structures by Prof. Bohyung Han, Fall 2014 Hamiltonian Cycle A cycle that goes through every vertex exactly once 21 C B A D E F C B A D E F

CSED233: Data Structures by Prof. Bohyung Han, Fall 2014 Traveling Salesperson Problem (TSP) 22

23