Presentation is loading. Please wait.

Presentation is loading. Please wait.

Discrete Structures Chapter 7A Graphs Nurul Amelina Nasharuddin Multimedia Department.

Similar presentations


Presentation on theme: "Discrete Structures Chapter 7A Graphs Nurul Amelina Nasharuddin Multimedia Department."— Presentation transcript:

1 Discrete Structures Chapter 7A Graphs Nurul Amelina Nasharuddin Multimedia Department

2 2 Objectives On completion of this topic, student should be able to: a.Explain basic terminology of a graph b.Identify Euler and Hamiltonian cycle c.Represent graphs using adjacency matrices

3 3 A graph G, consists of V, a nonempty set of vertices (or nodes) and E, a set of edges G = (V, E) Each edge has either one or two vertices associated with it, called its endpoints. An edge is said to connect its endpoints Edge-endpoint function is the correspondence from edges to endpoints Introduction to Graphs

4 4 Terminology Loop, parallel edges, isolated, adjacent, incident Loop - An edge connects a vertex to itself Two edges connect the same pair of vertices are said to be parallel Isolated vertex - Unconnected vertex Two vertices that are connected by an edge are called adjacent An edge is said to be incident on each of its end points

5 5 Vertex set = {u 1, u 2, u 3 } Edge set = {e 1, e 2, e 3, e 4 } e 1, e 2, e 3 are incident on u 1 u 2 and u 3 are adjacent to u 1 e 4 is a loop e 2 and e 3 are parallel Example

6 6 Directed – order counts when discussing edges Undirected (bidirectional) Weighted – each edge has a value associated with it Unweighted Types of Graph

7 7 Examples of Graphs

8 8 Special Graphs 1.Simple – does not have any loops or parallel edges 2.Complete graphs – there is an edge “between” every possible tuple of vertices 3.Bipartite graph – V can be partitioned into V1 and V2, such that: (x,y)  E  (x  V1  y  V2)  (x  V2  y  V1) 4.Sub graphs - G1 is a subset of G2 iff Every vertex in G1 is in G2 Every edge in G1 is in G2 5.Connected graph – can get from any vertex to another via edges in the graph

9 9 Simple Graph Eg: Draw all simple graphs with 4 vertices {u, v, w, x} and two edges, one of which is {u, v}

10 10 Complete Graph There is an edge “between” every possible tuple of vertices. |e| = C(n,2) = n.(n-1)/2

11 11 Bipartite Graph A graph is bipartite if its vertices can be partitioned into two disjoint subsets U and V such that each edge connects a vertex from U to one from V.

12 12 Complete Bipartite A bipartite graph is a complete bipartite graph if every vertex in U is connected to every vertex in V If U has m elements and V has n, then we denote the resulting complete bipartite graph by K m,n. The illustration shows K 3,2

13 13 Degree of Vertex Defined as the number of edges attached (incident) to the vertex A loop is counted twice

14 14 Example Find the degree of each vertex and the total degree of graph G where the graph Contains 3 vertex {v 1, v 2, v 3 } Contains 3 edges {e 1, e 2, e 3 } Endpoints of e 1 are v 2 and v 3 Endpoints of e 2 are v 2 and v 3 e 3 is a loop at v 3 v 1 is an isolated vertex Ans: Total degree = 6

15 15 Handshake Theorem If G is ANY graph, then the sum of the degrees of all the vertices of G equals twice the number of edges of G Specifically, if the vertices of G are v 1, v 2, …, v n, where n is a nonnegative integer, then: The total degree of G = deg(v 1 )+deg(v 2 )+…+deg(v n ) = 2  (the number of edges of G)

16 16 Total Degree of a Graph is Even Prove that the total of the degrees of all vertices in a graph is even Since the total degree equals 2 times of edges, which is an integer, the sum of all degree is even.

17 17 Whether Certain Graphs Exist Draw a graph with the specified properties or show that no such graph exists (a) A graph with four vertices of degrees 1,1,2, and 3 No such graph is possible. By Handshake Theorem the total degree is even. 1 + 1 + 2 + 3 = 7 not even (b) A graph with four vertices of degrees 1, 1, 3 and 3 (c) A simple graph with four vertices of degrees 1, 1, 3 and 3

18 18 Even No. of Vertices with Odd Degree In any graph, there are an even number of vertices with odd degree Is there a graph with ten vertices of degrees 1,1,2,2,2,3,4,4,4, and 6? Ans: No. such a graph will have 3 vertices of odd degree (1,1,3) which is impossible.


Download ppt "Discrete Structures Chapter 7A Graphs Nurul Amelina Nasharuddin Multimedia Department."

Similar presentations


Ads by Google