Professional Documents
Culture Documents
(Week 12) Lecture 23: Understand Graph Know Different Types of Graph
(Week 12) Lecture 23: Understand Graph Know Different Types of Graph
Understand Graph
Know Different Types of Graph
Text Book & Resources: Discrete Mathematics and its Applications (7th Edition) by Kenneth H.
Rosen
Graph:
A graph G consists of two things
1. A set V of elements called vertices
2. A set E of edges such that each e in E is identified with unique pair (u,v) of vertices in V,
denoted by e=(u,v)
Each has either one or two vertices associated with it, called its endpoints. An edge is said to
connect its endpoints.
Example
G H
Infinite Graph:
The set of vertices V of a graph G may be infinite. A graph with an infinite vertex set is called
infinite graph.
Finite Graph:
A graph with a finite number of vertices associated with it, called its endpoints. An edge is said
to connect its endpoints.
1
Discrete Structures (CS-335)
Mrs. Maryam Amin email id: maryam@biit.edu.pk Whatsapp# 0346-5410878
Mrs. Sadia Rashid email id: sadia@biit.edu.pk Whatsapp# 0334-4166270
Simple Graph:
A graph in which each edge connects two different vertices and where no two edges connect the
same pair of vertices is called simple graph.
G H
Multi Graph:
Graphs that may have multiple edges connecting the same vertices are called multigraphs. When
there are m different edges associated to the same unordered pair of vertices {u, v}, we also say
that {u, v} is an edge of multiplicity m.
G H
Pseudo Graph:
Graphs that may include loops, and possibly multiple edges connecting the same pair of vertices,
are sometimes called pseudo graph. (An edge that connects a vertex to itself is called loop edge.)
G H
2
Discrete Structures (CS-335)
Mrs. Maryam Amin email id: maryam@biit.edu.pk Whatsapp# 0346-5410878
Mrs. Sadia Rashid email id: sadia@biit.edu.pk Whatsapp# 0334-4166270
Undirected Graph:
A graph having undirected edges, is called undirected graph.
Directed Graph:
Directed graph has directed edges. It is also called digraph.
3
Discrete Structures (CS-335)
Mrs. Maryam Amin email id: maryam@biit.edu.pk Whatsapp# 0346-5410878
Mrs. Sadia Rashid email id: sadia@biit.edu.pk Whatsapp# 0334-4166270
Mixed Graph:
A graph with both directed and undirected edges is called a mixed graph
4
Discrete Structures (CS-335)
Mrs. Maryam Amin email id: maryam@biit.edu.pk Whatsapp# 0346-5410878
Mrs. Sadia Rashid email id: sadia@biit.edu.pk Whatsapp# 0334-4166270
G H
Adjacents:
In undirected graphs two vertices are said to be adjacent if there is an edge between them. 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
or end vertex of (u, v). The initial vertex and terminal vertex of a loop are the same.
Incident:
In an undirected graph if a vertex v is end point of an edge e then we say that e is indecent on v.
5
Discrete Structures (CS-335)
Mrs. Maryam Amin email id: maryam@biit.edu.pk Whatsapp# 0346-5410878
Mrs. Sadia Rashid email id: sadia@biit.edu.pk Whatsapp# 0334-4166270
Degree of a vertex:
In an undirected graph, number of edges indecent on a vertex is called degree of the vertex. The
degree of the vertex v is denoted by deg(v).
In a directed graph the number of edges coming out of a vertex is called out-degree and number
of edges coming into it is called in-degree of the vertex. In a directed graph the in-degree of a
vertex v, denoted by deg – (v). The out-degree of v, is denoted by deg + (v). (Note that a loop at a
vertex contributes 1 to both the in-degree and the out-degree of this vertex.)
For Directed Graph:
Sum of all in-degrees = sum of all out-degrees = number of edges.
6
Discrete Structures (CS-335)
Mrs. Maryam Amin email id: maryam@biit.edu.pk Whatsapp# 0346-5410878
Mrs. Sadia Rashid email id: sadia@biit.edu.pk Whatsapp# 0334-4166270
Assignment # 11
Dear students read the given lectures carefully as per the course objectives mentioned on the top
and carryout the assignment as per following instructions
1. Submission Date: Sunday 17-May-2020 at 11:59PM; This will also count as your
Attendance for this week.
2. You must prepare handwritten Assignment and send it to respective course teacher (after
scanning it) for assessment by email only.
Determine whether the graphs shown below have directed or undirected edges, whether they
have multiple edges, and whether they have one or more loops. Use your answers to determine
the type of graph in Table I.
In the following graphs find the number of vertices, the number of edges, and the degree of each
vertex in the given undirected graph. Identify all isolated and pendant vertices.
In the following graphs determine the number of vertices and edges and find the in-degree and
out-degree of each vertex for the given directed multi-graph.