Paths and Connectivity

Slides:



Advertisements
Similar presentations
Discrete Mathematics University of Jazeera College of Information Technology & Design Khulood Ghazal Connectivity Lecture _13.
Advertisements

Graph-02.
Review Binary Search Trees Operations on Binary Search Tree
1 Slides based on those of Kenneth H. Rosen Slides by Sylvia Sorkin, Community College of Baltimore County - Essex Campus Graphs.
CS 206 Introduction to Computer Science II 03 / 27 / 2009 Instructor: Michael Eckmann.
Data Structures Chapter 12 Graphs Andreas Savva. 2 Definition A graph consists of a set of vertices together with a set of edges. If e = (v,w) is an edge.
CS 206 Introduction to Computer Science II 11 / 11 / Veterans Day Instructor: Michael Eckmann.
Introduction to Graphs
UMass Lowell Computer Science Analysis of Algorithms Prof. Karen Daniels Fall, 2001 Wednesday, 9/26/01 Graph Basics.
Math Foundations Week 12 Graphs (2). Agenda Paths Connectivity Euler paths Hamilton paths 2.
Copyright © Zeph Grunschlag, Paths and Connectivity Zeph Grunschlag.
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,
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,
CSNB143 – Discrete Structure Topic 9 – Graph. Learning Outcomes Student should be able to identify graphs and its components. Students should know how.
Based on slides by Y. Peng University of Maryland
GRAPHS THEROY. 2 –Graphs Graph basics and definitions Vertices/nodes, edges, adjacency, incidence Degree, in-degree, out-degree Subgraphs, unions, isomorphism.
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.
COSC 2007 Data Structures II Chapter 14 Graphs I.
Lecture 5.4: Paths and Connectivity CS 250, Discrete Structures, Fall 2011 Nitesh Saxena *Adopted from previous lectures by Zeph Grunschlag.
 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
Graphs Definition: a graph is an abstract representation of a set of objects where some pairs of the objects are connected by links. The interconnected.
Lecture 5.3: Graph Isomorphism and Connectivity CS 250, Discrete Structures, Fall 2011 Nitesh Saxena *Adopted from previous lectures by Zeph Grunschlag.
1 GRAPH Learning Outcomes Students should be able to: Explain basic terminology of a graph Identify Euler and Hamiltonian cycle Represent graphs using.
DATA STRUCTURE Presented By: Mahmoud Rafeek Alfarra Using C# MINISTRY OF EDUCATION & HIGHER EDUCATION COLLEGE OF SCIENCE AND TECHNOLOGY KHANYOUNIS- PALESTINE.
رياضيات متقطعة لعلوم الحاسب MATH 226. Chapter 10.
Code: BCA302 Data Structures with C Prof. (Dr.) Monalisa Banerjee By.
An Introduction to Graph Theory
Lecture 5.4: Paths and Connectivity
Applied Discrete Mathematics Week 14: Trees
CSNB 143 Discrete Mathematical Structures
Graphs: Definitions and Basic Properties
Chapter 9 (Part 2): Graphs
Introduction to Graphs
Special Graphs By: Sandeep Tuli Astt. Prof. CSE.
Copyright © Zeph Grunschlag,
Graph Graphs and graph theory can be used to model:
Representing Graphs and
Grade 11 AP Mathematics Graph Theory
Agenda Lecture Content: Introduction to Graph Path and Cycle
Discrete Structures – CNS2300
Introduction to Graphs
CMSC 341 Lecture 21 Graphs (Introduction)
Based on slides by Y. Peng University of Maryland
Can you draw this picture without lifting up your pen/pencil?
Graph Theory.
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.
Graph Theory By Amy C. and John M..
Graphs.
Representing Graphs Wade Trappe.
DiGraph Definitions Adjacency Matrix Adjacency List
10.4 Connectivity Dr. Halimah Alshehri.
Lecture 5.3: Graph Isomorphism and Paths
Graphs G = (V, E) V are the vertices; E are the edges.
Graphs G = (V, E) V are the vertices; E are the edges.
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
Paths and Connectivity
9.4 Connectivity.
Graph Vocabulary.
Applied Discrete Mathematics Week 13: Graphs
Based on slides by Y. Peng University of Maryland
GRAPHS.
Introduction to Graphs
Concepts of Computation
Introduction to Graphs
Presentation transcript:

Paths and Connectivity

Agenda Paths Connectivity L24

1-e12-e11-e33-e42-e62-e52-e43 Paths A path in a graph is a continuous way of getting from one vertex to another by using a sequence of edges. EG: could get from 1 to 3 circuitously as follows: 1-e12-e11-e33-e42-e62-e52-e43 e6 e1 e2 1 2 e5 e3 e4 e7 3 4 L24

1-e12-e11-e33-e42-e62-e52-e43 Paths A path in a graph is a continuous way of getting from one vertex to another by using a sequence of edges. EG: could get from 1 to 3 circuitously as follows: 1-e12-e11-e33-e42-e62-e52-e43 e6 e1 e2 1 2 e5 e3 e4 e7 3 4 L24

1-e12-e11-e33-e42-e62-e52-e43 Paths A path in a graph is a continuous way of getting from one vertex to another by using a sequence of edges. EG: could get from 1 to 3 circuitously as follows: 1-e12-e11-e33-e42-e62-e52-e43 e6 e1 e2 1 2 e5 e3 e4 e7 3 4 L24

1-e12-e11-e33-e42-e62-e52-e43 Paths A path in a graph is a continuous way of getting from one vertex to another by using a sequence of edges. EG: could get from 1 to 3 circuitously as follows: 1-e12-e11-e33-e42-e62-e52-e43 e6 e1 e2 1 2 e5 e3 e4 e7 3 4 L24

