Applied Discrete Mathematics Week 13: Graphs

Slides:



Advertisements
Similar presentations
CSE 211 Discrete Mathematics
Advertisements

Discrete Mathematics University of Jazeera College of Information Technology & Design Khulood Ghazal Connectivity Lecture _13.
Based on slides by Y. Peng University of Maryland
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,
Graph-02.
Review Binary Search Trees Operations on Binary Search Tree
13 May 2009Instructor: Tasneem Darwish1 University of Palestine Faculty of Applied Engineering and Urban Planning Software Engineering Department Introduction.
1 Slides based on those of Kenneth H. Rosen Slides by Sylvia Sorkin, Community College of Baltimore County - Essex Campus Graphs.
Applied Discrete Mathematics Week 12: Trees
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,
Applied Discrete Mathematics Week 12: Trees
KNURE, Software department, Ph , N.V. Bilous Faculty of computer sciences Software department, KNURE Discrete.
9.3 Representing Graphs and Graph Isomorphism
Discrete Mathematics Lecture 9 Alexander Bukharovich New York University.
Let us switch to a new topic:
Applied Discrete Mathematics Week 10: Equivalence Relations
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.
Week 11 - Monday.  What did we talk about last time?  Binomial theorem and Pascal's triangle  Conditional probability  Bayes’ theorem.
Chapter 5 Graphs  the puzzle of the seven bridge in the Königsberg,  on the Pregel.
Graphs 9.1 Graphs and Graph Models أ. زينب آل كاظم 1.
And before you really hate (mathematical) relations and begin to break your (social) relations, let’s switch to a new topic: Graphs Discrete Structures.
 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.
Basic properties Continuation
Discrete Structures CISC 2315 FALL 2010 Graphs & Trees.
Graphs Basic properties.
Chapter 9: Graphs.
Week 11 - Wednesday.  What did we talk about last time?  Graphs  Paths and circuits.
(CSC 102) Lecture 30 Discrete Structures. Graphs.
رياضيات متقطعة لعلوم الحاسب MATH 226. Chapter 10.
An Introduction to Graph Theory
Applied Discrete Mathematics Week 14: Trees
Chapter 9 (Part 2): Graphs
Let us switch to a new topic:
Applied Discrete Mathematics Week 13: Graphs
Special Graphs By: Sandeep Tuli Astt. Prof. CSE.
Graphs Hubert Chan (Chapter 9) [O1 Abstract Concepts]
Chapters 8.1 and 8.2 Based on slides by Y. Peng University of Maryland
Representing Graphs and
Chapter 5 Fundamental Concept
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.
Matrix Representation of Graph
Graphs Chapters 10.1 and 10.2 Based on slides by Y. Peng University of Maryland.
Graphs.
Based on slides by Y. Peng University of Maryland
Chapter 13 (Part 1): Graphs
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
Relations (sections 7.1 – 7.5)
CS100: Discrete structures
G-v, or G-{v} When we remove a vertex v from a graph, we must remove all edges incident with the vertex v. When a edge is removed from a graph, without.
Connectivity Section 10.4.
Isomorphism in GRAPHS.
Let us switch to a new topic:
10.4 Connectivity Dr. Halimah Alshehri.
Definition 8: Graphs that have a number assigned to each edge or each vertex are called weighted graphs weighted digraphs.
5/9/2019 Discrete Math II Howon Kim
9.4 Connectivity.
Paths and Connectivity
HW 3 (Due Wednesday Feb 6) Create slide(s) for your 1 minute presentation on a graph theory application. Make sure your slide(s) include (1) Define the.
Based on slides by Y. Peng University of Maryland
HW 3 (Due Wednesday Feb 6) Create slide(s) for your 1 minute presentation on a graph theory application. Make sure your slide(s) include (1) Define the.
Agenda Review Lecture Content: Shortest Path Algorithm
Representing Relations Using Matrices
Presentation transcript:

Applied Discrete Mathematics Week 13: Graphs Special Graphs Definition: The complete bipartite graph Km,n is the graph that has its vertex set partitioned into two subsets of m and n vertices, respectively. Two vertices are connected if and only if they are in different subsets. K3,2 K3,4 December 6, 2018 Applied Discrete Mathematics Week 13: Graphs

Applied Discrete Mathematics Week 13: Graphs Operations on Graphs Definition: A subgraph of a graph G = (V, E) is a graph H = (W, F) where WV and FE. Note: Of course, H is a valid graph, so we cannot remove any endpoints of remaining edges when creating H. Example: K5 subgraph of K5 December 6, 2018 Applied Discrete Mathematics Week 13: Graphs

Applied Discrete Mathematics Week 13: Graphs Operations on Graphs Definition: The union of two simple graphs G1 = (V1, E1) and G2 = (V2, E2) is the simple graph with vertex set V1  V2 and edge set E1  E2. The union of G1 and G2 is denoted by G1  G2. G1 G2 G1  G2 = K5 December 6, 2018 Applied Discrete Mathematics Week 13: Graphs

