0% found this document useful (0 votes)
15 views

Fall 24-25 dm_15_Graphs (1)

Uploaded by

abhasan7710
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
15 views

Fall 24-25 dm_15_Graphs (1)

Uploaded by

abhasan7710
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 29

Graphs

Course Code: 00090 Course Title: Discrete Mathematics

Dept. of Computer Science


Faculty of Science and Technology

Lecturer No: Week No: Semester: Fall 24-25


Lecturer: Dr. Md Mehedi Hasan; mmhasan@aiub.edu
Lecture Outline

Graphs and Graph Models (8.1)l


• Multigraph
• Pseudograph
• Simple directed graph
• Directed Multigraph
• Mixed graph
Graph Terminology and Special
Types of Graphs (8.2 )
Objectives and Outcomes
• Objectives: To understand basic terminologies of graph with
examples, Handshaking theorem for undirected and directed
graphs, some special types of graphs, bipartite graph and
complete bipartite graph.
• Outcomes: The students are expected to be able explain graph
terminologies, be able to find out degree of vertices and prove
Handshaking theorem, be able to draw Complete graph, Cycle,
Wheel, n-cube, be able to determine whether a graph is
bipartite using graph coloring.
Directed Graph
• Definition 2: A directed graph(or digraph) (V,E)
consists of a nonempty set of vertices V and a set of
directed edges E.
• Each directed edge is associated with an ordered pair
of vertices.
• The directed edge associated with the ordered pair
(u,v) is said to start at u and end at v.
Graph Terminology : Different Types of Graphs

• Simple Graph: An undirected graph with no multiple edges or


loops is called a simple graph.
• Multigraph: An undirected graph that may contain multiple
edges connecting the same vertices but no loops.
• Pseudograph: An undirected graph that may contain multiple
edges and loops is called a pseudograph.
Graph Terminology : Different Types of Graphs

• Simple Directed graph: When a directed graph has no loops


and has no multiple directed edges, it is called a simple
directed graph.
• Directed multigraph: A graph with directed edges that may
contain multiple directed edges is called a directed
multigraph.
• Mixed Graph: A graph with both directed and undirected
edges is called a mixed graph. A mixed graph may contain
loop(s).
▪ Loop: An edge that connect a vertex to itself is called a loop.
Graph Terminology : Different Types of Graphs
Table 1: Graph Terminology
Type Edges Multiple Edges Loops Allowed?
Allowed?

Simple graph Undirected No No

Multigraph Undirected Yes No

Pseudograph Undirected Yes Yes

Simple directed Directed No No


graph

Directed Multigraph Directed Yes Yes

Mixed graph Directed and Yes Yes


Undirected
Graph Terminology & Special Types

 Basic terminology  Isolated vertex

 Adjacent vertices  Pendant vertex

 Degree of a vertex  Handshaking Theorem


 In-degree of a vertex
 Some Special Simple
 Out-degree of a vertex Graphs
 Bipartite Graphs
Basic Terminology

• Definition1: Two vertices u and v in an undirected


graph G are called adjacent (or neighbors) in G if u
and v are endpoints of an edge of G.
• If e is associated with {u, v}, the edge e is called
incident with the vertices u and v.
• The edge e is also said to connect u and v.
• The vertices u and v are called endpoints of an edge
associated with {u, v}.
Basic Terminology

• Definition 3: The degree of a vertex in an undirected


graph is the number of edges incident with it,
except that a loop at a vertex contributes twice to
the degree of that vertex.
– The degree of the vertex v is denoted by deg(v)

▪ Isolated vertex: A vertex of degree zero is called


isolated.
▪ Pendant vertex: A vertex is pendant if and only if it
has degree one.
Example 1
▪ Example 1 : What are the degrees of the vertices in the graphs
G and H?

Solution:
G: deg(a) = 2, deg(b) = deg(c)= deg(f)=4, deg(d)=1, deg(e) = 3,
and deg(g)= 0
H: deg(a) = 4, deg(b) = deg(e) = 6, deg(c) = 1, deg(d) = 5.
The Handshaking Theorem

• Theorem 1 (The Handshaking Theorem):


Let G = (V,E) be an undirected graph with e edges.
Then

2e = deg(v)

Note: This applies even if multiple edges and loops are present
Example 2

• Example 2: How many edges are there in a


graph with 10 vertices each of degree six?

• Solution: Because the sum of the degrees of


