Introduction to Graph Theory

Slides:



Advertisements
Similar presentations
Chapter 11 Trees Graphs III (Trees, MSTs) Reading: Epp Chp 11.5, 11.6.
Advertisements

Lecture 15. Graph Algorithms
Great Theoretical Ideas in Computer Science
Greedy Algorithms Greed is good. (Some of the time)
Great Theoretical Ideas in Computer Science for Some.
Graphs III (Trees, MSTs) (Chp 11.5, 11.6)
Minimum Spanning Tree CSE 331 Section 2 James Daly.
Minimum cost spanning tree and activity networks Data structure 2002/12/2.
3.3 Spanning Trees Tucker, Applied Combinatorics, Section 3.3, by Patti Bodkin and Tamsen Hunter.
CMPS 2433 Discrete Structures Chapter 5 - Trees R. HALVERSON – MIDWESTERN STATE UNIVERSITY.
Great Theoretical Ideas in Computer Science.
1 Spanning Trees Lecture 20 CS2110 – Spring
Discussion #36 Spanning Trees
Data Structures, Spring 2004 © L. Joskowicz 1 Data Structures – LECTURE 13 Minumum spanning trees Motivation Properties of minimum spanning trees Kruskal’s.
Graph Algorithms: Minimum Spanning Tree We are given a weighted, undirected graph G = (V, E), with weight function w:
1 CSE 417: Algorithms and Computational Complexity Winter 2001 Lecture 10 Instructor: Paul Beame.
Minimum Spanning Trees
Tirgul 13 Today we’ll solve two questions from last year’s exams.
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.
TECH Computer Science Graph Optimization Problems and Greedy Algorithms Greedy Algorithms  // Make the best choice now! Optimization Problems  Minimizing.
Introduction to Graph Theory
Minimal Spanning Trees What is a minimal spanning tree (MST) and how to find one.
1.1 Data Structure and Algorithm Lecture 13 Minimum Spanning Trees Topics Reference: Introduction to Algorithm by Cormen Chapter 13: Minimum Spanning Trees.
Theory of Computing Lecture 10 MAS 714 Hartmut Klauck.
5.4 Shortest-path problem  Let G=(V,E,w) be a weighted connected simple graph, w is a function from edges set E to position real numbers set. We denoted.
Lecture 12-2: Introduction to Computer Algorithms beyond Search & Sort.
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.
 2004 SDU Lecture 7- Minimum Spanning Tree-- Extension 1.Properties of Minimum Spanning Tree 2.Secondary Minimum Spanning Tree 3.Bottleneck.
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.
V Spanning Trees Spanning Trees v Minimum Spanning Trees Minimum Spanning Trees v Kruskal’s Algorithm v Example Example v Planar Graphs Planar Graphs v.
Lecture 19 Greedy Algorithms Minimum Spanning Tree Problem.
Graphs. Definitions A graph is two sets. A graph is two sets. –A set of nodes or vertices V –A set of edges E Edges connect nodes. Edges connect nodes.
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.
Minimum Spanning Trees CS 146 Prof. Sin-Min Lee Regina Wang.
Introduction to Graph Theory
Spanning Tree Algorithms William T. Trotter and Mitchel T. Keller Math 3012 – Applied Combinatorics Spring 2009.
Spanning tree Lecture 4.
Trees Thm 2.1. (Cayley 1889) There are nn-2 different labeled trees
Introduction to Graph Theory
MA/CSSE 473 Day 34 MST details: Kruskal's Algorithm Prim's Algorithm.
Introduction to Graph Theory
Lecture 12 Algorithm Analysis Arne Kutzner Hanyang University / Seoul Korea.
MCA 520: Graph Theory Instructor Neelima Gupta
Trees.
Kruskal’s Algorithm for Computing MSTs Section 9.2.
Minimum Spanning Trees
Proof technique (pigeonhole principle)
Introduction to Algorithms
Chapter 5 : Trees.
Minimum Spanning Tree Chapter 13.6.
Graph theory Definitions Trees, cycles, directed graphs.
12. Graphs and Trees 2 Summary
Great Theoretical Ideas in Computer Science
COMP 6/4030 ALGORITHMS Prim’s Theorem 10/26/2000.
Lecture 12 Algorithm Analysis
Greedy Algorithms / Minimum Spanning Tree Yin Tat Lee
Autumn 2016 Lecture 11 Minimum Spanning Trees (Part II)
Graph Algorithm.
Minimum Spanning Trees
Autumn 2015 Lecture 11 Minimum Spanning Trees (Part II)
CS 583 Analysis of Algorithms
Autumn 2015 Lecture 10 Minimum Spanning Trees
Theorem 5.13: For vT‘, l’(v)= min{l(v), l(vk)+w(vk, v)}
Richard Anderson Lecture 10 Minimum Spanning Trees
Autumn 2016 Lecture 10 Minimum Spanning Trees
Lecture 12 Algorithm Analysis
Winter 2019 Lecture 11 Minimum Spanning Trees (Part II)
Minimum Spanning Trees
Autumn 2019 Lecture 11 Minimum Spanning Trees (Part II)
Presentation transcript:

