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.

Slides:



Advertisements
Similar presentations
Lecture 15. Graph Algorithms
Advertisements

Graph Algorithms - 4 Algorithm Design and Analysis Victor AdamchikCS Spring 2014 Lecture 14Feb 14, 2014Carnegie Mellon University.
 Theorem 5.9: Let G be a simple graph with n vertices, where n>2. G has a Hamilton circuit if for any two vertices u and v of G that are not adjacent,
IKI 10100: Data Structures & Algorithms Ruli Manurung (acknowledgments to Denny & Ade Azurat) 1 Fasilkom UI Ruli Manurung (Fasilkom UI)IKI10100: Lecture10.
3.3 Spanning Trees Tucker, Applied Combinatorics, Section 3.3, by Patti Bodkin and Tamsen Hunter.
1 Section 9.4 Spanning Trees. 2 Let G be a simple graph. A spanning subtree of G is a subgraph of G containing every vertex of G –must be connected; contains.
Discrete Structures Lecture 13: Trees Ji Yanyan United International College Thanks to Professor Michael Hvidsten.
Minimal Spanning Trees – Page 1CSCI 1900 – Discrete Structures CSCI 1900 Discrete Structures Minimal Spanning Trees Reading: Kolman, Section 7.5.
CMPS 2433 Discrete Structures Chapter 5 - Trees R. HALVERSON – MIDWESTERN STATE UNIVERSITY.
Discussion #36 Spanning Trees
Graph Algorithms: Minimum Spanning Tree We are given a weighted, undirected graph G = (V, E), with weight function w:
DAST 2005 Tirgul 11 (and more) sample questions. DAST 2005 Q.Let G = (V,E) be an undirected, connected graph with an edge weight function w : E→R. Let.
Is the following graph Hamiltonian- connected from vertex v? a). Yes b). No c). I have absolutely no idea v.
3/29/05Tucker, Sec Applied Combinatorics, 4th Ed. Alan Tucker Section 4.2 Minimal Spanning Trees Prepared by Amanda Dargie and Michele Fretta.
Tirgul 13 Today we’ll solve two questions from last year’s exams.
Spanning Trees. Spanning trees Suppose you have a connected undirected graph –Connected: every node is reachable from every other node –Undirected: edges.
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.
Chapter 15 Graph Theory © 2008 Pearson Addison-Wesley. All rights reserved.
Lecture 17: Spanning Trees Minimum Spanning Trees.
Lecture 12-2: Introduction to Computer Algorithms beyond Search & Sort.
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.
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.
Aim: Graph Theory - Trees Course: Math Literacy Do Now: Aim: What’s a tree?
EMIS 8374 Optimal Trees updated 25 April slide 1 Minimum Spanning Tree (MST) Input –A (simple) graph G = (V,E) –Edge cost c ij for each edge e 
Minimum-Cost Spanning Tree CS 110: Data Structures and Algorithms First Semester,
5.5.2 M inimum spanning trees  Definition 24: A minimum spanning tree in a connected weighted graph is a spanning tree that has the smallest possible.
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.
Fundamental Data Structures and Algorithms (Spring ’05) Recitation Notes: Graphs Slides prepared by Uri Dekel, Based on recitation.
Introduction to Graph Theory
Chap 8 Trees Def 1: A tree is a connected,undirected, graph with no simple circuits. Ex1. Theorem1: An undirected graph is a tree if and only if there.
Agenda Review: –Planar Graphs Lecture Content:  Concepts of Trees  Spanning Trees  Binary Trees Exercise.
5.5.2 M inimum spanning trees  Definition 24: A minimum spanning tree in a connected weighted graph is a spanning tree that has the smallest possible.
Lecture19: Graph III Bohyung Han CSE, POSTECH CSED233: Data Structures (2014F)
Graph Theory and Applications
Union-Find  Application in Kruskal’s Algorithm  Optimizing Union and Find Methods.
1 Spanning Trees Longin Jan Latecki Temple University based on slides by David Matuszek, UPenn, Rose Hoberman, CMU, Bing Liu, U. of Illinois, Boting Yang,
Trees Thm 2.1. (Cayley 1889) There are nn-2 different labeled trees
MA/CSSE 473 Day 34 MST details: Kruskal's Algorithm Prim's Algorithm.
Prims Algorithm for finding a minimum spanning tree
Lecture 19 Minimal Spanning Trees CSCI – 1900 Mathematics for Computer Science Fall 2014 Bill Pine.
Tree Diagrams A tree is a connected graph in which every edge is a bridge. There can NEVER be a circuit in a tree diagram!
Spanning Trees Dijkstra (Unit 10) SOL: DM.2 Classwork worksheet Homework (day 70) Worksheet Quiz next block.
Discrete Mathematics Chapter 10 Trees.
9.5 Euler and Hamilton graphs. 9.5: Euler and Hamilton paths Konigsberg problem.
Trees.
Applied Discrete Mathematics Week 15: Trees
Minimum Spanning Trees
Introduction to Algorithms
Minimum Spanning Tree Chapter 13.6.
Discrete Mathematicsq
Spanning Trees.
Topological Sort (topological order)
Spanning Trees Longin Jan Latecki Temple University based on slides by
Minimum-Cost Spanning Tree
Minimum Spanning Tree.
Minimum Spanning Trees
Connected Components Minimum Spanning Tree
Minimum Spanning Tree.
Graphs Chapter 13.
Autumn 2015 Lecture 11 Minimum Spanning Trees (Part II)
4-4 Graph Theory Trees.
Kruskal’s Algorithm for finding a minimum spanning tree
Chapter 23 Minimum Spanning Tree
Minimum-Cost Spanning Tree
And the Final Subject is…
Simple Graphs: Connectedness, Trees
Spanning Trees Longin Jan Latecki Temple University based on slides by
Minimum-Cost Spanning Tree
Presentation transcript:

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 for examples