the vertices is 6.10 = 60, it follows that 2e=60.
Therefore, e = 30
Theorem 2

▪ Theorem 2: An undirected graph has an even


number of vertices of odd degree.

• Example: If a graph has 5 vertices, can each vertex


have degree 3?
• Solution: This is not possible by the Handshaking
theorem, because the sum of the degrees of the
vertices 3.5 = 15 is odd.
Initial vertex & Terminal Vertex

• Definition 3: When (u, v) is an edge of the graph G with directed


edges, u is said to be adjacent to v and v is said to be adjacent
from u.
• The vertex u is called the initial vertex of (u, v) and
v is called the terminal/end vertex of (u, v).

▪ Note: The initial vertex and terminal vertex of a loop are the
same.
In-degree & Out-degree of a vertex

• Definition 4: In a graph with directed edges the


in-degree of a vertex v, denoted by deg–(v), is the number of
edges with v as their terminal vertex.
The out-degree of v, denoted by deg+(v), is the number of
edges with v as their initial vertex.

• Note: A loop at a vertex contributes 1 to both the


in-degree and the out-degree of this vertex.
Example: In-degree & Out-degree of vertices of a
graph

▪ Question: What are in-degrees and out-degrees of all


the vertices in the graph below?
2

1 3
Solution:
deg-(1) = 0
deg-(2) = 3
deg-(3) = 4 2

1 3
deg+(1) = 2
deg+(2) = 3
deg+(3) = 2
• Practice Yourself: Example 4
Theorem 3

• Theorem 3: Let G = ( V, E ) be a graph with directed


edges. Then

deg–(v) = deg+(v) = |E|

➔ Handshaking Theorem for directed graph


Some Special Simple Graphs: Complete Graph (Kn )

• The complete graph on n vertices, denoted by Kn, is


the simple graph that contains exactly one edge
between each pair of distinct vertices.
• The graph , for n = 1, 2, 3, 4, 5, 6 are displayed in the
following figure:
Some Special Simple Graphs: Cycles (Cn)

• The Cycle Cn, n>=3, consists of n vertices v1, v2, ….vn


and edges {v1 , v2 }, {v2, v3}, …. {vn-1, vn }, and {vn, v1 }
• The cycles for C3 , C4 , C5 , and C6 are displayed in
the following figure:
Some Special Simple Graphs: Wheels (Wn)

• We obtain the Wheel (Wn) when we add an additional vertex


to the Cycle Cn , for n>=3, and connect this new vertex to
each of the n vertices in Cn , by new edges.
– The wheel Wn is just a cycle graph with an extra vertex in
the middle
• The Wheels W3 , W4 , W5 are displayed in the figure below:
Some Special Simple Graphs: n-Cubes(Qn)

• The n-dimensional hypercube, or n-cube, denoted by Qn, is


the graph that has vertices representing the 2n bit strings of
length n.
– Two vertices are adjacent iff the bit strings that they represent differ in
exactly one bit position.
– The graphs Q1, Q2 , and Q3are displayed in the following figure:
Bipartite graphs

• Definition 5: A simple graph G is called bipartite if its


vertex set V can be partitioned into two disjoint sets
V1 and V2 such that every edge in the graph connects
a vertex in V1 and a vertex in V2

• Note: If each vertex of V1 is connected to each vertex


of V2, then it is called complete bipartite graph and it
is denoted by Km,n where m is the number of vertices
in V1 and n is the number of vertices in V2
Examples of Complete Bipartite graphs
Example 11: Are the graphs G and H are Bipartite?
Practice @ Home

• Relevant Odd-Numbered exercises from text


book
Books

• Rosen, K. H., & Krithivasan, K. (2012). Discrete mathematics and its


applications: with combinatorics and graph theory. Tata McGraw-Hill
Education. (7th Edition)
• Liu, C. L. (1986). Elements of discrete mathematics. Tata McGraw-Hill Education.
References

1. Discrete Mathematics, Richard Johnsonbaugh, Pearson education, Inc.


2. Discrete Mathematical Structures, Bernard Kolman, Robert C. Busby,
Sharon Ross, Prentice-Hall, Inc.
3. SCHAUM’S outlines Discrete Mathematics(2nd edition), by Seymour
Lipschutz, Marc Lipson

• Deo, N. (2017). Graph theory with applications to engineering and


computer science. Courier Dover Publications.
• Radford University Lecture:
https://www.radford.edu/~nokie/classes/360/graphs-terms.html

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy