Unit 5 Graphs & Trees 1 IT Discipline ITD1111 Discrete Mathematics & Statistics STDTLP Unit 5 Discrete Mathematics and Statistics Graphs and Trees.

Slides:



Advertisements
Similar presentations
CSE 211 Discrete Mathematics
Advertisements

Chapter 8 Topics in Graph Theory
Lecture 5 Graph Theory. Graphs Graphs are the most useful model with computer science such as logical design, formal languages, communication network,
22C:19 Discrete Math Graphs Fall 2010 Sukumar Ghosh.
Introduction to Graph Theory Instructor: Dr. Chaudhary Department of Computer Science Millersville University Reading Assignment Chapter 1.
22C:19 Discrete Math Graphs Fall 2014 Sukumar Ghosh.
Midwestern State University Department of Computer Science Dr. Ranette Halverson CMPS 2433 – CHAPTER 4 GRAPHS 1.
1 Slides based on those of Kenneth H. Rosen Slides by Sylvia Sorkin, Community College of Baltimore County - Essex Campus Graphs.
Discrete Mathematics and Its Applications
Lecture 21 Paths and Circuits CSCI – 1900 Mathematics for Computer Science Fall 2014 Bill Pine.
Introduction This chapter explores graphs and their applications in computer science This chapter explores graphs and their applications in computer science.
Data Structures Using C++
Edited by Malak Abdullah Jordan University of Science and Technology Data Structures Using C++ 2E Chapter 12 Graphs.
 Graph Graph  Types of Graphs Types of Graphs  Data Structures to Store Graphs Data Structures to Store Graphs  Graph Definitions Graph Definitions.
C++ Programming: Program Design Including Data Structures, Third Edition Chapter 21: Graphs.
Applied Discrete Mathematics Week 12: Trees
Discrete Structures Chapter 7B Graphs Nurul Amelina Nasharuddin Multimedia Department.
Representing Graphs Wade Trappe. Lecture Overview Introduction Some Terminology –Paths Adjacency Matrix.
Discrete Structures Chapter 7A Graphs Nurul Amelina Nasharuddin Multimedia Department.
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.
Applied Discrete Mathematics Week 12: Trees
Chapter 9: Graphs Basic Concepts
KNURE, Software department, Ph , N.V. Bilous Faculty of computer sciences Software department, KNURE Discrete.
Chapter 15 Graph Theory © 2008 Pearson Addison-Wesley.
22C:19 Discrete Math Graphs Spring 2014 Sukumar Ghosh.
GRAPH Learning Outcomes Students should be able to:
Data Structures Using C++ 2E
Programming for Geographical Information Analysis: Advanced Skills Online mini-lecture: Introduction to Networks Dr Andy Evans.
Lecture 13 Graphs. Introduction to Graphs Examples of Graphs – Airline Route Map What is the fastest way to get from Pittsburgh to St Louis? What is the.
Graph Theoretic Concepts. What is a graph? A set of vertices (or nodes) linked by edges Mathematically, we often write G = (V,E)  V: set of vertices,
Chapter 2 Graph Algorithms.
Graph Theory Topics to be covered:
Fall 2015 COMP 2300 Discrete Structures for Computation Donghyun (David) Kim Department of Mathematics and Physics North Carolina Central University 1.
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.
© by Kenneth H. Rosen, Discrete Mathematics & its Applications, Sixth Edition, Mc Graw-Hill, 2007 Chapter 9 (Part 2): Graphs  Graph Terminology (9.2)
1 CS104 : Discrete Structures Chapter V Graph Theory.
Graphs.  Definition A simple graph G= (V, E) consists of vertices, V, a nonempty set of vertices, and E, a set of unordered pairs of distinct elements.
Week 11 - Monday.  What did we talk about last time?  Binomial theorem and Pascal's triangle  Conditional probability  Bayes’ theorem.
Graphs What are Graphs? General meaning in everyday math: A plot or chart of numerical data using a coordinate system. Technical meaning in discrete.
Fall 2015 COMP 2300 Discrete Structures for Computation Donghyun (David) Kim Department of Mathematics and Physics North Carolina Central University 1.
Basic Notions on Graphs. The House-and-Utilities Problem.
CSS106 Introduction to Elementary Algorithms
Chapter 5 Graphs  the puzzle of the seven bridge in the Königsberg,  on the Pregel.
1 Graphs Theory UNIT IV. 2Contents  Basic terminology,  Multi graphs and weighted graphs  Paths and circuits  Shortest path in weighted graph  Hamiltonian.
Unit – V Graph theory. Representation of Graphs Graph G (V, E,  ) V Set of vertices ESet of edges  Function that assigns vertices {v, w} to each edge.
Graphs Edge(arc) Vertices can be even or odd or undirected (two-way) Edges can be directed (one-way) This graph is connected. Degree(order) = 3 Odd vertex.
Discrete Mathematical Structures: Theory and Applications
Graph Theory and Applications
Graph theory and networks. Basic definitions  A graph consists of points called vertices (or nodes) and lines called edges (or arcs). Each edge joins.
MAT 2720 Discrete Mathematics Section 8.2 Paths and Cycles
Basic properties Continuation
Discrete Structures CISC 2315 FALL 2010 Graphs & Trees.
Graphs Basic properties.
Trees Thm 2.1. (Cayley 1889) There are nn-2 different labeled trees
Chapter 9: Graphs.
Chapter 20: Graphs. Objectives In this chapter, you will: – Learn about graphs – Become familiar with the basic terminology of graph theory – Discover.
Week 11 - Wednesday.  What did we talk about last time?  Graphs  Paths and circuits.
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,
1 GRAPH Learning Outcomes Students should be able to: Explain basic terminology of a graph Identify Euler and Hamiltonian cycle Represent graphs using.
1 Lecture 5 (part 2) Graphs II (a) Circuits; (b) Representation Reading: Epp Chp 11.2, 11.3
1 Data Structures and Algorithms Graphs. 2 Graphs Basic Definitions Paths and Cycles Connectivity Other Properties Representation Examples of Graph Algorithms:
رياضيات متقطعة لعلوم الحاسب MATH 226. Chapter 10.
An Introduction to Graph Theory
Graph theory Definitions Trees, cycles, directed graphs.
Taibah University College of Computer Science & Engineering Course Title: Discrete Mathematics Code: CS 103 Chapter 10 Graphs Slides are adopted from “Discrete.
Discrete Maths 9. Graphs Objective
Chapter 9: Graphs Basic Concepts
Connectivity Section 10.4.
Chapter 9: Graphs Basic Concepts
GRAPHS.
Presentation transcript:

