Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 7

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

(Week 12) Lecture 23

Objectives: Learning objectives of this lecture are

 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.

It has two types


1) Simple Directed graph:
When a directed graph has no loops and has no multiple directed edges is called simple directed
graph.

2) Multi Directed graph:


Directed graphs that have multiple directed edges from one vertex to another, such graphs are
called multi directed graph.

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

(Week 12) Lecture 24

Objectives: Learning objectives of this lecture are

 Understand Adjacent Vertices and Incident Edges


 Know Degree of Vertices
 Determine Isolated and Pendant Vertices
Text Book & Resources: Discrete Mathematics and its Applications (7th Edition) by Kenneth H.
Rosen, 6th Edition

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.

In Directed Graph H: In Undirected Graph G:


a is adjacent to a , b , e a is adjacent to b , f
b is adjacent to d b is adjacent to a , f , e , c
c is adjacent to c , b c is adjacent to b , f , e , d
d is adjacent to c , e d is adjacent to c
e is adjacent to a , d , e e is adjacent to b , c , f
f is adjacent to none f is adjacent to a , b , c , e
g is adjacent to none

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.

For Undirected Graph:


Sum of all degrees = 2E
In Undirected Graphs:
In G, deg(a) = 2, deg(b) = 4, deg(c) = 4, deg(d) = 1, deg(e) = 3, deg(f) = 4, and deg(g) = 0.
2+4+4+1+3+4+0 = 2(9)
18=18
In directed Graph:
The in-degrees in G are
deg – (a) = 2, deg – (b) = 2, deg – (c) = 3, deg – (d) = 2, deg – (e) = 3, and deg – (f) = 0.
The out-degrees in G are
deg +(a) = 4, deg + (b) = 1, deg + (c) = 2, deg + (d) = 2, deg + (e) = 3, and deg + (f) =0.
Sum of In-degree=Sum of Out-degree=No of edges
2+2+3+2+3+0 = 4+1+2+2+3+0 = 12
12 = 12 = 12
Isolated and Pendant Vertices:
A vertex of degree zero is called isolated. It follows that an isolated vertex is not adjacent to any
vertex. A vertex is pendant if and only if it has degree one. Consequently, a pendant vertex is
adjacent to exactly one other vertex.
In Undirected Graph G Isolated Vertex is g and Pendant Vertex is d

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.

You might also like