Download presentation

Presentation is loading. Please wait.

Published byAriel Saye Modified over 2 years ago

1
Discrete Mathematics 6. GRAPHS Lecture 9 Dr.-Ing. Erwin Sitompul http://zitompul.wordpress.com

2
9/2 Erwin SitompulDiscrete Mathematics Homework 8 A chairperson and a treasurer of PUMA IE should be chosen out of 50 eligible association members. In how many ways can a chairperson and a treasurer can be elected, if: (a)There is no limitation. (b) Amir wants to serve only if elected as a chairperson. (c) Budi and Cora want to be elected together or not at all. (d) Dudi and Encep do not want to work together. The position of chairperson and treasurer are different. The sequence of election must be considered. The problem in this homework is a permutation problem.

3
9/3 Erwin SitompulDiscrete Mathematics Solution of Homework 8 (a) There is no limitation. (b) Amir wants to serve only if elected as a chairperson. Amir is elected as chairperson, with 49 ways to fill the treasurer position Amir is not elected as chairperson an thus does not want to serve; the 2 positions will now be filled by the remaining 49 members

4
9/4 Erwin SitompulDiscrete Mathematics Solution of Homework 8 (c) Budi and Cora want to be elected together or not at all. Budi and Cora are elected together The wish of Budi and Cora does not come true; and from the remaining 48 members, 2 people will be elected to fill the positions

5
9/5 Erwin SitompulDiscrete Mathematics Solution of Homework 8 (d) Dudi and Encep do not want to work together. Dudi elected as chairperson, Encep not elected as treasurer Dudi and Encep are not elected, whether as chairperson or treasure All possible ways to elect Events where Dudi and Encep work together Dudi elected as treasurer, Encep not elected as chairperson Encep elected as chairperson, Dudi not elected as treasurer Encep elected as treasurer, Dudi not elected as chairperson

6
9/6 Erwin SitompulDiscrete Mathematics Definition of Graph A graph is an abstract representation of a set of discrete objects where some pairs of the objects are connected by links. The figure below shows a graph that represents a map of road network that connects a number of cities in Central Java.

7
9/7 Erwin SitompulDiscrete Mathematics Bridges of Königsberg (Euler, 1736) Can someone pass every bridge exactly once and come back the his/her original position? A graph can be used to represent the Königsberg bridge: Vertex represents a dry land Arc or edge represents a bridge

8
9/8 Erwin SitompulDiscrete Mathematics Graph Representation Graph G = (V,E) where: V=Set of vertices, may not be a null set ={v 1,v 2,...,v n } E= Set of edges, each connecting a pair of vertices ={e 1,e 2,...,e n }

9
9/9 Erwin SitompulDiscrete Mathematics Graph Representation G1G1 G 1 is a graph with V = {1,2,3,4} E = {(1,2),(1,3),(2,3),(2,4),(3,4)} Simple graph

10
9/10 Erwin SitompulDiscrete Mathematics Graph Representation G2G2 Multigraph G 2 is a graph with V= {1,2,3,4} E= {(1,2),(2,3),(1,3),(1,3),(2,4),(3,4),(3,4)} = {e 1,e 2,e 3,e 4,e 5,e 6,e 7 }

11
9/11 Erwin SitompulDiscrete Mathematics Graph Representation G3G3 Pseudograph G 3 is a graph with V= {1,2,3,4} E= {(1,2),(2,3),(1,3),(1,3),(2,4),(3,4),(3,4),(3,3)} = {e 1,e 2,e 3,e 4,e 5,e 6,e 7,e 8 }

12
9/12 Erwin SitompulDiscrete Mathematics Graph Classification Based on the existence of loop or multiple edges, a graph can be classified into: 1.Simple graph, if the graph does not have any loop or double edge. 2.Unsimple graph, if the graph has any loop or double edge.

13
9/13 Erwin SitompulDiscrete Mathematics Graph Classification Based on the orientation of the edges, a graph can be classified into 2 types: 1.Undirected graph, if the edges are directed. 2.Directed graph or digraph, if all the edges are directed.

14
9/14 Erwin SitompulDiscrete Mathematics Program Analysis Graph Applications t:=0; read(x); while x <> 1945 do begin if x < 0 then writeln(‘Year may not be negative.’); else t:=t+1; read(x); end; writeln(‘Guessed after’,t,’attempts.’); 1: t:=0 2: read(x) 3: x <> 1945 4: x < 0 5: writeln(‘Year...’) 6: t:=t+1 7: read(x) 8: writeln(‘Guessed...)