Unit 5 Graphs & Trees 1 IT Discipline ITD1111 Discrete Mathematics & Statistics STDTLP Unit 5 Discrete Mathematics and Statistics Graphs and Trees

Unit 5 Graphs & Trees 2 IT Discipline ITD1111 Discrete Mathematics & Statistics STDTLP Because many situations and structures give rise to graphs, graph theory has become an important mathematical tool in a wide variety of subjects, ranging from operations research, computing science and linguistics [ 語言學 ] to chemistry and genetics [ 基因 ]. Recently, there has been considerable interest in tree structures arising in computer science and artificial intelligence. We often organize data in a computer memory store or the flow of information through a system in tree structure form. Indeed, many computer operating systems are designed to be tree structures. Introduction

Unit 5 Graphs & Trees 3 IT Discipline ITD1111 Discrete Mathematics & Statistics STDTLP P Q R S T road map P Q R ST Diagrammatic Representation 5.1 What is a Graph PQ T S R electrical network

Unit 5 Graphs & Trees 4 IT Discipline ITD1111 Discrete Mathematics & Statistics STDTLP An undirected graph G consists of a non-empty set of elements, called vertices [ 頂點 ], and a set of edges [ 邊 ], where each edge is associated with a list of unordered pairs of either one or two vertices called its endpoints. The correspondence from edges to end-points is called an edge-endpoint function. 5.2 Undirected Graph

Unit 5 Graphs & Trees 5 IT Discipline ITD1111 Discrete Mathematics & Statistics STDTLP Edge e 1 e 2 e 3 e 4 Endpoints{u, v}{u, w}{v, w}{w, z} u v w z e1e1 e2e2 e3e3 e4e4 vertex-set V(G) = {u, v, w, z} edge-set E(G) = {e 1, e 2, e 3, e 4 } edge-endpoint function Example (Undirected Graph)

Unit 5 Graphs & Trees 6 IT Discipline ITD1111 Discrete Mathematics & Statistics STDTLP A directed graph G consists of vertices, and a set of edges, where each edge is associated with a list of ordered pair endpoints 5.3 Directed Graph

