DM UNIT4 Notes
DM UNIT4 Notes
DM UNIT4 Notes
UNIT: 4
Syllabus:- Graphs: Finite graphs, incidence and degree, isomorphism, sub graphs and union of
graphs, connectedness, walk, paths, and circuits, Eulerian graphs ,tree properties of trees,
pendant vertices in tree, center of tree, spanning trees and cut vertices, binary tree ,matrix
representation of graph, incidence and adjacency matrix and their properties, applications of
graphs in computer science.
Graph Theory: In discrete mathematics, is the study of the graph. A graph is determined as a
mathematical structure that represents a particular function by connecting a set of points.
The graph is made up of vertices (nodes) that are connected by the edges (lines).
Graph: A graph is a structure amounting to a set of objects in which some pairs of the objects
are in some sense "related". The objects correspond to mathematical abstractions
called vertices (also called nodes or points) and each of the related pairs of vertices is called
an edge (also called link or line). Typically, a graph is depicted in diagrammatic form as a set of
dots or circles for the vertices, joined by lines or curves for the edges.
Vertices, 𝑉 = {𝑎, 𝑏, 𝑐, 𝑑}
Diagram:
a b
c
d
Fig.1
Types of Graph: The graphs are basically of two types, directed and undirected.
Directed Graph: A directed graph is a graph made up of a set of vertices connected by edges, in
which the edges have a direction associated with them.
1 2
Fig.2
Undirected Graph: The undirected graph is defined as a graph where the set of nodes are
connected together, in which all the edges are bidirectional. Sometimes, this type of graph is
known as the undirected network.
1 2
Fig.3
Other types of graphs:
A complete graph with five vertices and ten edges are given below in the figure:
Fig.4
Planar graph: When no two edges of a graph intersect and are all the vertices and edges
are drawn in a single plane, then such a graph is called a planar graph
graph.
Finite graph: A finite graph is a graph in which the vertex set and the edge set are finite sets.
Otherwise, it is called an infinite graph
graph.
Incidence: If two edges 𝑒 and 𝑓 have a common vertex A,, the edges are called incident. If the
vertex A is on edge 𝑒,, the vertex A is often said to be incident on 𝑒.
Fig.5
Consider the graph pictured in above figure. This is a directed graph. It consists of four vertices,
vertices
𝐴, 𝐵, 𝐶, 𝐷, i.e., 𝑉 (𝐺) = {𝐴, 𝐵, 𝐶𝐶, 𝐷} and the seven following edges: 𝐸(𝐺) = {𝑒 , 𝑒 , . . . , 𝑒 } =
𝐵, 𝐶), (𝐷, 𝐶), (𝐵, 𝐵)} The edges 𝑒 and 𝑒 are said to be parallel
{(𝐴, 𝐷), (𝐵, 𝐴), (𝐵, 𝐴), (𝐷, 𝐵), (𝐵
since they both begin at B and end at A. The edge 𝑒 is a loop since it begins and ends at B.
Example: Consider the graph G in Fig. 5. We have: outdeg (𝐴) = 1, outdeg (𝐵)
( = 4, outdeg
(𝐶) = 0, outdeg (𝐷) = 2,, indeg (𝐴) = 2, indeg (𝐵) = 2, indeg (𝐶) = 2,, indeg (𝐷) = 1
Subgraphs: Let 𝐺 = 𝐺(𝑉 , 𝐸) be a directed graph, and let V ′ be a subset of the set 𝑉 of vertices
of 𝐺. Suppose E ′ is a subset of E such that the endpoints of the edges in E ′ belong to V ′ . Then 𝐻
(V ′ , E ′ ) is a directed graph, and it is called a subgraph of 𝐺.
Binary operations on Graphs: Binary operations create a new graph from two initial
graphs 𝑮𝟏 = (𝑽𝟏 , 𝑬𝟏 ) and 𝑮𝟐 = (𝑽𝟐 , 𝑬𝟐 ), such as: graph union: 𝑮𝟏 ∪ 𝑮𝟐 and graph
intersection: 𝑮𝟏 ∩ 𝑮𝟐 .
Example: (i)
Example: (ii)
Intersection of two graphs: The intersection of two graphs 𝑮𝟏 and 𝑮𝟐 is defined as
𝑮𝟏 ∩ 𝑮𝟐 = (𝑽𝟏 ∩ 𝑽𝟐 , 𝑬𝟏 ∩ 𝑬𝟐 ).
Example:
Tree: A tree is an undirected graph in which any two vertices are connected by exactly one path
and does not contains any cycle or self
self-loop.
1 if there is an edge 𝑣 , 𝑣
𝑎 = . Such a matrix A, which contains entries of only 0 or 1,
0 otherwise
is called a bit matrix or a Boolean matrix
matrix.
Note: The adjacency matrix 𝐴 = 𝑎 may be extended to directed graphs with parallel edges
by setting: 𝑎 = the number of edges beginning at 𝑣 and ending at 𝑣 . Then the entries of A will
be nonnegative integers. Conversely, every 𝑚 × 𝑚 matrix 𝐴 with nonnegative integer entries
uniquely
niquely defines a directed graph with 𝑚 vertices.
Example:
Solution: By using the definition of adjacency matrix of a graph, we obtain the following matrix:
2.