Graphs Hubert Chan (Chapter 9) [O1 Abstract Concepts]

Slides:



Advertisements
Similar presentations
CSE 211 Discrete Mathematics
Advertisements

Chapter 8 Topics in Graph Theory
Chapter 9 Graphs.
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.
Midwestern State University Department of Computer Science Dr. Ranette Halverson CMPS 2433 – CHAPTER 4 GRAPHS 1.
Graph-02.
Introduction to Graphs
Applied Discrete Mathematics Week 12: Trees
Discrete Structures Chapter 7A Graphs Nurul Amelina Nasharuddin Multimedia Department.
Discrete Mathematics Lecture 9 Alexander Bukharovich New York University.
9.2 Graph Terminology and Special Types Graphs
GRAPH Learning Outcomes Students should be able to:
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,
© 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.
Based on slides by Y. Peng University of Maryland
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.
Graphs What are Graphs? General meaning in everyday math: A plot or chart of numerical data using a coordinate system. Technical meaning in discrete.
1 12/2/2015 MATH 224 – Discrete Mathematics Formally a graph is just a collection of unordered or ordered pairs, where for example, if {a,b} G if a, b.
September1999 CMSC 203 / 0201 Fall 2002 Week #13 – 18/20/22 November 2002 Prof. Marie desJardins.
Introduction to Graph Theory
Graph Theory and Applications
Introduction to Graphs. This Lecture In this part we will study some basic graph theory. Graph is a useful concept to model many problems in computer.
MAT 2720 Discrete Mathematics Section 8.2 Paths and Cycles
 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.
Graph Theory Unit: 4.
Chapter 9: Graphs.
Introduction to Graph Theory By: Arun Kumar (Asst. Professor) (Asst. Professor)
Graphs Rosen, Chapter 8. NOT ONE OF THESE! One of these!
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.
An Introduction to Graph Theory
Hamiltonian Graphs Graphs Hubert Chan (Chapter 9.5)
Applied Discrete Mathematics Week 14: Trees
Chapter 9 (Part 2): Graphs
Let us switch to a new topic:
Lecture 19: CONNECTIVITY Sections
Applied Discrete Mathematics Week 13: Graphs
Special Graphs By: Sandeep Tuli Astt. Prof. CSE.
Chapters 8.1 and 8.2 Based on slides by Y. Peng University of Maryland
Representing Graphs and
Chapter 5 Fundamental Concept
Euler Paths and Circuits
Graphs Rosen, Chapter 8.
Graph theory Definitions Trees, cycles, directed graphs.
Agenda Lecture Content: Introduction to Graph Path and Cycle
Discrete Structures – CNS2300
Hamiltonian Graphs Graphs Hubert Chan (Chapter 9.5)
Taibah University College of Computer Science & Engineering Course Title: Discrete Mathematics Code: CS 103 Chapter 10 Graphs Slides are adopted from “Discrete.
Graphs Chapters 10.1 and 10.2 Based on slides by Y. Peng University of Maryland.
Graphs.
Graphs.
Based on slides by Y. Peng University of Maryland
Chapter 13 (Part 1): Graphs
Can you draw this picture without lifting up your pen/pencil?
Introduction to Graph Theory Euler and Hamilton Paths and Circuits
Graphs Chapter 13.
Rosen 5th ed., chs. 8-9 ~44 slides (more later), ~3 lectures
Chapters 8.1 and 8.2 Based on slides by Y. Peng University of Maryland
CS100: Discrete structures
Discrete Math II Howon Kim
Graphs Discrete Structure CS203.
Representing Graphs Wade Trappe.
Let us switch to a new topic:
Euler and Hamilton Paths
Introduction to Graph Theory
Applied Discrete Mathematics Week 13: Graphs
Based on slides by Y. Peng University of Maryland
Exam 3 review Chapter 9- Graphs.
Presentation transcript:

Graphs Hubert Chan (Chapter 9) [O1 Abstract Concepts] [O2 Proof Techniques] [O3 Basic Analysis Techniques]

What is a Graph? [O1] A graph G = (V, E) consists of V, the set of vertices (nodes, points), and E, the set of edges (lines) Undirected graphs are graphs where edges have no direction (unordered pairs of V). Example: V = {a, b, c, d, e} E = {{a,b}, {a, c}, {c, d}, {c, e}, {d, e}} Directed graphs are graphs where edges have directions, i.e., E consists of ordered pairs of V V = {u, x, y, z} E = {(x, y), (x, z), (y, u), (z, x), (z, u)} a b c d e z x y u

Simple Graphs and Multigraphs Simple graphs - at most one edge between any pair of vertices, no self-loop. Unless otherwise stated, a “graph” means a simple graph. Multi-graphs - having multiple edges between the same (ordered) pair of vertices, or even with self-loops. Examples: Multiple roads between same pair of cities If x, y are two vertices, and e = {x, y} is in E, then x and y are adjacent e is incident with x and y x and y are the endpoints of e Degree (v) = number of edges incident with vertex v deg (y)=2, deg (u)=2, deg (x)=3, deg (z)=5? z x y u

Graph properties: Degrees By pigeon hole principle, given any simple graph, there exist two vertices with the same degree. For an undirected graph G = (V, E): e.g. sum of degrees = 3+2+5+2 = 12, |E| = 6 Proof: every edge is counted twice in counting degrees. Fact: Any undirected graph has an even number of odd-degree vertices (as the sum of degrees is even) For a directed graph G = (V, E): z x y u

Some Special Graphs Complete graphs (Kn) Cycle graphs (Cn) |V| = n |E| = Cn,2 = n(n-1)/2 Degree = n-1 |V| = n, |E| = n Degree = 2

