Graphs Rosen, Chapter 8. NOT ONE OF THESE! One of these!

Slides:



Advertisements
Similar presentations
CSE 211 Discrete Mathematics
Advertisements

Chapter 8 Topics in Graph Theory
Chapter 9 Graphs.
22C:19 Discrete Math Graphs Fall 2010 Sukumar Ghosh.
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.
Graph-02.
1 Slides based on those of Kenneth H. Rosen Slides by Sylvia Sorkin, Community College of Baltimore County - Essex Campus Graphs.
1 Lecture 5 (part 2) Graphs II Euler and Hamiltonian Path / Circuit Reading: Epp Chp 11.2, 11.3.
Prof. Amr Goneid, AUC1 Analysis & Design of Algorithms (CSCE 321) Prof. Amr Goneid Department of Computer Science, AUC Part R5. Graphs.
Applied Discrete Mathematics Week 12: Trees
1 Section 8.2 Graph Terminology. 2 Terms related to undirected graphs Adjacent: 2 vertices u & v in an undirected graph G are adjacent (neighbors) in.
CTIS 154 Discrete Mathematics II1 8.2 Paths and Cycles Kadir A. Peker.
1 Section 8.4 Connectivity. 2 Paths In an undirected graph, a path of length n from u to v, where n is a positive integer, is a sequence of edges e 1,
Euler and Hamilton Paths
Applied Discrete Mathematics Week 12: Trees
KNURE, Software department, Ph , N.V. Bilous Faculty of computer sciences Software department, KNURE Discrete.
Discrete Mathematics Lecture 9 Alexander Bukharovich New York University.
22C:19 Discrete Math Graphs Spring 2014 Sukumar Ghosh.
9.2 Graph Terminology and Special Types Graphs
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,
Chapter 2 Graph Algorithms.
Graphs Rosen, Chapter 8. Isomorphism (Rosen 560 to 563) Are two graphs G1 and G2 of equal form? That is, could I rename the vertices of G1 such that the.
Euler and Hamilton Paths. Euler Paths and Circuits The Seven bridges of Königsberg a b c d A B C D.
9.2: Graph Terminology. Special Simple Graphs Complete GraphsK 1,… CyclesC 3,… WheelsW 3,… N-cubesQ 1,… Complete bipartiteK 2,2,…
1 CS104 : Discrete Structures Chapter V Graph Theory.
Based on slides by Y. Peng University of Maryland
9.1 Introduction to Graphs
Module #19: Graph Theory: part II Rosen 5 th ed., chs. 8-9.
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.
Data Structures & Algorithms Graphs
September1999 CMSC 203 / 0201 Fall 2002 Week #13 – 18/20/22 November 2002 Prof. Marie desJardins.
Lecture 10: Graph-Path-Circuit
Graphs 9.1 Graphs and Graph Models أ. زينب آل كاظم 1.
MAT 2720 Discrete Mathematics Section 8.2 Paths and Cycles
Introduction to Graphs Slides by Gene Boggess
Chapter 9: Graphs.
CS 261 – Nov. 17 Graph properties – Bipartiteness – Isomorphic to another graph – Pseudograph, multigraph, subgraph Path Cycle – Hamiltonian – Euler.
Chap 7 Graph Def 1: Simple graph G=(V,E) V : nonempty set of vertices E : set of unordered pairs of distinct elements of V called edges Def 2: Multigraph.
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
Chapter 9 (Part 1): Graphs
Graphs Chapter 20.
Data Structures Graphs - Terminology
Let us switch to a new topic:
Graphs Rosen, Chapter 8.
Lecture 19: CONNECTIVITY Sections
Applied Discrete Mathematics Week 13: Graphs
Graphs Hubert Chan (Chapter 9) [O1 Abstract Concepts]
Chapters 8.1 and 8.2 Based on slides by Y. Peng University of Maryland
Euler Paths and Circuits
Graphs Rosen, Chapter 8.
Graph theory Definitions Trees, cycles, directed graphs.
Discrete Structures – CNS2300
Taibah University College of Computer Science & Engineering Course Title: Discrete Mathematics Code: CS 103 Chapter 10 Graphs Slides are adopted from “Discrete.
Can you draw this picture without lifting up your pen/pencil?
Introduction to Graph Theory Euler and Hamilton Paths and Circuits
Chapters 8.1 and 8.2 Based on slides by Y. Peng University of Maryland
CS100: Discrete structures
Graph Theory What is a graph?.
Euler and Hamilton Paths
Discrete Math II Howon Kim
Discrete Math II Howon Kim
Presentation transcript:

Graphs Rosen, Chapter 8

NOT ONE OF THESE!

One of these!

A Simple Graph G = (V,E) V is set of vertices E is set of edges a e b d c V = {a,b,c,d,e} E = {(a,b),(a,d),(b,c),(c,d),(c,e),(d,e)}

A Directed Graph G = (V,E) V is set of vertices E is set of directed edges directed pairs V = {a,b,c,d,e} E = {(a,d),(b,a),(b,c),(c,d),(c,e),(d,c),(d,e)} a e b d c

Applications computer networks telecomm networks scheduling (precedence graphs) transportation problems relationships chemical structures chemical reactions pert networks services (sewage, cable, …)