15
9/15 Erwin SitompulDiscrete Mathematics Automata Theory in a Vending Machine Graph Applications D: Dime (10 cent) Q: Quarter (25 cent) The price of 1 bottle drink is 45 cent

16
9/16 Erwin SitompulDiscrete Mathematics Graph Terminology 1. Adjacency Two vertices are said to be adjacent if they are directly connected through an edge. Observe graph G 1 : Vertex 1 is adjacent with vertex 2 and 3. Vertex 1 is not adjacent to vertex 4. G1G1

17
9/17 Erwin SitompulDiscrete Mathematics Graph Terminology 2. Incidence For any edge e = (v j,v k ), it is said that e is incident to vertex v j, and e is incident to vertex v k. Observe graph G 1 : Edge (2,3) is incident to vertex 2 and vertex 3. Edge (2,4) is incident to vertex 2 and vertex 4. Edge (1,2) is not incident with vertex 4. G1G1

18
9/18 Erwin SitompulDiscrete Mathematics 3. Isolated Vertex A vertex is called isolated vertex if it does not have any edge incident to it. Observe graph G 4 : Vertex 5 is an isolated vertex. Graph Terminology G4G4

19
9/19 Erwin SitompulDiscrete Mathematics 4. Empty Graph (Null Graph) An empty graph is a graph whose set of edges is a null set. Observe graph G 5 : It is an empty graph (null graph). Graph Terminology G5G5

20
9/20 Erwin SitompulDiscrete Mathematics 5. Degree of Vertex The degree of a vertex is the number of edges incident to the vertex itself. Notation: d(v). Observe graph G 1 : d(1) = d(4) = 2. d(2) = d(3) = 3. G1G1 Graph Terminology

21
9/21 Erwin SitompulDiscrete Mathematics Observe graph G 4 : d(5) = 0 isolated vertex d(4) = 1 pendant vertex Observe graph G 6 : d(1) = 3 incident to double edges d(3) = 4 incident to a loop G4G4 G6G6 Graph Terminology

22
9/22 Erwin SitompulDiscrete Mathematics Graph Terminology In a directed graph: d in (v)= in-degree = number of arcs arriving to a vertex d out (v)= out-degree = number of arcs departing from a vertex d(v)= d in (v) + d out (v)

23
9/23 Erwin SitompulDiscrete Mathematics Graph Terminology G7G7 Observe graph G 7 : d in (1) = 2d out (1) = 1 d in (2) = 2d out (2) = 3 d in (3) = 2d out (3) = 1 d in (4) = 1d out (4) = 2

24
9/24 Erwin SitompulDiscrete Mathematics Graph Terminology Handshake Lemma The sum of the degree of all vertices in a graph is an even number; that is, twice the number of edges in the graph. In other words, if G = (V, E), then G1G1 Observe graph G 1 : d(1) + d(2) + d(3) + d(4) = 2 + 3 + 3 + 2 = 2 number of edges = 2 5

25
9/25 Erwin SitompulDiscrete Mathematics G4G4 G6G6 Observe graph G 4 : d(1) + d(2) + d(3) + d(4) + d(5) = 2 + 2 + 3 + 1 + 0 = 2 number of edges = 2 4 Graph Terminology Observe graph G 6 : d(1) + d(2) + d(3) = 3 + 3 + 4 = 2 number of edges = 2 5

26
9/26 Erwin SitompulDiscrete Mathematics Example: A graph has five vertices. Can you draw the graph if the degree of the vertices are: (a) 2, 3, 1, 1, and 2? (b) 2, 3, 3, 4, and 4? Graph Terminology Solution: (a) No, because 2 + 3 + 1 + 1 + 2 = 9, is an odd number. (b) Yes, because 2 + 3 + 3 + 4 + 4 = 16, is an even number.

27
9/27 Erwin SitompulDiscrete Mathematics G1G1 Graph Terminology 6. Path A path with length n from vertex of origin v 0 to vertex of destination v n in a graph G is the alternating sequence of vertices and edges in the form of v 0, e 1, v 1, e 2, v 2,..., v n –1, e n, v n such that e 1 = (v 0, v 1 ), e 2 = (v 1, v 2 ),..., e n = (v n–1, v n ) are the edges of graph G. The length of a path is determined by the number of edges in that path. Observe graph G 1 : Path 1, 2, 4, 3 is a path with edge sequence of (1,2), (2,4), and (4,3). The length of path 1, 2, 4, 3 is 3.

