© 2010 Pearson Prentice Hall. All rights reserved. CHAPTER 15 Graph Theory.

Slides:



Advertisements
Similar presentations
Decision Maths Networks Kruskals Algorithm Wiltshire Networks A Network is a weighted graph, which just means there is a number associated with each.
Advertisements

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.
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.
Chapter 15 Graph Theory © 2008 Pearson Addison-Wesley. All rights reserved.
7.3 Kruskal’s Algorithm. Kruskal’s Algorithm was developed by JOSEPH KRUSKAL.
Graph Algorithms: Minimum Spanning Tree We are given a weighted, undirected graph G = (V, E), with weight function w:
3/29/05Tucker, Sec Applied Combinatorics, 4th Ed. Alan Tucker Section 4.2 Minimal Spanning Trees Prepared by Amanda Dargie and Michele Fretta.
The Mathematics of Networks
The Mathematics of Networks Chapter 7. Trees A tree is a graph that –Is connected –Has no circuits Tree.
Chapter 9: Graphs Basic Concepts
Chapter 15 Graph Theory © 2008 Pearson Addison-Wesley.
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.
C o n f i d e n t i a l HOME NEXT Subject Name: Data Structure Using C Unit Title: Graphs.
Chapter 15 Graph Theory © 2008 Pearson Addison-Wesley.
Excursions in Modern Mathematics, 7e: Copyright © 2010 Pearson Education, Inc. 7 The Mathematics of Networks 7.1Trees 7.2Spanning Trees 7.3 Kruskal’s.
Midwestern State University Minimum Spanning Trees Definition of MST Generic MST algorithm Kruskal's algorithm Prim's algorithm 1.
Theory of Computing Lecture 10 MAS 714 Hartmut Klauck.
Copyright © Cengage Learning. All rights reserved.
Slide 14-1 Copyright © 2005 Pearson Education, Inc. SEVENTH EDITION and EXPANDED SEVENTH EDITION.
Graph Theory Topics to be covered:
Graph Theory Hamilton Paths and Hamilton Circuits.
(CSC 102) Lecture 32 Discrete Structures. Trees Previous Lecture  Matrices and Graphs  Matrices and Directed Graphs  Matrices and undirected Graphs.
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.
© 2010 Pearson Prentice Hall. All rights reserved. 1 §15.3, Hamilton Paths and Circuits.
Aim: Graph Theory - Trees Course: Math Literacy Do Now: Aim: What’s a tree?
Copyright 2013, 2010, 2007, Pearson, Education, Inc. Section 14.4 Trees.
Introduction to Graph Theory
Chapter 14 Section 4 - Slide 1 Copyright © 2009 Pearson Education, Inc. AND.
© 2010 Pearson Prentice Hall. All rights reserved. CHAPTER 15 Graph Theory.
Excursions in Modern Mathematics, 7e: Copyright © 2010 Pearson Education, Inc. 7 The Mathematics of Networks 7.1Trees 7.2Spanning Trees 7.3 Kruskal’s.
Graphs A ‘Graph’ is a diagram that shows how things are connected together. It makes no attempt to draw actual paths or routes and scale is generally inconsequential.
Spring 2015 Mathematics in Management Science Network Problems Networks & Trees Minimum Networks Spanning Trees Minimum Spanning Trees.
EXCURSIONS IN MODERN MATHEMATICS SIXTH EDITION Peter Tannenbaum 1.
AND.
© 2010 Pearson Prentice Hall. All rights reserved. CHAPTER 15 Graph Theory.
Graph Theory Trees. WHAT YOU WILL LEARN Trees, spanning trees, and minimum-cost spanning trees.
Excursions in Modern Mathematics, 7e: Copyright © 2010 Pearson Education, Inc. 5 The Mathematics of Getting Around 5.1Euler Circuit Problems 5.2What.
Walks, Paths and Circuits. A graph is a connected graph if it is possible to travel from one vertex to any other vertex by moving along successive edges.
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!
Chapter 14 Section 3 - Slide 1 Copyright © 2009 Pearson Education, Inc. AND.
Grade 11 AP Mathematics Graph Theory Definition: A graph, G, is a set of vertices v(G) = {v 1, v 2, v 3, …, v n } and edges e(G) = {v i v j where 1 ≤ i,
Midwestern State University Minimum Spanning Trees Definition of MST Generic MST algorithm Kruskal's algorithm Prim's algorithm 1.
© 2006 Pearson Addison-Wesley. All rights reserved14 B-1 Chapter 14 (continued) Graphs.
MAT 110 Workshop Created by Michael Brown, Haden McDonald & Myra Bentley for use by the Center for Academic Support.
Graph Search Applications, Minimum Spanning Tree
Excursions in Modern Mathematics Sixth Edition
Minimum Spanning Trees
Minimum Spanning Tree Chapter 13.6.
Discrete Mathematicsq
Spanning Trees.
Minimum Spanning Tree.
Minimum Spanning Trees
Section 14.4 Trees.
4-4 Graph Theory Trees.
Kruskal’s Algorithm for finding a minimum spanning tree
Warm Up – Wednesday.
Networks Kruskal’s Algorithm
Chapter 15 Graph Theory © 2008 Pearson Addison-Wesley.
CSE 373: Data Structures and Algorithms
Chapter 15 Graph Theory © 2008 Pearson Addison-Wesley.
Chapter 15 Graph Theory © 2008 Pearson Addison-Wesley.
CSC 380: Design and Analysis of Algorithms
Warm Up – Tuesday Find the critical times for each vertex.
Section 13.4 Trees.
7 The Mathematics of Networks
Presentation transcript:

© 2010 Pearson Prentice Hall. All rights reserved. CHAPTER 15 Graph Theory

© 2010 Pearson Prentice Hall. All rights reserved Trees

© 2010 Pearson Prentice Hall. All rights reserved. 3 Objectives 1.Understand the definition and properties of a tree. 2.Find a spanning tree for a connected graph. 3.Find the minimum spanning tree for a weighted graph.

© 2010 Pearson Prentice Hall. All rights reserved. 4 Trees A tree is a graph that is connected and has no circuits. All trees have the following properties: 1.There is one and only one path joining any two vertices. 2.Every edge is a bridge. 3.A tree with n vertices must have n – 1 edges.

© 2010 Pearson Prentice Hall. All rights reserved. 5 Which of the following graphs are trees? Why or why not? Example 1: Identifying Trees Not a tree because it is disconnected, i.e., a tree with five vertices must have four edges. A tree because it is connected, i.e., there is only one path joining any two vertices. If any edge is removed, then the graph would be disconnected. Not a tree because it has a circuit, i.e., a tree with five vertices must have four edges and there are five vertices and five edges.

© 2010 Pearson Prentice Hall. All rights reserved. 6 Spanning Trees A subgraph is a set of vertices and edges chosen from among those of the original graph. A subgraph that contains all of a connected graph’s vertices, is connected, and contains no circuits is called a spanning tree. The two subgraphs in the previous example are spanning trees.

© 2010 Pearson Prentice Hall. All rights reserved. 7 Find a spanning tree for the graph. Solution: A possible spanning tree must contain all eight vertices shown in the connected graph above. The spanning tree must have 8 – 1 = 7 edges. Since the previous graph has 12 edges, we must remove 5 edges. Example 2: Finding a Spanning Tree

© 2010 Pearson Prentice Hall. All rights reserved. Solution: We break the inner rectangular circuit removing edge FG. We break the outer rectangular circuit by removing all four of its edges while retaining the edges leading to vertices A, B, C, and D. This leaves us the spanning tree seen on the right. Notice that each edge is a bridge and no circuits are present. 8 Example 2: Finding a Spanning Tree

© 2010 Pearson Prentice Hall. All rights reserved. 9 Minimum Spanning Trees The minimum spanning tree for a weighted graph is a spanning tree with the smallest possible total weight. From the spanning trees below, we see (c) has a smaller weight than (b), but is this the minimum spanning tree or should we continue to find other possible spanning trees that may have a total weight less than 107?

© 2010 Pearson Prentice Hall. All rights reserved. 10 Here is a procedure for finding the minimum spanning tree from a weighted graph: 1.Find the edge with the smallest weight in the graph. If there is more than one, pick one at random. Mark it in red. 2.Find the next-smallest edge in the graph. If there is more than one, pick one at random. Mark it in red. 3.Find the next-smallest unmarked edge in the graph that does not create a red circuit. If there is more than one, pick one at random. Mark it in red. 4.Repeat step 3 until all vertices have been included. The red edges are the desired minimum spanning tree. Kruskal’s Algorithm

© 2010 Pearson Prentice Hall. All rights reserved. 11 Seven buildings on a college are connected by the sidewalks shown in the figure. The weighted graph represents buildings as vertices, sidewalks as edges, and sidewalk lengths as weights. A heavy snow has fallen and the sidewalks need to be cleared quickly. Campus decides to clear as little as possible and still ensure that students walking from building to building will be able to do so along cleared paths. Determine the shortest series of sidewalks to clear. What is the total length of the sidewalks that need to be cleared? Example 3: Using Kruskal’s Algorithm

© 2010 Pearson Prentice Hall. All rights reserved. 12 Using Kruskal’s Algorithm, we complete minimizing the spanning tree in a series of steps given below. Refer to the next graph coinciding with the steps. Example 3: Using Kruskal’s Algorithm

© 2010 Pearson Prentice Hall. All rights reserved. 13 Step 1. Find the edge with the smallest weight. Select edge GF by marking it in red. Step 2. Find the next-smallest edge in the graph. Select BD by marking it in red. Step 3. Find the next-smallest edge in the graph. Select AD by marking it in red. Step 4. Find the next-smallest edge in the graph that does not create a circuit. Select DG, since it does not create a circuit, by marking it in red. Example 3: Using Kruskal’s Algorithm

© 2010 Pearson Prentice Hall. All rights reserved. 14 Step 5. Find the next-smallest edge in the graph that does not create a circuit. Select CD, since it does not create a circuit, by marking it in red. Step 6. Find the next-smallest edge in the graph that does not create a circuit. Select CE, since it does not create a circuit, by marking it in red. The minimum spanning tree is completed. The red subgraph contains all seven vertices, six edges, and no circuits. Example 3: Using Kruskal’s Algorithm

© 2010 Pearson Prentice Hall. All rights reserved. 15 The total length of the sidewalks that need to be cleared is , or 1499 feet. Example 3: Using Kruskal’s Algorithm