(CSC 102) Lecture 29 Discrete Structures. Graphs.

Slides:



Advertisements
Similar presentations
CSE 211 Discrete Mathematics
Advertisements

CSE 211 Discrete Mathematics
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.
Walks, Paths and Circuits Walks, Paths and Circuits Sanjay Jain, Lecturer, School of Computing.
Graph-02.
1 Lecture 5 (part 2) Graphs II Euler and Hamiltonian Path / Circuit Reading: Epp Chp 11.2, 11.3.
Lecture 21 Paths and Circuits CSCI – 1900 Mathematics for Computer Science Fall 2014 Bill Pine.
Section 14.1 Intro to Graph Theory. Beginnings of Graph Theory Euler’s Konigsberg Bridge Problem (18 th c.)  Can one walk through town and cross all.
Section 2.1 Euler Cycles Vocabulary CYCLE – a sequence of consecutively linked edges (x 1,x2),(x2,x3),…,(x n-1,x n ) whose starting vertex is the ending.
Discrete Structures Chapter 7B Graphs Nurul Amelina Nasharuddin Multimedia Department.
CTIS 154 Discrete Mathematics II1 8.2 Paths and Cycles Kadir A. Peker.
4/17/2017 Section 8.5 Euler & Hamilton Paths ch8.5.
MTH118 Sanchita Mal-Sarkar. Routing Problems The fundamental questions: Is there any proper route for the particular problem? If there are many possible.
KNURE, Software department, Ph , N.V. Bilous Faculty of computer sciences Software department, KNURE Discrete.
Discrete Mathematics Lecture 9 Alexander Bukharovich New York University.
Chapter 15 Graph Theory © 2008 Pearson Addison-Wesley.
9.2 Graph Terminology and Special Types Graphs
Copyright © Cengage Learning. All rights reserved.
GRAPH Learning Outcomes Students should be able to:
Graphs Chapter 10.
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,
Graph Theory Topics to be covered:
5.1  Routing Problems: planning and design of delivery routes.  Euler Circuit Problems: Type of routing problem also known as transversability problem.
Euler Paths & Euler Circuits
Fall 2015 COMP 2300 Discrete Structures for Computation Donghyun (David) Kim Department of Mathematics and Physics North Carolina Central University 1.
CSNB143 – Discrete Structure Topic 9 – Graph. Learning Outcomes Student should be able to identify graphs and its components. Students should know how.
(CSC 102) Lecture 28 Discrete Structures. Graphs.
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.
Fall 2015 COMP 2300 Discrete Structures for Computation Donghyun (David) Kim Department of Mathematics and Physics North Carolina Central University 1.
Planar Graphs Graph Coloring
Introduction to Graph Theory
Topics Paths and Circuits (11.2) A B C D E F G.
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.
Lecture 10: Graph-Path-Circuit
Graphs 9.1 Graphs and Graph Models أ. زينب آل كاظم 1.
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
Lecture 52 Section 11.2 Wed, Apr 26, 2006
Excursions in Modern Mathematics, 7e: Copyright © 2010 Pearson Education, Inc. 5 The Mathematics of Getting Around 5.1Euler Circuit Problems 5.2What.
 Quotient graph  Definition 13: Suppose G(V,E) is a graph and R is a equivalence relation on the set V. We construct the quotient graph G R in the follow.
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.
Chapter 11 - Graph CSNB 143 Discrete Mathematical Structures.
Chapter 9: Graphs.
1) Find and label the degree of each vertex in the graph.
(CSC 102) Lecture 30 Discrete Structures. Graphs.
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
رياضيات متقطعة لعلوم الحاسب MATH 226. Chapter 10.
Chapter Chapter Summary Graphs and Graph Models Graph Terminology and Special Types of Graphs Representing Graphs and Graph Isomorphism Connectivity.
An Introduction to Graph Theory
Excursions in Modern Mathematics Sixth Edition
CSNB 143 Discrete Mathematical Structures
Çizge Algoritmaları.
Graphs: Definitions and Basic Properties
Applied Discrete Mathematics Week 13: Graphs
Chapters 8.1 and 8.2 Based on slides by Y. Peng University of Maryland
Euler Paths and Circuits
Discrete Structures – CNS2300
Advanced Algorithms Analysis and Design
Graph.
Chapters 8.1 and 8.2 Based on slides by Y. Peng University of Maryland
CS100: Discrete structures
5 The Mathematics of Getting Around
Let us switch to a new topic:
Chapter 15 Graph Theory © 2008 Pearson Addison-Wesley.
Discrete Math II Howon Kim
Warm Up – 3/19 - Wednesday Give the vertex set. Give the edge set.
Discrete Math II Howon Kim
Presentation transcript:

(CSC 102) Lecture 29 Discrete Structures

Graphs

Previous Lecture  Graphs  Directed Graphs  Simple Graphs  Complete Graphs  Complete Bipartite Graphs  Subgraphs  The Concept of Degree

Today’s Lecture  Subgraphs  The Concept of Degree  Walks, Trails, Paths and Circuits  Connectedness  Connected Components  Euler Circuits  Constructing an Euler Circuits

SubGraphs Example

SubGraphs

The Concept of Degree