Terminology Vertex x is adjacent to vertex y if (x,y) is in E c is adjacent to b, d, and e The degree of a vertex x is the number of edges incident on x deg(d) = 3 note: degree aka valency The graph has a degree sequence in this case 3,3,2,2,2 a e b d c

Handshaking Theorem (simple graph) G = (V,E) For an undirected graph G with e edges, the sum of the degrees is 2e Why? An edge (u,v) adds 1 to the degree of vertex u and vertex v Therefore edge(u,v) adds 2 to the sum of the degrees of G Consequently the sum of the degrees of the vertices is 2e a e b d c 2e = deg(a) + deg(b) + deg(c) + deg(d) + deg(e) = = 12

Challenge: Draw a graph with degree sequence 2,2,2,1

Handshaking Theorem (a consequence, for simple graphs) There is an even number of vertices of odd degree a e b d c deg(d) = 3 and deg(c) = 3

Is there an algorithm for drawing a graph with a given degree sequence? Yes, the Havel-Hakimi algorithm

Directed Graphs u v (u,v) is a directed edge u is the initial vertex v is the terminal or end vertex the in-degree of a vertex number of edges with v as terminal vertex the out-degree of a vertex number of edges with v as initial vertex

Directed Graphs u v (u,v) is a directed edge u is the initial vertex v is the terminal or end vertex Each directed edge (v,w) adds 1 to the out-degree of one vertex and adds 1 to the in-degree of another

(Some) Special Graphs Cliques

See Rosen 548 & 549 Cycles Wheels n-Cubes

Bipartite Graphs Vertex set can be divided into 2 disjoint sets

Other Kinds of Graphs (that we won’t cover, but you should know about) multigraphs may have multiple edges between a pair of vertices in telecomms, these might be redundant links, or extra capacity Rosen 539 pseudographs a multigraphs, but edges (v,v) are allowed Rosen 539 hypergraph hyperedges, involving more than a pair of vertices

x yb a c z A Hypergraph (one I prepared earlier) The hypergraph might represent the following x = a + b c = y - z z  b

New Graphs from Old? We can have a subgraph We can have a union of graphs

Representing a Graph (Rosen 7.3, pages 456 to 463) Adjacency Matrix: a 0/1 matrix A NOTE: A is symmetric for simple graphs! NOTE: simple graphs do not have loops (v,v)

Representing a Graph (Rosen 8.3) a d g b e c f What’s that then?

Isomorphism (Rosen 560 to 563) Are two graphs G1 and G2 of equal form? That is, could I rename the vertices of G1 such that the graph becomes G2 Is there a bijection f from vertices in V1 to vertices in V2 such that if (a,b) is in E1 then (f(a),f(b)) is in E2 So far, best algorithm is exponential in the worst case There are necessary conditions V1 and V2 must be same cardinality E1 and E2 must be same cardinality degree sequences must be equal what’s that then?

a c d b Are these graphs isomorphic? a b c d How many possible bijections are there? Is this the worst case performance?

a c d b Are these graphs isomorphic? a b c d How many bijections? 1234,1243,1324,1342,1423, ,2143, … … 4123,4132,…,4321 4! = = 24

a c d b Are these graphs isomorphic? But not all 4! need be considered What might the search process look like that constructs the bijection?

Connectivity A Path of length n from v to u, is a sequence of edges that take us from u to v by traversing n edges. A path is simple if no edge is repeated A circuit is a path that starts and ends on the same vertex An undirected graph is connected if there is a path between every pair of distinct vertices

Connectivity a b c d e g f h i This graph has 2 components

Connectivity a b c d A cut vertex v, is a vertex such that if we remove v, and all of the edges incident on v, the graph becomes disconnected We also have a cut edge, whose removal disconnects the graph c is a cut vertex (d,c) is a cut edge

Euler Path (the Konigsberg Bridge problem) Rosen 8.5 Is it possible to start somewhere, cross all the bridges once only, and return to our starting place? Leonhard Euler ) Is there a simple circuit in the given multigraph that contains every edge?

Euler Path (the Konigsberg Bridge problem) Is there a simple circuit in the given multigraph that contains every edge? a b c d a d c b An Euler circuit in a graph G is a simple circuit containing every edge of G. An Euler path in a graph G is a simple path containing every edge of G.

Euler Circuit & Path Necessary & Sufficient conditions every vertex must be of even degree if you enter a vertex across a new edge you must leave it across a new edge A connected multigraph has an Euler circuit if and only if all vertices have even degree The proof is in 2 parts (the biconditional) The proof is in the book, pages

Hamilton Paths & Circuits Given a graph, is there a circuit that passes through each vertex once and once only? Given a graph, is there a path that passes through each vertex once and once only? Due to Sir William Rowan Hamilton (1805 to 1865) Easy or hard?

Hamilton Paths & Circuits HC is an instance of TSP! Is there an HC?

Connected? Is the following graph connected? Draw the graph What kind of algorithm could we use to test if connected?

Connected? (0) assume all vertices have an attribute visited(v) (1) have a stack S, and put on it any vertex v (2) remove a vertex v from the stack S (3) mark v as visited (4) let X be the set of vertices adjacent to v (5) for w in X do (5.1) if w is unvisited, add w to the top of the stack S (6) if S is not empty go to (2) (7) the vertices that are marked as visited are connected A demo?

fin