Unit 5 Graphs & Trees 7 IT Discipline ITD1111 Discrete Mathematics & Statistics STDTLP Edge e 1 e 2 e 3 e 4 Endpoints(u, v)(w, u)(w, v)(z, w) vertex-set V(G) = {u, v, w, z} edge-set E(G) = {e 1, e 2, e 3, e 4 } edge-endpoint function u v w z e1e1 e2e2 e3e3 e4e4 Example (Directed Graph)

Unit 5 Graphs & Trees 8 IT Discipline ITD1111 Discrete Mathematics & Statistics STDTLP Two or more edges joining the same pair of vertices are called multiple edges and an edge joining a vertex to itself is called a loop. The degree of a vertex is the number of edges meeting at a given vertex. 5.4 Multiple edges, Loop and Degree

Unit 5 Graphs & Trees 9 IT Discipline ITD1111 Discrete Mathematics & Statistics STDTLP V(G) = {u, v, w, z} E(G) = {e 1, e 2, e 3, e 4, e 5, e 6, e 7 } edge-endpoint function u v w z Multiple edges loop e1e1 e2e2 e3e3 e4e4 e5e5 e6e6 e7e7 deg u = 6, deg v = 5, deg w = 2, deg z = 1 total degree = = 14 Edge e 1 e 2 e 3 e 4 e 5 e 6 e 7 Edge points{u, u}{u, w}{v, w}{v, z}{u, v}{u, v}{u, v} Example (Multiple edges, Loop and Degree)

Unit 5 Graphs & Trees 10 IT Discipline ITD1111 Discrete Mathematics & Statistics STDTLP A graph G is connected if there is a path in G between any given pair of vertices, and disconnected otherwise. Connected Graph Disconnected Graph components 5.5 Connected and Disconnected Graphs

Unit 5 Graphs & Trees 11 IT Discipline ITD1111 Discrete Mathematics & Statistics STDTLP K2K2 K3K3 K4K4 K5K5 V1V1 V2V2 V1V1 V2V2 V3V3 V1V1 V2V2 V3V3 V4V4 V1V1 V2V2 V3V3 V4V4 V5V5 A complete graph on n vertices, denoted K n, is a simple graph with n vertices v 1, v 2, …… v n whose set of edges contains exactly one edge for each pair of distinct vertices. 5.6 Complete graph

Unit 5 Graphs & Trees 12 IT Discipline ITD1111 Discrete Mathematics & Statistics STDTLP In any graph, the sum of all the vertex-degrees is equal to twice the number of edges.(see e.g.3) No. of edges =7 total degree = = 14 As the consequences of the Handshaking Lemma, the sum of all the vertex-degrees is an even number and the number of vertices of odd degree is even.(e.g. 3 odd deg vertices are:v and z) 5.7 Handshaking Lemma [ 輔助定理 ]

Unit 5 Graphs & Trees 13 IT Discipline ITD1111 Discrete Mathematics & Statistics STDTLP v 1v 2v 3v 4v 1v 2v 3v 4 v 1 v 2 v 3 v 4 A(G) = v1v1 v2v2 v3v3 v4v4 Adjacency [ 毗鄰 ] Matrix A(G) 5.8 Matrix Representations of Undirected Graph

Unit 5 Graphs & Trees 14 IT Discipline ITD1111 Discrete Mathematics & Statistics STDTLP Incidence [ 關聯 ] Matrix I(G) v1v1 v2v2 v3v3 v4v4 e1e1 e2e2 e3e3 e4e4 e5e5 e6e6 e7e7 e 1 e 2 e 3 e 4 e 5 e 6 e 7 v 1v 2v 3v 4v 1v 2v 3v 4 I(G) =

Unit 5 Graphs & Trees 15 IT Discipline ITD1111 Discrete Mathematics & Statistics STDTLP Adjacency Matrix A(G) v1v1 V2V2 V3V3 e1e1 e2e2 e3e3 e4e4 e5e5 v 1v 2v 3v 1v 2v 3 v 1 v 2 v 3 A(G) = 5.9 Matrix Representations of Directed Graph

Unit 5 Graphs & Trees 16 IT Discipline ITD1111 Discrete Mathematics & Statistics STDTLP Incidence Matrix I(G) v1v1 V2V2 V3V3 e1e1 e2e2 e3e3 e4e4 e5e5 v 1v 2v 3v 1v 2v 3 e 1 e 2 e 3 e 4 e 5 I(G) =