Applied Discrete Mathematics Week 13: Graphs Representing Graphs a b c d a b c d Vertex Adjacent Vertices a b, c, d b a, d c d a, b, c Initial Vertex Terminal Vertices a c b d a, b, c December 6, 2018 Applied Discrete Mathematics Week 13: Graphs

Applied Discrete Mathematics Week 13: Graphs Representing Graphs Definition: Let G = (V, E) be a simple graph with |V| = n. Suppose that the vertices of G are listed in arbitrary order as v1, v2, …, vn. The adjacency matrix A (or AG) of G, with respect to this listing of the vertices, is the nn zero-one matrix with 1 as its (i, j)th entry when vi and vj are adjacent, and 0 otherwise. In other words, for an adjacency matrix A = [aij], aij = 1 if {vi, vj} is an edge of G, aij = 0 otherwise. December 6, 2018 Applied Discrete Mathematics Week 13: Graphs

Applied Discrete Mathematics Week 13: Graphs Representing Graphs Example: What is the adjacency matrix AG for the following graph G based on the order of vertices a, b, c, d ? a b c d Solution: Note: Adjacency matrices of undirected graphs are always symmetric. December 6, 2018 Applied Discrete Mathematics Week 13: Graphs

Applied Discrete Mathematics Week 13: Graphs Representing Graphs For the representation of graphs with multiple edges, we can no longer use zero-one matrices. Instead, we use matrices of natural numbers. The (i, j)th entry of such a matrix equals the number of edges that are associated with {vi, vj}. December 6, 2018 Applied Discrete Mathematics Week 13: Graphs

Applied Discrete Mathematics Week 13: Graphs Representing Graphs Example: What is the adjacency matrix AG for the following graph G based on the order of vertices a, b, c, d ? a b c d Solution: Note: For undirected graphs, adjacency matrices are symmetric. December 6, 2018 Applied Discrete Mathematics Week 13: Graphs

Applied Discrete Mathematics Week 13: Graphs Representing Graphs Definition: Let G = (V, E) be a directed graph with |V| = n. Suppose that the vertices of G are listed in arbitrary order as v1, v2, …, vn. The adjacency matrix A (or AG) of G, with respect to this listing of the vertices, is the nn zero-one matrix with 1 as its (i, j)th entry when there is an edge from vi to vj, and 0 otherwise. In other words, for an adjacency matrix A = [aij], aij = 1 if (vi, vj) is an edge of G, aij = 0 otherwise. December 6, 2018 Applied Discrete Mathematics Week 13: Graphs

Applied Discrete Mathematics Week 13: Graphs Representing Graphs Example: What is the adjacency matrix AG for the following graph G based on the order of vertices a, b, c, d ? a b c d Solution: December 6, 2018 Applied Discrete Mathematics Week 13: Graphs

Applied Discrete Mathematics Week 13: Graphs Representing Graphs Definition: Let G = (V, E) be an undirected graph with |V| = n and |E| = m. Suppose that the vertices and edges of G are listed in arbitrary order as v1, v2, …, vn and e1, e2, …, em, respectively. The incidence matrix of G with respect to this listing of the vertices and edges is the nm zero-one matrix with 1 as its (i, j)th entry when edge ej is incident with vertex vi, and 0 otherwise. In other words, for an incidence matrix M = [mij], mij = 1 if edge ej is incident with vi mij = 0 otherwise. December 6, 2018 Applied Discrete Mathematics Week 13: Graphs

Applied Discrete Mathematics Week 13: Graphs Representing Graphs Example: What is the incidence matrix M for the following graph G based on the order of vertices a, b, c, d and edges 1, 2, 3, 4, 5, 6? a b c d 1 2 4 5 3 6 Solution: Note: Incidence matrices of directed graphs contain two 1s per column for edges connecting two vertices and one 1 per column for loops. December 6, 2018 Applied Discrete Mathematics Week 13: Graphs

Applied Discrete Mathematics Week 13: Graphs Isomorphism of Graphs Definition: The simple graphs G1 = (V1, E1) and G2 = (V2, E2) are isomorphic if there is a bijection (an one-to-one and onto function) f from V1 to V2 with the property that a and b are adjacent in G1 if and only if f(a) and f(b) are adjacent in G2, for all a and b in V1. Such a function f is called an isomorphism. In other words, G1 and G2 are isomorphic if their vertices can be ordered in such a way that the adjacency matrices MG1 and MG2 are identical. December 6, 2018 Applied Discrete Mathematics Week 13: Graphs

Applied Discrete Mathematics Week 13: Graphs Isomorphism of Graphs From a visual standpoint, G1 and G2 are isomorphic if they can be arranged in such a way that their displays are identical (of course without changing adjacency). Unfortunately, for two simple graphs, each with n vertices, there are n! possible isomorphisms that we have to check in order to show that these graphs are isomorphic. However, showing that two graphs are not isomorphic can be easy. December 6, 2018 Applied Discrete Mathematics Week 13: Graphs