Thm. 1 Thm 1.: A simple graph is connected iff it has a spanning tree Recall some def: – Connected ____ – Spanning tree______ – Tree_________

Proof of Thm. 1 A simple graph is conn.iff it has a spanning tree: Proof  Suppose G has a spanning tree T Because it is spanning, ________ Because it is a tree, 10.1 Thm. 1 says _________ Since T is a subgraph of G, G is ________ ™Suppose G is connected If G is NOT a tree it must ___________ Remove an edge. The resulting graph has ___ edge and contains ___vertices of G and is ________ Repeat until _____ This is possible because______________

Algorithms for constructing spanning trees See handout and use the following methods – Depth first (backtracking) Start with a root Form a path by adding vertices as long as possible (without adding a circuit) When you can’t add any more, go back to previous one and add more… – Breath first Start with a root Add all edges incident to this vertex (level 1), arbitrarily order them For each vertex in level 1, add each edge incident (as long as it doesn’t form a circuit),…

Depth example adij cefhk bg Start at f

Breadth example abcl defg hij mkstart at e

Use backtracking to find a subset, if possible, … Of the set {27, 24, 19, 14, 11, 8} with the sum of 20

Use backtracking to find a subset, if possible, … Of the set {27, 24, 19, 14, 11, 8} with the sum of 41

Use backtracking to find a subset, if possible, … Of the set {27, 24, 19, 14, 11, 8} with the sum of 60

Ex with colors See if a graph has 3 colors– use a tree

10.5 Minimum spanning trees Prim’s Algorithm – Start with smallest weight – Successively add edges that are incident, choosing smallest weights, and not forming a circuit – Stop after n-1 edges selected (with n vertices) Kruskal’s Algorithm – Start with smallest weight – Successively add edges that are smallest weight (not necessarily incident) and not forming a circuit – Stop after n-1 edges selected (with n vertices) See handout or book ex