Some Special Graphs Star graphs (Sn) Wheel graphs (Wn) |V| = n+1, |E| = n Degree =1 or n |V| = n+1, |E| = 2n Degree = 3 or n

Graph Operations A graph H = (V’, E’) is a subgraph of G = (V, E) if V’V, E’  E. The complement of G, denoted G, is the subgraph of Kn consisting of all the edges that are not in G. V’=V G H G The union of two graphs G1 = (V1, E1) and G2 = (V2, E2) is G1  G2 = (V1  V2, E1  E2) G1 G2 G1  G2 a b c d e

Graph Isomorphism A graph G = (V, E) consists of x y z w A graph G = (V, E) consists of V = the set of vertices E = the set of edges (relation of V) Directed graph if edges are directed. Are these two graphs “the same”? Although they look different, they represent the same adjacency relationships, i.e., set of ordered pairs Example: f(a) = x, f(b) = w, f(c) = z, f(d) = y Two graphs G1 = (V1, E1) and G2 = (V2, E2) are isomorphic if there is a bijection f: V1  V2 such that (u, v)  E1 if and only if (f(u), f(v))  E2. a b c d

How to Determine Isomorphism? Isomorphic graphs have certain invariants: Same number of vertices and edges Same set of vertex degrees … If two graphs do not agree on these invariants, they must not be isomorphic. (but converse is not true!) Example: Isomorphism can be established if the function f can be found. However, in general, this is very difficult. Not isomorphic: how many degree-1 vertices?

Are these graphs identical? b a b c d h a h g c c e g e d d g e f h b f f b e a c g h d f

Paths A path of length n from u to v in a graph G is a sequence of edges e1, e2, … en, such that e1 = (u, x1), e2 = (x1, x2), …, en = (xn-1, v). A path is simple if it does not contain the same vertex more than once. Example: Undirected graph: Directed graph: Not a path A path

Circuits A circuit of length n in a graph G is a sequence of edges e1, e2, … en, such that e1 = (x0, x1), e2 = (x1, x2), …, en = (xn-1, x0). A cycle is a circuit that does not contain the same vertex more than once. If there is a path between u and v, then there is a simple path between u and v: u  a  b  c  d  e  f  a  b  v is a path u  a  b  v is a simple path u v a b c d e f

Bipartite Graphs A graph is bipartite if the vertices V can be partitioned into two disjoint sets V1, V2 such that every edge connects a vertex in V1 to a vertex in V2 i.e. no edge within V1, no edge within V2 Number of edges ≤ |V1| |V2| A complete bipartite graph Km,n is a bipartite graph with all possible edges between a set of m vertices and a set of n vertices. It has mn edges. e.g. K3,4 has 12 edges

Bipartite Graphs Are these graphs bipartite? A graph is bipartite iff the graph contains no odd cycles. Proof: (if) assign any vertex v in V1, assign all v’s neighbors in V2, assign all v’s neighbors’ neighbors in V1, … etc. Because the graph has no odd cycle, this can be done without conflicts. (only if) Assume G is bipartite, a cycle can only be formed after changing from V1 to V2 and from V2 toV1 even number of times. Thus no odd cycle.

Undirected Graph Connectivity An undirected graph is connected if there is a path between any two vertices. If a graph is not connected, each connected subgraph is called a connected component of the graph. Example: (3 connected components)

Directed Graph Connectivity A directed graph is strongly connected if there is a path from u to v and from v to u for any vertices u, v in the graph. Example: Strongly connected A directed graph is weakly connected if the underlying undirected graph (i.e. without considering directions) is connected. Example: Not strongly connected

Königsberg’s Bridge Problem Is it possible to walk around all bridges once and only once, and return to the starting point? (circuit) What about a “path” which visits all bridges? Modeling the problem in terms of graphs: Is there a circuit containing every edge in this graph? Equivalent problem: Can you draw this graph without lifting the pen from paper and repeating any lines (edges)?)

Euler Paths and Circuits An Euler circuit (or cycle) is a circuit containing every edge exactly once in the graph. (Draw the graph with a cycle) An Euler path is a path containing every edge exactly once in the graph. (Draw the graph with a broken line) Example: How to determine whether a graph has an Euler path/circuit?

Existence of Euler Paths/Circuits [O3] ? Some observations: Connectivity? ? Degree-1 vertex: Euler circuit? Degree-3? Degree-4? Vertices must have even degree for an Euler path, unless it is the start/end vertex. All vertices must have even degree for an Euler circuit. It can be proved that this is sufficient: A connected graph has an Euler circuit iff all vertices have even degrees A connected graph has an Euler path (but not an Euler circuit) iff exactly two vertices have odd degrees

Proof of Euler Circuit [O2] Theorem: A connected graph has an Euler circuit iff all vertices have even degrees. Proof: Only if (=>) part (necessary condition): Each time an Euler circuit passes through a vertex u it “consumes” two edges incident with u (one “in” and one “out”). An Euler circuit covers all edges of G exactly once. If a vertex u is visited by the circuit x times, deg(u) = 2x.

Sufficient Condition for Euler Circuit If (<=) part: (If G is a connected graph with all vertices of even degree, then G contains an Euler circuit) The proof is by construction. pick any arbitrary vertex u, follow any edge from u to another vertex v, again reach at another vertex through another unvisited edge from v (this is possible because the number of incident edges at any vertex is even) u v b The path will continue until it reaches vertex u again.

Proof for the Sufficient Condition It is done if the closed path covers the whole graph, otherwise repeat the previous procedure at some vertex u’ in the closed path. A longer closed path will be formed by merging these closed paths by inserting the new closed path to the old closed path at vertex u’. u u’ This process will repeat until all edges are exhausted.