Unit 5 Graphs & Trees 17 IT Discipline ITD1111 Discrete Mathematics & Statistics STDTLP A walk of length k between v 1 and v 8 in a graph G is a succession of k edges of G of the form v 1 e 1 v 2, v 2 e 2 v 3, v 3 e 3 v 4, …,v 7 e 7 v 8. We denote this walk by v 1 e 1 v 2 e 2 v 3 e 3 v 4 e 4 v 5 e 5 v 6 e 6 v 7 e 7 v 8. v1v1 v2v2 v3v3 v4v4 v5v5 v6v6 v7v7 e1e1 e2e2 e3e3 e4e4 e5e5 e6e6 e7e7 v8v Walk

Unit 5 Graphs & Trees 18 IT Discipline ITD1111 Discrete Mathematics & Statistics STDTLP If all the edges (but not necessarily all the vertices) of a walk are different, then the walk is called a path. If, in addition, all the vertices are different, then the trail is called simple path. A closed path is called a circuit. A simple circuit is a circuit that does not have any other repeated vertex except the first and last Paths and circuits

Unit 5 Graphs & Trees 19 IT Discipline ITD1111 Discrete Mathematics & Statistics STDTLP v1v1 v3v3 v5v5 v4v4 v2v2 path v1v1 v3v3 v5v5 v4v4 v2v2 simple path v 1 v 2 v 4 v 1 v 3 v 5 is a pathv 1 v 2 v 4 v 3 v 5 is a simple path Example (Paths)

Unit 5 Graphs & Trees 20 IT Discipline ITD1111 Discrete Mathematics & Statistics STDTLP v1v1 v3v3 v5v5 v4v4 v2v2 circuit v1v1 v3v3 v5v5 v4v4 v2v2 simple circuit v 1 v 2 v 4 v 3 v 5 v 4 v 1 is a circuitv 1 v 2 v 4 v 5 v 3 v 1 is a simple circuit Example (Circuits)

Unit 5 Graphs & Trees 21 IT Discipline ITD1111 Discrete Mathematics & Statistics STDTLP Repeated EdgeRepeated Vertex Starts and Ends at Same Point Walk Path Simple path Closed walk Circuit Simple circuit Allowed No Allowed No Allowed No Allowed First and last only Allowed No Yes Summarized Table

Unit 5 Graphs & Trees 22 IT Discipline ITD1111 Discrete Mathematics & Statistics STDTLP If G is a graph with vertices v 1, v 2, …… v m and A(G) is the adjacency matrix of G, then for each positive integer n, the ijth entry of A n = the number of walks of length n from v i to v j Counting Walks of Length N

Unit 5 Graphs & Trees 23 IT Discipline ITD1111 Discrete Mathematics & Statistics STDTLP v1v1 v2v2 v3v3 e1e1 e2e2 e3e3 e4e4 Adjacency matrix A(G) Example (Counting Walks)

Unit 5 Graphs & Trees 24 IT Discipline ITD1111 Discrete Mathematics & Statistics STDTLP one walk of length 2 connecting v 1 to v 1 (v1e1v2e1v1)(v1e1v2e1v1) two walks of length 2 connecting v 1 to v 3 (v 1 e 1 v 2 e 3 v 3, v 1 e 1 v 2 e 4 v 3 ) Example (cont.)

Unit 5 Graphs & Trees 25 IT Discipline ITD1111 Discrete Mathematics & Statistics STDTLP The objective of this algorithm is to find the shortest path from vertex S to vertex T in a given network. We demonstrate the steps of the algorithm by finding the shortest distance from S to T in the following network: 5.13 The Shortest Path Algorithm

Unit 5 Graphs & Trees 26 IT Discipline ITD1111 Discrete Mathematics & Statistics STDTLP S A T B C D Example (Shortest Path Alg.)

Unit 5 Graphs & Trees 27 IT Discipline ITD1111 Discrete Mathematics & Statistics STDTLP S A T B C D Example (Cont.)

Unit 5 Graphs & Trees 28 IT Discipline ITD1111 Discrete Mathematics & Statistics STDTLP S A T B C D Example (Cont.)

Unit 5 Graphs & Trees 29 IT Discipline ITD1111 Discrete Mathematics & Statistics STDTLP S A T B C D Example (Cont.)

Unit 5 Graphs & Trees 30 IT Discipline ITD1111 Discrete Mathematics & Statistics STDTLP S A T B C D Example (Cont.)

Unit 5 Graphs & Trees 31 IT Discipline ITD1111 Discrete Mathematics & Statistics STDTLP S A T B C D Therefore, the shortest path from S to T is SBCT with path length 10 Example (Cont.)