Applied Discrete Mathematics Week 13: Graphs Isomorphism of Graphs For this purpose we can check invariants, that is, properties that two isomorphic simple graphs must both have. For example, they must have the same number of vertices, the same number of edges, and the same degrees of vertices. Note that two graphs that differ in any of these invariants are not isomorphic, but two graphs that match in all of them are not necessarily isomorphic. December 6, 2018 Applied Discrete Mathematics Week 13: Graphs

Applied Discrete Mathematics Week 13: Graphs Isomorphism of Graphs Example I: Are the following two graphs isomorphic? d a b c e d a b c e Solution: Yes, they are isomorphic, because they can be arranged to look identical. You can see this if in the right graph you move vertex b to the left of the edge {a, c}. Then the isomorphism f from the left to the right graph is: f(a) = e, f(b) = a, f(c) = b, f(d) = c, f(e) = d. December 6, 2018 Applied Discrete Mathematics Week 13: Graphs

Applied Discrete Mathematics Week 13: Graphs Isomorphism of Graphs Example II: How about these two graphs? d a b c e d a b c e Solution: No, they are not isomorphic, because they differ in the degrees of their vertices. Vertex d in right graph is of degree one, but there is no such vertex in the left graph. December 6, 2018 Applied Discrete Mathematics Week 13: Graphs

Applied Discrete Mathematics Week 13: Graphs Connectivity Definition: A path of length n from u to v, where n is a positive integer, in an undirected graph is a sequence of edges e1, e2, …, en of the graph such that f(e1) = {x0, x1}, f(e2) = {x1, x2}, …, f(en) = {xn-1, xn}, where x0 = u and xn = v. When the graph is simple, we denote this path by its vertex sequence x0, x1, …, xn, since it uniquely determines the path. The path is a circuit if it begins and ends at the same vertex, that is, if u = v. December 6, 2018 Applied Discrete Mathematics Week 13: Graphs

Applied Discrete Mathematics Week 13: Graphs Connectivity Definition (continued): The path or circuit is said to pass through or traverse x1, x2, …, xn-1. A path or circuit is simple if it does not contain the same edge more than once. December 6, 2018 Applied Discrete Mathematics Week 13: Graphs

Applied Discrete Mathematics Week 13: Graphs Connectivity Definition: A path of length n from u to v, where n is a positive integer, in a directed multigraph is a sequence of edges e1, e2, …, en of the graph such that f(e1) = (x0, x1), f(e2) = (x1, x2), …, f(en) = (xn-1, xn), where x0 = u and xn = v. When there are no multiple edges in the path, we denote this path by its vertex sequence x0, x1, …, xn, since it uniquely determines the path. The path is a circuit if it begins and ends at the same vertex, that is, if u = v. A path or circuit is called simple if it does not contain the same edge more than once. December 6, 2018 Applied Discrete Mathematics Week 13: Graphs

Applied Discrete Mathematics Week 13: Graphs Connectivity Let us now look at something new: Definition: An undirected graph is called connected if there is a path between every pair of distinct vertices in the graph. For example, any two computers in a network can communicate if and only if the graph of this network is connected. Note: A graph consisting of only one vertex is always connected, because it does not contain any pair of distinct vertices. December 6, 2018 Applied Discrete Mathematics Week 13: Graphs

Applied Discrete Mathematics Week 13: Graphs Connectivity Example: Are the following graphs connected? d a b c e d a b c e Yes. No. d a b c e f d a b c e No. Yes. December 6, 2018 Applied Discrete Mathematics Week 13: Graphs

Applied Discrete Mathematics Week 13: Graphs Connectivity Theorem: There is a simple path between every pair of distinct vertices of a connected undirected graph. Definition: A graph that is not connected is the union of two or more connected subgraphs, each pair of which has no vertex in common. These disjoint connected subgraphs are called the connected components of the graph. December 6, 2018 Applied Discrete Mathematics Week 13: Graphs

Applied Discrete Mathematics Week 13: Graphs Connectivity Example: What are the connected components in the following graph? a b c d i h g j f e Solution: The connected components are the graphs with vertices {a, b, c, d}, {e}, {f}, {i, g, h, j}. December 6, 2018 Applied Discrete Mathematics Week 13: Graphs

Applied Discrete Mathematics Week 13: Graphs Connectivity Definition: A directed graph is strongly connected if there is a path from a to b and from b to a whenever a and b are vertices in the graph. Definition: A directed graph is weakly connected if there is a path between any two vertices in the underlying undirected graph. December 6, 2018 Applied Discrete Mathematics Week 13: Graphs

Applied Discrete Mathematics Week 13: Graphs Connectivity Example: Are the following directed graphs strongly or weakly connected? a b c d Weakly connected, because, for example, there is no path from b to d. a b c d Strongly connected, because there are paths between all possible pairs of vertices. December 6, 2018 Applied Discrete Mathematics Week 13: Graphs

Applied Discrete Mathematics Week 13: Graphs Connectivity Idea: The number and size of connected components and circuits are further invariants with respect to isomorphism of simple graphs. Example: Are these two graphs isomorphic? Solution: No, because the right graph contains circuits of length 3, while the left graph does not. December 6, 2018 Applied Discrete Mathematics Week 13: Graphs