Download presentation

Presentation is loading. Please wait.

Published byAiden Ball Modified over 2 years ago

1
CSE 211 Discrete Mathematics Chapter 8.4 Connectivity

2
Paths in Undirected Graphs There is a path from vertex v 0 to vertex v n if there is a sequence of edges from v 0 to v n –This path is labeled as v 0,v 1,v 2,…,v n and has a length of n. The path is a circuit if the path begins and ends with the same vertex. A path is simple if it does not contain the same edge more than once.

3
Graph Theoretic Foundations Paths and Cycles: Walk in a graph G is v 0, e 1, v 1, …, v l-1, e l, v l

4
Graph Theoretic Foundations Paths and Cycles: IF v 0, v 1, …, v l are distinct (except possible v 0,v l ) then the walk is a path. Denoted by v 0, v 1, …, v l or e 1, e 2, …, e l Length of path is l

5
Paths, Cycles, and Trails A trail is a walk with no repeated edge.

6
Graph Theoretic Foundations Paths and Cycles: A path or walk is closed if v 0 = v l A closed path containing at least one edge is called a cycle.

7
Paths in Undirected Graphs A path or circuit is said to pass through the vertices v 0, v 1, v 2, …, v n or traverse the edges e 1, e 2, …, e n.

8
Example u 1, u 4, u 2, u 3 –Is it simple? –yes –What is the length? –3–3 –Does it have any circuits? –no u 1 u 2 u 5 u 4 u 3

9
Example u 1, u 5, u 4, u 1, u 2, u 3 –Is it simple? –yes –What is the length? –5–5 –Does it have any circuits? –Yes; u 1, u 5, u 4, u 1 u 1 u 2 u 5 u 3 u 4

10
Example u 1, u 2, u 5, u 4, u 3 –Is it simple? –yes –What is the length? –4–4 –Does it have any circuits? –no u 1 u 2 u 5 u 3 u 4

11
Connectedness An undirected graph is called connected if there is a path between every pair of distinct vertices of the graph. There is a simple path between every pair of distinct vertices of a connected undirected graph.

12
Example Are the following graphs connected? c e f a d b g e c a f b d YesNo

13
Connectedness (Cont.) A graph that is not connected is the union of two or more disjoint connected subgraphs (called the connected components of the graph).

14
Example What are the connected components of the following graph? b a c d e h g f

15
Example What are the connected components of the following graph? b a c d e h g f {a, b, c}, {d, e}, {f, g, h}

16
Cut edges and vertices If one can remove a vertex (and all incident edges) and produce a graph with more connected components, the vertex is called a cut vertex. If removal of an edge creates more connected components the edge is called a cut edge or bridge.

17
Example Find the cut vertices and cut edges in the following graph. a b c d f e h g

18
Example Find the cut vertices and cut edges in the following graph. a b c d f e h g Cut vertices: c and e Cut edge: (c, e)

19
Graph Theoretic Foundations Connectivity: Connectivity (G) of graph G is … G is k connected if (G) k Separator or vertex-cut Cut vertex Separation pair

20
Graph Theoretic Foundations Trees and Forests: Tree – connected graph without any cycle Forest – a graph without any cycle

21
Connectedness in Directed Graphs A directed graph is strongly connected if there is a directed path between every pair of vertices. A directed graph is weakly connected if there is a path between every pair of vertices in the underlying undirected graph.

22
Example Is the following graph strongly connected? Is it weakly connected? a b c e d This graph is strongly connected. Why? Because there is a directed path between every pair of vertices. If a directed graph is strongly connected, then it must also be weakly connected.

23
Example Is the following graph strongly connected? Is it weakly connected? a b c e d This graph is not strongly connected. Why not? Because there is no directed path between a and b, a and e, etc. However, it is weakly connected. (Imagine this graph as an undirected graph.)

24
Connectedness in Directed Graphs The subgraphs of a directed graph G that are strongly connected but not contained in larger strongly connected subgraphs (the maximal strongly connected subgraphs) are called the strongly connected components or strong components of G.