Unit 5 Graphs & Trees 32 IT Discipline ITD1111 Discrete Mathematics & Statistics STDTLP Initialization Assign to vertex S potential 0. Label each vertex V reached directly from S with distance from S to V. Choose the smallest of these labels, and make it the potential of the corresponding vertex or vertices The Shortest Path Algorithm Extra Notes

Unit 5 Graphs & Trees 33 IT Discipline ITD1111 Discrete Mathematics & Statistics STDTLP StepVisitedABCDT InitB7S4S9S7SX

Unit 5 Graphs & Trees 34 IT Discipline ITD1111 Discrete Mathematics & Statistics STDTLP StepVisitedABCDT InitB7S4S9S7SX 1A5SB4S7SB7SX

Unit 5 Graphs & Trees 35 IT Discipline ITD1111 Discrete Mathematics & Statistics STDTLP StepVisitedABCDT InitB7S4S9S7SX 1A5SB4S7SB7SX 2D5SB4S7SB7S11SBA

Unit 5 Graphs & Trees 36 IT Discipline ITD1111 Discrete Mathematics & Statistics STDTLP StepVisitedABCDT InitB7S4S9S7SX 1A5SB4S7SB7SX 2D5SB4S7SB7S11SBA 3C5SB4S7SB7S11SBA

Unit 5 Graphs & Trees 37 IT Discipline ITD1111 Discrete Mathematics & Statistics STDTLP StepVisitedABCDT InitB7S4S9S7SX 1A5SB4S7SB7SX 2D5SB4S7SB7S11SBA 3C5SB4S7SB7S11SBA 4T5SB4S7SB7S10SBC

Unit 5 Graphs & Trees 38 IT Discipline ITD1111 Discrete Mathematics & Statistics STDTLP A connected graph G is Eulerian if there is a closed path which includes every edge of G; such a path is called an Eulerian path, and if the path which starts and ends on the same vertex, then it is called Eulerian circuit p q r s t 5.14 Eulerian Graphs

Unit 5 Graphs & Trees 39 IT Discipline ITD1111 Discrete Mathematics & Statistics STDTLP Theorem (Eulerian Graph) Let G be a connected graph. Then G has an Eulerian circuit if and only if every vertex of G has even degree,and has an Eulerian path if no more than two vertices have an odd degree. Which of the following graph(s) is/are Eulerian? (a) (b)(c) (d)

Unit 5 Graphs & Trees 40 IT Discipline ITD1111 Discrete Mathematics & Statistics STDTLP The four places (A, B, C and D) in the city of K ö nigsberg were interconnected by seven bridges (p, q, r, s, t, u and v) as shown in the following diagram. Is it possible to find a route crossing each bridge exactly once ? K ö nigsberg A B C D p q r s t u v 5.15 Königsberg bridges problem

Unit 5 Graphs & Trees 41 IT Discipline ITD1111 Discrete Mathematics & Statistics STDTLP By the theorem, it is not a Eulerian graph. It follows that there is no route of the desired kind crossing the seven bridges of K ö nigsberg. We can express the K ö nigsberg bridges problem in terms of a graph by taking the four land areas as vertices and the seven bridges as edges joining the corresponding pairs of vertices. C A B D p r s q t u v Answer (Königsberg bridges problem)

Unit 5 Graphs & Trees 42 IT Discipline ITD1111 Discrete Mathematics & Statistics STDTLP STEP 1Choose a starting vertex u with a vertex of odd degree. STEP 2At each stage, traverse [ 橫越 ] any available edge, choosing a bridge only if there is no alternative. STEP 3After traversing each edge, erase [ 擦掉 ] it (erasing any vertices of degree 0 which result), and then choose another available edge. STEP 4STOP when there are no more edges Fleury’s Algorithm

Unit 5 Graphs & Trees 43 IT Discipline ITD1111 Discrete Mathematics & Statistics STDTLP Find the Eulerian path of the following graph. b f ac d e u Example (Fleury’s Algorithm) Constructing Eulerian paths and circuits

Unit 5 Graphs & Trees 44 IT Discipline ITD1111 Discrete Mathematics & Statistics STDTLP Starting at u, we may choose the edge ua, followed by ab. Erasing these edges and the vertex a give us graph (b) b f ac d e u (a) Example (Cont.)

Unit 5 Graphs & Trees 45 IT Discipline ITD1111 Discrete Mathematics & Statistics STDTLP We cannot use the edge bu since it is a bridge, so we choose the edge bc, followed by cd and db. Erasing these edges and the vertices c and d give us graph (c) b f c d e u (b) Example (Cont.)