1-e12-e11-e33-e42-e62-e52-e43 Paths A path in a graph is a continuous way of getting from one vertex to another by using a sequence of edges. EG: could get from 1 to 3 circuitously as follows: 1-e12-e11-e33-e42-e62-e52-e43 e6 e1 e2 1 2 e5 e3 e4 e7 3 4 L24

1-e12-e11-e33-e42-e62-e52-e43 Paths A path in a graph is a continuous way of getting from one vertex to another by using a sequence of edges. EG: could get from 1 to 3 circuitously as follows: 1-e12-e11-e33-e42-e62-e52-e43 e6 e1 e2 1 2 e5 e3 e4 e7 3 4 L24

1-e12-e11-e33-e42-e62-e52-e43 Paths A path in a graph is a continuous way of getting from one vertex to another by using a sequence of edges. EG: could get from 1 to 3 circuitously as follows: 1-e12-e11-e33-e42-e62-e52-e43 e6 e1 e2 1 2 e5 e3 e4 e7 3 4 L24

1-e12-e11-e33-e42-e62-e52-e43 Paths A path in a graph is a continuous way of getting from one vertex to another by using a sequence of edges. EG: could get from 1 to 3 circuitously as follows: 1-e12-e11-e33-e42-e62-e52-e43 e6 e1 e2 1 2 e5 e3 e4 e7 3 4 L24

1-e12-e11-e33-e42-e62-e52-e43 Paths A path in a graph is a continuous way of getting from one vertex to another by using a sequence of edges. EG: could get from 1 to 3 circuitously as follows: 1-e12-e11-e33-e42-e62-e52-e43 e6 e1 e2 1 2 e5 e3 e4 e7 3 4 L24

Paths DEF: A path of length n in an undirected graph is a sequence of n edges e1, e2, … ,en such that each consecutive pair ei , ei+1 share a common vertex. In a simple graph, one may instead define a path of length n as a sequence of n+1 vertices v0, v1, v2, … ,vn such that each consecutive pair vi , vi+1 are adjacent. Paths of length 0 are also allowed according to this definition. Q: Why does the second definition work for simple graphs? L24

Paths A: For simple graphs, any edge is unique between vertices so listing the vertices gives us the edge-sequence as well. DEF: A simple path contains no duplicate edges (though duplicate vertices are allowed). A cycle (or circuit) is a path which starts and ends at the same vertex. Note: Simple paths need not be in simple graphs. E.g., may contain loops. L24

Paths Q: Find a longest possible simple path in the following graph: 1 2 e5 e3 e4 e7 3 4 L24

Paths A: The following path from 1 to 2 is a maximal simple path because simple: each of its edges appears exactly once maximal: because it contains every edge except the unreachable edge e7 The maximal path: e1,e5,e6,e2,e3,e4 e1 e6 1 e2 2 e5 e3 e4 e7 3 4 L24

Paths in Directed Graphs One can define paths for directed graphs by insisting that the target of each edge in the path is the source of the next edge: DEF: A path of length n in a directed graph is a sequence of n edges e1, e2, … ,en such that the target of ei is the source ei+1 for each i. In a digraph, one may instead define a path of length n as a sequence of n+1 vertices v0, v1, v2, … ,vn such that for each consecutive pair vi , vi+1 there is an edge from vi to vi+1 . L24

Paths in Directed Graphs Q: Consider digraph adjacency matrix: Find a path from 1 to 4. Is there a path from 4 to 1? L24

Paths in Directed Graphs 13 . There’s no path from 4 to 1. From 4 must go to 2, from 2 must stay at 2 or return to 4. In other words 2 and 4 are disconnected from 1. L24

Paths in Directed Graphs 132 . There’s no path from 4 to 1. From 4 must go to 2, from 2 must stay at 2 or return to 4. In other words 2 and 4 are disconnected from 1. L24

Paths in Directed Graphs 1324. There’s no path from 4 to 1. From 4 must go to 2, from 2 must stay at 2 or return to 4. In other words 2 and 4 are disconnected from 1. L24

Connectivity DEF: Let G be a pseudograph. Let u and v be vertices. u and v are connected to each other if there is a path in G which starts at u and ends at v. G is said to be connected if all vertices are connected to each other. 1. Note: Any vertex is automatically connected to itself via the empty path. 2. Note: A suitable definition for directed graphs will follow later. L24

Connectivity Q: Which of the following graphs are connected? A: First and second are disconnected. Last is connected. 1 2 3 4 L24

Connected Components DEF: A connected component (or just component) in a graph G is a set of vertices such that all vertices in the set are connected to each other and every possible connected vertex is included. Q: What are the connected components of the following graph? 1 6 2 7 8 3 L24 4 5

Connected Components A: The components are {1,3,5},{2,4,6},{7} and {8} as one can see visually by pulling components apart: 3 5 1 6 2 8 7 4 L24

Connected Components A: The components are {1,3,5},{2,4,6},{7} and {8} as one can see visually by pulling components apart: 3 5 1 6 2 7 8 4 L24

Connectivity in Directed Graphs In directed graphs may be able to find a path from a to b but not from b to a. However, Connectivity was a symmetric concept for undirected graphs. So how to define directed Connectivity is non-obvious: Should we ignore directions? Should we insist that can get from a to b in actual digraph? Should we insist that can get from a to b and that can get from b to a? L24

Connectivity in Directed Graphs Resolution: Don’t bother choosing which definition is better. Just define to separate concepts: Weakly connected : can get from a to b in underlying undirected graph Strongly connected : can get from a to b AND from b to a in the digraph DEF: A graph is strongly (resp. weakly) connected if every pair of vertices is connected in the same sense. L24

Connectivity in Directed Graphs Q: Classify the connectivity of each graph. L24

Connectivity in Directed Graphs weak strong L24