25
Example What are the strongly connected components of the following graph? a b c e d This graph has three strongly connected components: The vertex a The vertex e The graph consisting of V = {b, c, d} and E = { (b, c), (c, d), (d, b)}

26
Consider a connected graph G. The distance between vertices u and v in G, written d(u, v), is the length of the shortest path between u and v. The diameter of G, written diam(G), is the maximum distance between any two points in G. For example, in Fig. 1-8(a), d(A,F) = 2 and diam(G) = 3, whereas in Fig. 1-8(b), d(A, F) = 3 and diam(G) = 4 Distance in Trees and Graphs

27
If G has a u, v-path, then the distance from u to v, written d G (u, v) or simply d(u, v), is the least length of u, v-path. The diameter (diam G) is max u,v V(G) d(u,v)

28
Distance in Trees and Graphs Find the diameter, eccentricity, radius and center of the given G.

29
CSE 211 Discrete Mathematics and Its Applications Chapter 8.5 Euler and Hamilton Paths

30
Euler Paths and Circuits The Seven bridges of Königsberg a b c d A B C D

31
Euler Paths and Circuits An Euler path is a path using every edge of the graph G exactly once. An Euler circuit is an Euler path that returns to its start. A B C D Does this graph have an Euler circuit? No.

32
Necessary and Sufficient Conditions How about multigraphs? A connected multigraph has a Euler circuit iff each of its vertices has an even degree. A connected multigraph has a Euler path but not an Euler circuit iff it has exactly two vertices of odd degree.

33
Example Which of the following graphs has an Euler circuit? e d a c b e d a c b e c a d b yes no no (a, e, c, d, e, b, a)

34
Example Which of the following graphs has an Euler path? e d a c b e d a c b e c a d b yes noyes (a, e, c, d, e, b, a ) (a, c, d, e, b, d, a, b)

35
Euler Circuit in Directed Graphs NO(a, g, c, b, g, e, d, f, a)NO

36
Euler Path in Directed Graphs NO (a, g, c, b, g, e, d, f, a) (c, a, b, c, d, b)

37
Hamilton Paths and Circuits A Hamilton path in a graph G is a path which visits every vertex in G exactly once. A Hamilton circuit is a Hamilton path that returns to its start.

38
Hamilton Circuits Is there a circuit in this graph that passes through each vertex exactly once?

39
Hamilton Circuits Yes; this is a circuit that passes through each vertex exactly once.

40
Finding Hamilton Circuits Which of these three figures has a Hamilton circuit? Of, if no Hamilton circuit, a Hamilton path?

41
Finding Hamilton Circuits G 1 has a Hamilton circuit: a, b, c, d, e, a G 2 does not have a Hamilton circuit, but does have a Hamilton path: a, b, c, d G 3 has neither.

42
Finding Hamilton Circuits Unlike the Euler circuit problem, finding Hamilton circuits is hard. There is no simple set of necessary and sufficient conditions, and no simple algorithm.

43
Properties to look for... No vertex of degree 1 If a node has degree 2, then both edges incident to it must be in any Hamilton circuit. No smaller circuits contained in any Hamilton circuit (the start/endpoint of any smaller circuit would have to be visited twice).

44
A Sufficient Condition Let G be a connected simple graph with n vertices with n 3. G has a Hamilton circuit if the degree of each vertex is n/2.

45
Travelling Salesman Problem A Hamilton circuit or path may be used to solve practical problems that require visiting vertices, such as: road intersections pipeline crossings communication network nodes A classic example is the Travelling Salesman Problem – finding a Hamilton circuit in a complete graph such that the total weight of its edges is minimal.

46
Summary PropertyEulerHamilton Repeated visits to a given node allowed? YesNo Repeated traversals of a given edge allowed? No Omitted nodes allowed?No Omitted edges allowed?NoYes

Similar presentations

© 2016 SlidePlayer.com Inc.

All rights reserved.

Ads by Google