Unit 5 Graphs & Trees 46 IT Discipline ITD1111 Discrete Mathematics & Statistics STDTLP We have to traverse the bridge bu. Traversing the cycle uefu completes the Eulerian path. The path is therefore uabcdbuefu. b f e u (c) Example (Cont.)

Unit 5 Graphs & Trees 47 IT Discipline ITD1111 Discrete Mathematics & Statistics STDTLP A connected graph G is Hamiltonian if there is a cycle which includes every vertex of G ; such a cycle is called a Hamiltonian cycle. p q rs t p q Hamiltonian Graph rs t Hamiltonian Cycle 5.17 Hamiltonian Graphs

Unit 5 Graphs & Trees 48 IT Discipline ITD1111 Discrete Mathematics & Statistics STDTLP Let G be a simple graph with n vertices, where n  3. If deg v  n/2 for each vertex v, then G is Hamiltonian. For the above graph, n = 6 and deg v = 3 for each vertex v, so this graph is Hamitonian by Dirac ’ s theorem DIRAC’S THEOREM

Unit 5 Graphs & Trees 49 IT Discipline ITD1111 Discrete Mathematics & Statistics STDTLP Let G be a simple graph with n vertices, where n  3. If deg v + deg w  n, for each pair of non-adjacent vertices v and w, then G is Hamiltonian ORE’S THEOREM

Unit 5 Graphs & Trees 50 IT Discipline ITD1111 Discrete Mathematics & Statistics STDTLP n = 5 but deg u = 2, so Dirac ’ s theorem does not apply. However, deg v + deg w  5 for all pairs of non- adjacent vertices v and w, so this graph is Hamiltonian by Ore ’ s theorem. u Example (Ore’s Thm)

Unit 5 Graphs & Trees 51 IT Discipline ITD1111 Discrete Mathematics & Statistics STDTLP A tree is a connected graph which contains no cycles. Properties of Tree Every tree with n vertices has exactly n  1 edges. Any two vertices in a tree are connected by exactly one path. Each edge of a tree is a bridge Trees

Unit 5 Graphs & Trees 52 IT Discipline ITD1111 Discrete Mathematics & Statistics STDTLP T is connected and has n  1 edges. T has n  1 edges and contains no cycles. T is connected and each edge is a bridge. Any two vertices of T are connected by exactly one path Alternative definitions of the tree

Unit 5 Graphs & Trees 53 IT Discipline ITD1111 Discrete Mathematics & Statistics STDTLP Let G be a connected graph. A spanning tree in G is a subgraph of G that includes all the vertices of G and is also a tree. The edges of the tree are called branches Spanning [ 包括, 延伸 ] Trees

Unit 5 Graphs & Trees 54 IT Discipline ITD1111 Discrete Mathematics & Statistics STDTLP v w x y z vw x y z vw x y z v w x y z A graph G Spanning Trees Example (Spanning Trees)

Unit 5 Graphs & Trees 55 IT Discipline ITD1111 Discrete Mathematics & Statistics STDTLP Let T be a spanning tree of minimum total weight in a connected weighted graph G. Then T is a minimum spanning tree of G Minimum Spanning Tree

Unit 5 Graphs & Trees 56 IT Discipline ITD1111 Discrete Mathematics & Statistics STDTLP Illustrated Example A C B D E Greedy Algorithm

Unit 5 Graphs & Trees 57 IT Discipline ITD1111 Discrete Mathematics & Statistics STDTLP Iteration 1 (Choose an edge of minimum weight) A C B D E Greedy Algorithm (cont.)

Unit 5 Graphs & Trees 58 IT Discipline ITD1111 Discrete Mathematics & Statistics STDTLP Iteration 2 (Select the vertex from unconnected set {A,B,C} that is closest to connected set {D,E}) A C B D E Greedy Algorithm (cont.)

Unit 5 Graphs & Trees 59 IT Discipline ITD1111 Discrete Mathematics & Statistics STDTLP Iteration 3 (Select the vertex from unconnected set {A,C} that is closest to connected set {B,D,E,}) A C B D E Greedy Algorithm (cont.)

Unit 5 Graphs & Trees 60 IT Discipline ITD1111 Discrete Mathematics & Statistics STDTLP Iteration 4 (Select the vertex from unconnected set {C} that is closest to connected set {A,B,D,E}) A C B D E Greedy Algorithm (cont.)