Introduction to Graph Theory Lecture 06: Properties of Trees and Minimum Spanning Trees

Definition of a Tree Tree is a connected acyclic graph i.e. Connected and containing no cycle Have you come across trees before? What classes of trees have we seen so far? 1 2 1 2 3 3 leaf 4

Properties P1: Every nontrivial tree (K1 is a trivial graph) has at least two end vertices. P2: The deletion of any edge of a tree disconnects it. P3: Given two vertices u and v, there is a unique u-v path (geodesic). P4: A tree with n vertices has q=n-1 edges (minimally connected). Proof? (by induction)

Graphical Sequences of Trees Theorem: Given a sequence S of n positive integers such that and , then there exists a tree whose degree sequence is S. Proof? (by induction again) This is a good property for checking isomorphism. Others are longest and shortest path

Number of Leaves of a Tree Let ni be the number of vertices of degree i, we want to determine n1 from ni, for i=3, 4, … t b r c a

Number of Leaves of a Tree Proof for the theorem. We prove the formula using the concept of rooted tree. Root can be chosen as any vertex, but it is convenient to choose the root as a vertex with degree 1. The root has level zero.

Minimum Spanning Trees (MST) Given a connected graph G, a spanning subgraph of G that is a tree is called a spanning tree. Edges are often associated with weights. MST is the spanning tree with the minimum total of the weights in the tree. Can you think of an application for MST?

Creating Spanning Trees We know that a tree with n vertices has n-1 edges. Given graph G of n vertices and q edges, we need to delete q-(n-1) edges and none of which is a bridge. A graph can have many spanning trees. Let’s look at example 3.4

Example 3.4 b f a g b e d c

k-Deficient Vertices of ST A vertex v is k-deficient if for T the spanning tree of graph G. If k=0, v is a degree-preserving vertex. Theorem: Let G be a connected graph on n vertices and q edges. The sum of deficiencies of the vertices of any spanning tree of G is 2(q-n+1). Proof?

Minimum Spanning Tree (MST) Minimum-Cost Spanning Tree Each edge is given a weight, which is the cost of taking that edge. The cost of the spanning tree is the sum of the weights of the edges of T. An application is the construction of the subway system. Each edge costs millions of dollars

Kruskal’s Algorithm The algorithm is greedy Algorithm: At each stage, always select the best edge not part of a cycle. Algorithm: Let e be the next edge on sorted list L for which and is acyclic. Let If |S|=n-1, stop and output S. Otherwise, return to step2. Why it works?

Proof for Krustal’s Algorithm Part I: Is the result a spanning tree? Borrowing the result from our previous quiz. Part II: Is it minimum? Prove by contradiction Suppose that is not minimum. Let be the MST with the most edges in common with S. The contradiction shows that there is another tree which has more edges in common with S.

Proof for Krustal’s Algorithm Let be the first edge that enters S and not in R. Consider . This set of edges induces a graph that has one cycle C (proof is the quiz) Since is a tree, some edge of C is not in S. induces a spanning tree by breaking the cycle C. The weight of is . …

Example Let’s work out the MST for the following graph. 2 b a 4 1 1 g 5 c 5 d

Prim’s Algorithm Also greedy The edge-induced graph is connected at every step. The algorithm is equivalent to breadth-first search When weights are all equal Starting at a vertex, traversing down the tree by selecting the minimum-weight edge.

Prim’s Algorithm Select a vertex v, and let Among all , let e=uw be a minimum-weight edge joining u to v, where . Let and If , stop and output E(T). Otherwise, return to step2 and add another vertex to the tree. Back to the previous exercise using Prim’s algorithm Let’s make the proof as part of your homework.