28
9/28 Erwin SitompulDiscrete Mathematics G1G1 Graph Terminology 7. Circuit A path that starts and finishes at the same vertex is called a circuit. Observe graph G 1 : Path 1, 2, 3, 1 is a circuit. The length of the circuit 1, 2, 3, 1 is 3.

29
9/29 Erwin SitompulDiscrete Mathematics 8. Connectivity Two vertices v 1 and v 2 is said to be connected if there exists at least one path from v 1 to v 2. A graph G is said to be a connected graph if for every pair of vertices v i and v j of set V there exists at least one path from v i to v j. If not, then G is said to be disconnected graph. Example of a disconnected graph: Graph Terminology

30
9/30 Erwin SitompulDiscrete Mathematics Graph Terminology A directed graph G is said to be connected if its non-directed graph is connected (Note: the non-directed graph of a directed graph G is obtained by omitting all arrow heads). Two vertices, u and v, in a directed graph G are said as strongly connected vertices if there exists a directed path from u to v and also from v to u. If u and v are not strongly connected vertices but the non- directed graph of G is a connected one, then u and v are said as weakly connected vertices.

31
9/31 Erwin SitompulDiscrete Mathematics Graph Terminology Directed graph G is said as strongly connected graph if every possible pair of vertices u and v in G is strongly connected. If not, then G is said to be a weakly connected graph. Weakly connected graphStrongly connected graph

32
9/32 Erwin SitompulDiscrete Mathematics Graph Terminology 9. Subgraph and Subgraph Complement Suppose G = (V,E) is a graph, then G 1 = (V 1,E 1 ) is a subgraph of G if V 1 V and E 1 E. Complement of subgraph G 1 in regard to graph G is the graph G 2 = (V 2,E 2 ) such that E 2 = E – E 1 and V 2 is the set of all vertices incident to members of E 2. G8G8 A subgraph of G 8 Complement of the subgraph

33
9/33 Erwin SitompulDiscrete Mathematics Graph Terminology 10. Spanning Subgraph Subgraph G 1 = (V 1,E 1 ) of G = (V,E) is said to be a spanning subgraph if V 1 = V; that is if G 1 contains all vertices of G. G9G9 A spanning subgraph of G 9 Not a spanning subgraph of G 9

34
9/34 Erwin SitompulDiscrete Mathematics Graph Terminology 11. Cut Set Cut set of a connected graph G is a set of edges of G that can decides whether G is connected or not. If these edges are omitted, then G will be disconnected. For the graph G 10 below, {(1,2),(1,5),(3,5),(3,4)} belong to the cut set. G 10 G 10 without the cut set, becomes a disconnected graph

35
9/35 Erwin SitompulDiscrete Mathematics Graph Terminology The number of cut sets of a connected graph can be more than one. For instance, the sets {(1,2),(2,5)}, {(1,3),(1,5),(1,2)} and {(2,6)} are also the cut set of G 10. {(1,2),(2,5),(4,5)} is not a cut set because its subset, {(1,2),(2,5)} is already a cut set. G 10 G 10 without the cut set, becomes a disconnected graph

36
9/36 Erwin SitompulDiscrete Mathematics Graph Terminology 12. Weighted Graph A weighted graph is a graph whose edges are given weighting numbers.

37
9/37 Erwin SitompulDiscrete Mathematics Homework 9 Graph G is given by the figure below. (a)List all possible paths from A to C. (b) List all possible circuits. (c)Write down at least 4 cut sets of the graph. (d)Draw the subgraph G 1 = {B,C,X,Y}. (e)Draw the complement of subgraph G 1. Graph G

38
9/38 Erwin SitompulDiscrete Mathematics Homework 9 Observe graph H below. (a)List all possible paths from b to c. (b) List all possible circuits. (c)Write down at least 4 cut sets of the graph. (d)Draw the complement of subgraph H 1 with regard to H. (e)Draw a spanning subgraph of H. Graph H New Graph H 1

Similar presentations

© 2017 SlidePlayer.com Inc.

All rights reserved.

Ads by Google