Degree of a Vertex and Total Degree of a Graph Find the degree of each vertex of the graph G shown below. Then find the total degree of G. The Concept of Degree

Walks Let G be a graph, and let v and w be vertices in G. A walk from v to w is a finite alternating sequence of adjacent vertices and edges of G. Thus a walk has the form v 0 e 1 v 1 e 2 · · · v n−1 e n v n, where the v’s represent vertices, the e’s represent edges, v 0 = v, v n = w, and for all i = 1, 2,... n, v i−1 and v i are the endpoints of e i. The trivial walk from v to v consists of the single vertex v.

Definitions A trail from v to w is a walk from v to w that does not contain a repeated edge. A path from v to w is a trail that does not contain a repeated vertex. A closed walk is a walk that starts and ends at the same vertex. A circuit is a closed walk that contains at least one edge and does not contain a repeated edge. A simple circuit is a circuit that does not have any other repeated vertex except the first and last.

For ease of reference, these definitions are summarized in the following table: Cont…

Often a walk can be specified unambiguously by giving either a sequence of edges or a sequence of vertices. Notations for Walk

Example: Trails, Paths, Circuits Cont…

Solution

Connectedness Example

Contd… Theorem Let G be a graph. a.If G is connected, then any two distinct vertices of G can be connected by a path. b. If vertices v and w are part of a circuit in G and one edge is removed from the circuit, then there still exists a trail from v to w in G. c. If G is connected and G contains a circuit, then an edge of the circuit can be removed without disconnecting G.

Connected Component of a Graph

Contd… Find all connected components of the following graph G. G has three connected components: H 1, H 2, and H 3 with vertex sets V 1, V 2, and V 3 and edge sets E 1, E 2, and E 3, where

Euler Circuits Theorem If a graph has an Euler circuit, then every vertex of the graph has positive even degree. Contrapositive Version of Theorem If some vertex of a graph has odd degree, then the graph does not have an Euler circuit.

Euler Circuits Show that the graph below does not have an Euler circuit. Vertices v 1 and v 3 both have degree 3, which is odd. Hence by (the contrapositive form of theorem), this graph does not have an Euler circuit.

Constructing an Euler Circuit Theorem If a graph G is connected and the degree of every vertex of G is a positive even integer, then G has an Euler circuit. Constructing an Euler Circuit Step I: Pick any vertex v of G at which to start. Step II: Pick any vertex v of G at which to start. Step III: Check whether C contains every edge and vertex of G. If so, C is an Euler circuit, and we are finished. If not, perform the following steps.

Step IIIa: Remove all edges of C from G and also any vertices that become isolated when the edges of C are removed. Call the resulting subgraph G’. Step IIIb: Pick any vertex w common to both C and G’. Step IIIc: Pick any sequence of adjacent vertices and edges of G’, starting and ending at w and never repeating an edge. Call the resulting circuit C’. Step IIId: Patch C and C$ together to create a new circuit C$$ as follows: Start at v and follow C all the way to w. Then follow C$ all the way back to w. After that, continue along the untraveled portion of C to return to v. Step IIIe: Let C = C’’ and go back to step 3. Since the graph G is finite, execution of the steps outlined in this algorithm must eventually terminate. At that point an Euler circuit for G will have been constructed. Constructing an Euler Circuit

Finding an Euler Circuit Example Check that the graph below has an Euler circuit. Then use the algorithm to find an Euler circuit for the graph. Observe that deg(a) = deg(b) = deg(c) = deg( f ) = deg(g) = deg(i ) = deg( j ) = 2 and that deg(d) = deg(e) = deg(h) = 4. Hence all vertices have even degree. Also, the graph is connected. Thus the graph has an Euler circuit.

Finding an Euler Circuit To construct an Euler circuit using the algorithm, let v = a and let C be C : abcda. C is represented by the labeled edges shown below. Observe that C is not an Euler circuit for the graph but that C intersects the rest of the graph at d.

Finding an Euler Circuit Let C’ be C’: deghjid. Patch C’ into C to obtain C’’: abcdeghjida. Set C = C’’. Then C is represented by the labeled edges shown below. Observe that C is not an Euler circuit for the graph but that it intersects the rest of the graph at e.

Finding an Euler Circuit Let C’ be C’: ef he. Patch C’ into C to obtain C’’: abcde f heghjida. Set C = C’’. Then C is represented by the labeled edges shown below. Since C includes every edge of the graph exactly once, C is an Euler circuit for the graph.

Euler Trails Theorem A graph G has an Euler circuit if, and only if, G is connected and every vertex of G has positive even degree. Corollary

Finding an Euler Trail The floor plan shown below is for a house that is open for public viewing. Is it possible to find a trail that starts in room A, ends in room B, and passes through every interior door-way of the house exactly once? If so, find such a trail.

Finding an Euler Trail Let the floor plan of the house be represented by the graph below. Each vertex of this graph has even degree except for A and B, each of which has degree 1. Hence there is an Euler path from A to B. One such trail is AGHFEI HEK J DCB.

Lecture Summary  Sub graphs  The Concept of Degree  Walks, Trails, Paths and Circuits  Connectedness  Connected Components  Euler Circuits  Constructing an Euler Circuits