0% found this document useful (0 votes)
8 views87 pages

UNIT-II-Relations and Graphs Notes

This document provides an overview of set theory, including definitions of sets, subsets, power sets, and operations such as set difference and symmetric difference. It also covers concepts like cardinality, complements, De Morgan's laws, Cartesian products, relations, and their representations through matrices and digraphs. Examples are provided to illustrate each concept, making it a comprehensive review of foundational set theory principles.

Uploaded by

dhruvahegde1306
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)
8 views87 pages

UNIT-II-Relations and Graphs Notes

This document provides an overview of set theory, including definitions of sets, subsets, power sets, and operations such as set difference and symmetric difference. It also covers concepts like cardinality, complements, De Morgan's laws, Cartesian products, relations, and their representations through matrices and digraphs. Examples are provided to illustrate each concept, making it a comprehensive review of foundational set theory principles.

Uploaded by

dhruvahegde1306
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/ 87

UNIT II

SET THEORY(Review)
SET: A collection of well defined objects is called set.
Eg: Collection of even natural numbers
𝐴 = 0, 2, 4, 6, 8, … . = 𝑥 ∈ ℕ 𝑥 𝑖𝑠 𝑒𝑣𝑒𝑛}, where ℕ is set of
natural numbers.
Null set or Empty set: The Null set or the empty set is the set
containing no elements. It is denoted by { } or ∅.
For example: 𝐴 = 𝑥 𝑥 𝑖𝑠 𝑎𝑛 𝑖𝑛𝑡𝑒𝑔𝑒𝑟 𝑏𝑒𝑡𝑤𝑒𝑒𝑛 15 𝑎𝑛𝑑 16} = { }
Universal Set: The universal set is the set of all elements. It is
denoted as 𝑈.
Subset: What about the sets 𝐴 = {1, 2, 3} and 𝐵 = 1, 2, 3, 4 ?
Clearly 𝐴 , 𝐵 are not equal, but notice that every element of A is
also an element of B. Because of this we say that A is a subset of B,
or in symbols 𝐴 ⊆ 𝐵.
Note:
1. Set A is subset of itself.
2. For any set A, ∅ ⊆ A (i.e., empty set is a subset of A).
3. If 𝐴 ⊆ B and B ⊆ A, then 𝐴 = 𝐵.
Power set: If you collect all these subsets of A into a new set,
we get a set of sets. We call the set of all subsets of A the power
set of A, and write it 𝒫(𝐴).
The set of all subsets of a given set is called power set.
For 𝐴 = 1,2,3 ,
𝒫 𝐴 = ∅, 1 , 2 , 3 , 1,2 , 2,3 , 1,3 , 1,2,3
Cardinality of a set: The number of elements in a set A is called
cardinality of A. It is denoted as |𝐴|.
Ex: If 𝐴 = 1,2,3 , 𝐴 = 3.

Note: For any finite set A, 𝒫 𝐴 =2A.


For 𝐴 = 1,2,3 , 𝒫 𝐴 = 2 A = 23 = 8.
Set complement: Complement of a set A is a set of all elements of
universal set U which are not in A. It is denoted by 𝐴.ҧ

i .e., 𝐴ҧ = 𝑥 𝑥 ∈ 𝑈 , 𝑥 ∉ 𝐴}

𝐴ҧ

AAA
A
Symmetric difference:
The symmetric difference of sets A and B, denoted by 𝐴⨁𝐵,
consists of those elements which belong to A or B not to both.

Note: 𝐴⨁𝐵 = 𝑥 𝑥 ∈ 𝐴 𝑏𝑢𝑡 𝑥 ∉ 𝐵 𝑜𝑟 (𝑥 ∉ 𝐴 𝑏𝑢𝑡 𝑥 ∈ 𝐵)}


= (𝐴 − 𝐵) ∪ (𝐵 − 𝐴)
Set difference: The set difference 𝐴 − 𝐵 = 𝑥 𝑥 ∈ 𝐴 𝑎𝑛𝑑 𝑥 ∉ 𝐵}

De-Morgan’s Law:
(i) 𝐴 ∩ 𝐵 = 𝐴ҧ ∪ 𝐵ത
(ii) 𝐴 ∪ 𝐵 = 𝐴ҧ ∩ 𝐵ത
Product set:
If A and B are two nonempty sets, then the product set or
Cartesian product 𝐴 × 𝐵 is the set of all ordered pairs (𝑎, 𝑏) with
𝑎 ∈ 𝐴 and 𝑏 ∈ 𝐵. Thus
𝐴×𝐵 = 𝑎, 𝑏 𝑎 ∈ 𝐴 and 𝑏 ∈ 𝐵}.
Example: 1. Let 𝐴 = 1,2,3 𝑎𝑛𝑑 𝐵 = {𝑟, 𝑠}
then 𝐴×𝐵 = 1, 𝑟 , 1, 𝑠 , 2, 𝑟 , 2, 𝑠 , 3, 𝑟 , 3, 𝑠
also 𝐵 × 𝐴 = { 𝑟, 1 , 𝑟, 2 , 𝑟, 3 , 𝑠, 1 , 𝑠, 2 , 𝑠, 3 }
Note:
1. In general, (𝑎, 𝑏) ≠ (𝑏, 𝑎), so for two different sets A and B, 𝐴 ×
𝐵 ≠ 𝐵 × 𝐴.
2. a, b = (c, d) if and only if a = c and b = d.
3. A × B = A ∙ B = |B × A|.
4. For a set A, 𝐴 × 𝐴 = 𝑎, 𝑏 𝑎, 𝑏 ∈ 𝐴}
Ex: If 𝐴 = 1,0,2
𝐴 × 𝐴 = { 1,1 , 1, 0 , 1, 2 , 0, 1 , 0, 0 , 0, 2 , 2,1 , 2,0 , 2,2 }
5. Cartesian product 𝐴1 × 𝐴2 × ⋯ × 𝐴𝑛 of the nonempty sets
𝐴1 , 𝐴2 , … , 𝐴𝑛 is the set of all ordered n-tuples (𝑎1 , 𝑎2 , … , 𝑎𝑛 ), where
𝑎𝑖 ∈ 𝐴𝑖 , 𝑖 = 1,2, … , 𝑛.
Thus
𝐴1 × 𝐴2 × ⋯ × 𝐴𝑛 = {(𝑎1 , 𝑎2 , … , 𝑎𝑛 )| 𝑎𝑖 ∈ 𝐴𝑖 , 𝑖 = 1,2, … , 𝑛}.
Definition:
Let A and B be nonempty sets. A relation (or binary relation) R from
A to B is a subset of 𝐴 × 𝐵.
• If 𝑅 ⊆ 𝐴 × 𝐵 𝑎𝑛𝑑 𝑎, 𝑏 ∈ 𝑅, we say that a is related to b by R,
we also write 𝑎 𝑅 𝑏.
• If a is not related to b by R (i.e., 𝑎, 𝑏 ∉ 𝑅) , we write 𝑎 R b.
If 𝑅 ⊆ 𝐴 × 𝐴, we simply say that R is relation on A, instead of
relation from A to A.
Examples:
1. Let 𝐴 = 1, 2, 3 and 𝐵 = {𝑟, 𝑠}.
Then 𝑅 = 1, 𝑟 , 2, 𝑠 , 3, 𝑟 is a relation from A to B.
2. Let 𝐴 = 1, 2, 3, 4, 5 . Define the following relation R (less than) on
A: 𝑎 𝑅 𝑏 if and only if 𝑎 < 𝑏.
Then,
𝑅 = { 1, 2 , 1, 3 , 1, 4 , 1, 5 , 2, 3 , 2, 5 , 2, 4 , 3, 4 , 3, 5 , (4, 5)}.
4. Let 𝐴 = ℤ+ , the set of all positive integers.
Define the following relation R on A:
𝑎 𝑅 𝑏 if and only if "𝑎 𝒅𝒊𝒗𝒊𝒅𝒆𝒔 𝑏“.
Then 4 𝑅 12, 𝑏𝑢𝑡 5 𝑅 7.
5. Let 𝐴 = ℝ, the set of real numbers. We define the following relation
R on A:
𝑥2 𝑦2
𝑥𝑅𝑦 if and only if 𝑥 𝑎𝑛𝑑 𝑦 𝑠𝑎𝑡𝑖𝑠𝑓𝑦 𝑡ℎ𝑒 𝑒𝑞𝑢𝑎𝑡𝑖𝑜𝑛 + = 1.
4 9

𝑥2 𝑦2
The set R consists of all points on the ellipse + = 1.
4 9
The Matrix Representation of a Relation:
The relation between finite sets can be represented using a zero-one
matrix.
If 𝐴 = 𝑎1 , 𝑎2 , … , 𝑎𝑚 and B = 𝑏1 , 𝑏2 , … , 𝑏𝑛 are finite sets
containing 𝑚 and 𝑛 elements, respectively, and 𝑅 is a relation from 𝐴
to 𝐵. The relation R can be represented by the matrix 𝑴𝑹 = 𝑚𝑖𝑗 ,

1 𝑖𝑓 (𝑎𝑖 , 𝑏𝑗 ) ∈ 𝑅
𝑤ℎ𝑒𝑟𝑒 𝑚𝑖𝑗 = ൝
0 𝑖𝑓 (𝑎𝑖 , 𝑏𝑗 ) ∉ 𝑅

The matrix 𝑴𝑹 is called the matrix of 𝑅.


Example: 1. Let 𝐴 = 1, 2, 3 , 𝐵 = {𝑟, 𝑠} and 𝑅 = { 1, 𝑟 ,
2, 𝑠 , 3, 𝑟 }.

1 0
Then the matrix of 𝑅 is: 𝑴𝑹 = 0 1 .
1 0

Conversely, Given sets A and B with 𝐴 = 𝑚 and 𝐵 = 𝑛, an 𝑚 ×


𝑛 whose entries are zeros and ones determines a relation.
For example:
Consider the matrix

1 0 0 1
𝑴= 0 1 1 0
1 0 1 0
Since order of 𝑴 is 3 × 4, we let
𝐴 = 𝑎1 , 𝑎2 , 𝑎3 and B = 𝑏1 , 𝑏2 , 𝑏3 , 𝑏4
Then (𝑎𝑖 , 𝑏𝑗 ) ∈ 𝑅 if and only if 𝑚𝑖𝑗 = 1. Thus
𝑅= 𝑎1 , 𝑏1 , 𝑎1 , 𝑏4 , 𝑎2 , 𝑏2 , 𝑎2 , 𝑏3 , 𝑎3 , 𝑏1 , 𝑎3 , 𝑏3 .
The Digraph Representation of a Relation:
If 𝐴 is a finite set and 𝑅 is a relation on 𝐴 𝑖. 𝑒. , 𝑅 ⊆ 𝐴 × 𝐴 , we
can also represent 𝑅 pictorially as follows.
• Draw a small circle for each element of 𝐴. These circles are
called vertices.
• Draw an arrow called an edge, from vertex 𝑎𝑖 to 𝑎𝑗 if and only if
𝑎𝑖 𝑅 𝑎𝑗 .
• The resulting pictorial representation of 𝑅 is called a directed
graph or digraph of 𝑅.
Thus, if 𝑅 is a relation on 𝐴, the edges in the digraph of 𝑅 correspond
exactly to the pairs in 𝑅, and the vertices correspond exactly to the
elements of the set 𝐴.

Note: An edge from the element 𝑎𝑖 to 𝑎𝑖 itself is called loop.


Examples:
1. Let 𝐴 = {1, 2, 3, 4}
𝑅 = { 1, 1 , 1, 2 , 2, 1 , 2, 2 , 2, 3 , 2, 4 , 3, 4 , (4, 1)}
Then the digraph of 𝑅 is:
2

1 3

2. Find the relation determined by the graph: 2

1 3

4
In-degree and Out-degree of vertices:
If 𝑅 is a relation on a set 𝐴 and 𝒂 ∈ 𝑨, then
• the in-degree of 𝑎 (relative to the relation 𝑅) is the number of 𝑏 ∈
𝐴 such that 𝑏, 𝑎 ∈ 𝑅.
• The out-degree of 𝑎 is the number of 𝑏 ∈ 𝐴 such that 𝑎, 𝑏 ∈ 𝑅.
In other words, the in-degree of a vertex is the number of edges
terminating at the vertex. The out-degree of a vertex is the number of
edges leaving the vertex.
Example:
1. Consider the following graph:

1 3

4
2. Let 𝐴 = 𝑎, 𝑏, 𝑐, 𝑑 , and let 𝑅 be the relation on 𝐴 that has the matrix
1 0 0 0
𝑀𝑅 = 0 1 0 0
1 1 1 0
0 1 0 1
Construct the digraph of 𝑅, and list in-degrees and out-degrees of all
vertices.
3. Let 𝐴 = 1, 4, 5 , let 𝑅 be the relation given by the digraph shown
below. Find R and matrix of R.
1 4

5
Problems:
1. Give the relation R defined on 𝐴 and its digraph for following matrices:

1 1 0 1
i) Let 𝐴 = 1, 2, 3, 4 , 𝑀𝑅 = 0 1 1 0 .
0 0 1 1
1 0 0 0

1 1 0 0 0
0 0 1 1 0
ii) Let 𝐴 = 𝑎, 𝑏, 𝑐, 𝑑, 𝑒 , 𝑀𝑅 = 0 0 0 1 1.
0 1 1 0 0
1 0 0 0 0
2. Find the relations determined by the digraphs given below. Give its matrix and also find
in-degree and out-degree of each vertex:
1
i) 2
ii)

4 2
1 3
3
5

5 4

3. Let 𝐴 = 1, 2, 3, 4, 6 , 𝑅 be the relation on 𝐴 defined by 𝑎 𝑅 𝑏 if and only if “b is


multiple of a” .
i) Find a relation 𝑅.
ii) Find the domain and range of R
iii) Give the matrix of R
iv) Draw the digraph of R
v) Find in-degree and out-degree of each vertex.
Domain and Range of the relation:
Let 𝑅 ⊆ 𝐴 × 𝐵 be a relation from A to B.
The domain of R, denoted by Dom(R), is the set of all elements in A
that are related to some element in B.
In other words, Dom(R) the set of all first elements in the ordered
pairs of R.
i.e., 𝐷𝑜𝑚(𝑅) = 𝑎 ∈ 𝐴 𝑎, 𝑏 ∈ 𝑅}
The range of R, denoted by Ran(R), is the set of all elements in B that
are paired with some element in A.
In other words, Ran(R) the set of all second elements in the pairs in R.
i.e., Ran(𝑅) = 𝑏 ∈ 𝐵 𝑎, 𝑏 ∈ 𝑅}
Example:
Let 𝐴 = 1, 2, 3 , 𝐵 = {𝑟, 𝑠, 𝑡} and 𝑅 = 1, 𝑟 , 1, 𝑠 , 3, 𝑟 .
Then, 𝐷𝑜𝑚 𝑅 = 1, 3 and 𝑅𝑎𝑛(𝑅) = {𝑟, 𝑠}
Paths in Relations and Digraphs:
Suppose that 𝑅 is a relation on a set 𝐴.
A path of length n in R from a to b is a finite sequence
𝜋 ∶ 𝑎, 𝑥1 , 𝑥2 , … , 𝑥𝑛−1 , 𝑏, beginning with a and ending with b,
such that
𝑎 𝑅 𝑥1 , 𝑥1 𝑅 𝑥2 , … , 𝑥𝑛−1 𝑅 𝑏.
• Note that a path of length n involves 𝑛 + 1 elements of A, although
they are not necessarily distinct.
A path is most easily visualized with the help of the digraph of the
relation.
It appears as a geometric path or succession on edges in such digraph,
where the indicated directions of edges are followed, and in fact a path
derives its name from this representation.
Thus the length of a path is the number of edges in the path, where the
vertices need not be distinct.
Examples 1:
Consider the digraph :
2
1

5 4

Then 𝜋1 : 1, 2, 5, 4, 3 is a path of length 4 from vertex 1 to 3:


2
1

5 4
𝜋2 : 1, 2, 5, 1, is a path of length 3 from vertex 1 to itself:
1 2

5 4

𝜋3 : 2, 2, is a path of length 1 from vertex 2 to itself:

1 2

5 4
Cycles:
A path that begins and ends at the same vertex is called a cycle.
In the above example 𝜋2 𝑎𝑛𝑑 𝜋3 are cycles of length 3 and 1,
respectively.
Connectivity relation for R:
If n is a fixed positive integer, we define a relation 𝑹𝒏 on 𝑨 as
follows:
𝑥 𝑅𝑛 𝑦 means that there is a path of length n from 𝑥 𝑡𝑜 𝑦 in R.
We also define a relation 𝑹∞ on A , by letting 𝑥 𝑅∞ 𝑦 mean that
there is some path(of any length) in 𝑅 from 𝑥 𝑡𝑜 𝑦.
The relation 𝑅∞ is called the connectivity relation for 𝑅.
Example:
1. Let 𝐴 = {1, 2, 3, 4, 5, 6}. Let R be the relation whose digraph is
shown in figure below. Find the relation 𝑅2 on A.

2 5
1

4 3 6
Note that two vertices a and b are 𝑅2 connected if and only if there is a path of length two
connecting those vertices in graph.
Thus
1 𝑅2 2 since 1 𝑅 2 and 2𝑅2 path is : 1 → 2 → 2
1 𝑅2 4 since 1 𝑅 2 and 2𝑅4 1→2→4
1 𝑅2 5 since 1 𝑅 2 and 2𝑅5 1→2→5
2 𝑅2 2 since 2 𝑅 2 and 2 𝑅 2 2→2→2
2 𝑅2 4 since 2 𝑅 2 and 2𝑅4 2→2→4
2 𝑅2 5 since 2 𝑅 2 and 2𝑅5 2→2→5
2 𝑅2 6 since 2 𝑅 5 and 5 𝑅 6 2→5→6
3 𝑅2 5 since 3 𝑅 4 and 4𝑅6 3→4→6
4 𝑅2 6 since 4 𝑅 5 and 5𝑅6 4 → 5 → 60

Hence 𝑅2 = { 1, 2 , 1, 4 , 1, 5 , 2, 2 , 2, 4 , 2, 5 , 2, 6 , 3, 4 , 4, 6 }
Problems:

1. Let 𝐴 = { 𝑎, 𝑏, 𝑐, 𝑑, 𝑒} and
𝑅= 𝑎, 𝑎 , 𝑎, 𝑏 , 𝑏, 𝑐 , 𝑐, 𝑒 , 𝑐, 𝑑 , 𝑑, 𝑒
Compute (i) 𝑅2 and (ii) 𝑅∞ .
Problems:
1. Let 𝐴 = { 𝑎, 𝑏, 𝑐, 𝑑, 𝑒} and 𝑅 = 𝑎, 𝑎 , 𝑎, 𝑏 , 𝑏, 𝑐 , 𝑐, 𝑒 , 𝑐, 𝑑 , 𝑑, 𝑒
Compute (i) 𝑅2 and (ii) 𝑅∞ .
Solution: The digraph of R is shown below:
(i) 𝑎 𝑅2 𝑎 since 𝑎 𝑅 a and 𝑎𝑅𝑎 path is : 𝑎 → 𝑎 → 𝑎
a b 𝑎 𝑅2 𝑏 since 𝑎 𝑅 𝑎 and 𝑎𝑅𝑏 𝑎→𝑎→𝑏
𝑎 𝑅2 𝑐 since 𝑎 𝑅 𝑏 and 𝑏𝑅𝑐 𝑎→𝑏→𝑐
𝑏 𝑅2 𝑒 since 𝑏 𝑅 𝑐 and 𝑐𝑅𝑒 𝑏→𝑐→𝑒
d c
𝑏 𝑅2 𝑑 since b 𝑅 𝑐 and 𝑐𝑅𝑑 𝑏→𝑐→𝑑
e 𝑐 𝑅2 𝑒 since 𝑐 𝑅 𝑑 and 𝑑𝑅𝑒 c→𝑑→𝑒
Hence 𝑅2 = { 𝑎, 𝑎 , 𝑎, 𝑏 , 𝑎, 𝑐 , 𝑏, 𝑒 , 𝑏, 𝑑 , 𝑐, 𝑒 }

(ii) To compute 𝑅∞ , we need all ordered pairs of vertices for which there is a path of any length
from first vertex to second vertex. From the above digraph, we see that
𝑅∞ = { 𝑎, 𝑎 , 𝑎, 𝑏 , 𝑎, 𝑐 , 𝑎, 𝑑 , 𝑎, 𝑒 , 𝑏, 𝑐 , 𝑏, 𝑒 , 𝑏, 𝑑 , 𝑐, 𝑑 , 𝑐, 𝑒 ,
𝑑, 𝑒 }.
2. For the following digraphs, compute the matrices 𝑀𝑅2 and 𝑀𝑅∞

c
2 3

e
a
d 1 4

b f 6 5
Properties of Relations:
Reflexive relation:
A relation R on a set A is said to be reflexive if 𝑎, 𝑎 ∈ 𝑅 for all
𝑎 ∈ 𝐴, that is, 𝑎 𝑅 𝑎 for all 𝑎 ∈ 𝐴.
Thus R is reflexive if every element 𝑎 ∈ 𝐴 is related to itself.
Examples:
1. Let 𝐴 = {1, 2, 3}
𝑅1 = { 1, 1 , 2, 2 , (3,3)} is reflexive relation
𝑅2 = { 1, 2 , 2, 3 , (3,1)} is not a reflexive relation
2. Let △ = 𝑎, 𝑎 𝑎 ∈ 𝐴} is a reflexive relation on A, because
𝑎, 𝑎 ∈ △ for all 𝑎 ∈ 𝐴.
This relation is also called the “equality relation” on the set A.
so, △ = 𝑎, 𝑏 ∈ 𝐴 × 𝐴 𝑎 = 𝑏 }.
Note:
• The matrix of a reflexive relation must have all 1’s on its diagonal.
• A reflexive relation has a cycle of length 1(loop) at every vertex.
• R is reflexive if and only if ∆ ⊆ 𝑅.
Symmetric relations:
A relation R on a set A is said to be symmetric if whenever 𝑎 𝑅 𝑏,
then 𝑏 𝑅 𝑎.
Examples: 1. Let 𝐴 = ℤ, the set of integers,
𝑅= 𝑎, 𝑏 ∈ 𝐴 × 𝐴 𝑎 < 𝑏}, is the “less than” relation.
Here, if 𝑎, 𝑏 ∈ 𝑅, 𝑜𝑟 𝑎 𝑅 𝑏, i.e., 𝑎 < 𝑏,
then it is not true that 𝑏 < 𝑎 ( i. e., 𝑏 ≮ 𝑎 ), so R is not
symmetric.
2. Let 𝐴 = ℤ+ , set of positive integers. The relation R on A is defined
as: 𝑅= 𝑎, 𝑏 ∈ 𝐴 × 𝐴 𝑎 𝑑𝑖𝑣𝑖𝑑𝑒𝑠 𝑏},
Is R symmetric?

3. Let 𝐴 = {1, 2, 3, 4} and let 𝑅 = { 1, 2 , 2, 2 , 3, 4 , 4, 1 }.


Is R symmetric?
Matrix and digraph of a symmetric relation:
• The relation R is the symmetric if and only if 𝑀𝑅 = 𝑀𝑅𝑇 .
• The digraph of a symmetric relation R has the property that if there
is an edge from vertex i to vertex j, then there is an edge from vertex
j to vertex i.
• Thus, if two vertices are connected by an edge, they must always be
connected in both directions.
Transitive relation:
A relation R on a set A is transitive if whenever 𝑎 𝑅 𝑏 and 𝑏 𝑅 𝑐,
then 𝑎 𝑅 𝑐.
Examples:1. Let 𝐴 = ℤ, the set of integers, and let 𝑅 be the relation
“less than”.
To see whether R is transitive, we assume that 𝑎 𝑅 𝑏 and 𝑏 𝑅 𝑐.
Thus 𝑎 < 𝑏 and 𝑏 < 𝑐.
It then follows that 𝑎 < 𝑐, so 𝑎 𝑅 𝑐.
Hence R is transitive.
2. Let 𝐴 = ℤ+ , set of positive integers. The relation R on A is defined
as:
𝑅= 𝑎, 𝑏 ∈ 𝐴 × 𝐴 𝑎 𝑑𝑖𝑣𝑖𝑑𝑒𝑠 𝑏},
Is R transitive?
3. Let 𝐴 = {1, 2, 3, 4} and let 𝑅 = { 1, 2 , 2, 2 , 3, 4 , 4, 1 }.
Is R transitive?
Digraph of a Transitive relation:
If 𝑎 and 𝑐 are connected by a path of length 2 in R, then they must be
connected by a path of length l.
Thus, A relation R is transitive if and only if 𝑅2 ⊆ 𝑅.
Matrix Transitive relations:
A relation is transitive if and only if its matrix 𝑀𝑅 = [𝑚𝑖𝑗 ] has the
property
if 𝑚𝑖𝑗 = 1 and 𝑚𝑗𝑘 = 1, then 𝑚𝑖𝑘 = 1.
Equivalence relation:
A relation R on a set A is called an equivalence relation if it is reflexive, symmetric and
transitive.
Example 1: Let 𝐴 = 1, 2, 3, 4 and let
𝑅 = { 1, 1 , 1, 2 , 2, 1 , 2, 2 , 3, 4 , 4, 3 , 3, 3 , (4, 4)} is a equivalence
relation.
Example 2: Let 𝐴 = ℤ, the set of integers,
𝑅= 𝑎, 𝑏 ∈ 𝐴 × 𝐴 𝑎 ≤ 𝑏}, Is R an equivalence relation?
Operations on Relations:
Let R and S be relations from a set A to a set B 𝑖. 𝑒., 𝑅, 𝑆 ⊆ 𝐴 × 𝐵 . So
we can use set operations on relations.
ത is
1. Complementary relation : Complementary relation of R, denoted by 𝑅,
defined as:
𝑎𝑅ത b if and only if a R b or
𝑎, 𝑏 ∈ 𝑅ത if and only if a, b ∉ 𝑅.
2. Intersection 𝑅 ∩ 𝑆 :
𝑅∩𝑆 = 𝑎, 𝑏 𝑎, 𝑏 ∈ 𝑅 𝑎𝑛𝑑 𝑎, 𝑏 ∈ 𝑆}
3. Union 𝑅 ∪ 𝑆 :
𝑅∪𝑆 = 𝑎, 𝑏 𝑎, 𝑏 ∈ 𝑅 𝑜𝑟 𝑎, 𝑏 ∈ 𝑆}
4. Inverse: A different type of operation on a relation from A to B is the
formation of inverse, it is denoted by 𝑅 −1 .
The relation 𝑅−1 is a relation from B to A defined by
𝑏 𝑅 −1 𝑎 𝑖𝑓 𝑎𝑛𝑑 𝑜𝑛𝑙𝑦 𝑖𝑓 𝑎 𝑅 𝑏 or
𝑏, 𝑎 ∈ R−1 if and only if a, b ∈ 𝑅.
Example: Let 𝐴 = 1, 2, 3, 4 and 𝑅 = 1, 3 , 2, 1 , 2, 2 , 2, 3
Here 𝑅 −1 = 3, 1 , 1, 2 , 2, 2 , 3, 2
Closure of a relation:
Let R be a relation on a set A.
R may or may not have some property P, such as reflexivity, symmetry, or
transitivity.
If there is a relation S (smallest relation) with property P containing R, then R is
called the closure of R with respect to P.
1. The reflexive closure of R is: 𝑹 ∪△, where △ is an equality relation.
2. The symmetric closure of R is: 𝑹 ∪ 𝑹−𝟏 .
3. The transitive closure of R is : 𝑹∞ .
Transitive Closure and Warshall’s Algorithm:
To find transitive closure 𝑅∞ of a relation R , we use following
methods.
Method 1: Digraph method – Since 𝑅 ∞ is the transitive closure, we
can proceed geometrically by computing all paths.
Method 2: Warshall’s Algorithm:
Let A be a set with n elements and R be a relation on A.
Warshall’s algorithm is based on the construction of Boolean matrices.
These matrices are
𝑊0 , 𝑊1 , … , 𝑊𝑛 where 𝑊0 = 𝑀𝑅 is the matrix of the relation R.
We obtain 𝑊1 from 𝑊0 , 𝑊2 from 𝑊1 and so on.
That is, 𝑀𝑅 = 𝑊0 → 𝑊1 → 𝑊2 → ⋯ → 𝑊𝑛−1 → 𝑊𝑛 = 𝑀𝑅∞ .
We have following procedure for computing 𝑾𝒌 from 𝑾𝒌−𝟏 .
Step 1: First transfer all 1’s in 𝑾𝒌−𝟏 to 𝑾𝒌 .
Step 2: List the locations 𝑝1 , 𝑝2 , 𝑝3 , … in column k of 𝑾𝒌−𝟏 ,
where the entry is 1 and the locations 𝑞1 , 𝑞2 , 𝑞, … in row k of
𝑾𝒌−𝟏 , where the entry is 1.

Step 3: Put 1’s in all the positions 𝑝𝑖 , 𝑞𝑗 of 𝑾𝒌 (if they are not
already there).
1. Let 𝐴 = 1, 2, 3, 4 and let
𝑅 = { 1, 2 , 2, 3 , 3, 4 , (2, 1)}. Find the transitive closure of
R using Warshall’s algorithm.
Solution:

0 1 0 0
Here 𝑀𝑅 = 1 0 1 0 =𝑊 and 𝑛 = 4.
0
0 0 0 1
0 0 0 0
First we find 𝑊1 from 𝑊0 . For 𝑊1 , look at locations of 1’ s in column 1 and row 1 of 𝑊0 .
𝑊0 has 1’s in location 2 = 𝑝1 of column 1 and location 2 = 𝑞1 of row 1.
Thus 𝑊1 is just 𝑊0 with new 1 in the position (2, 2) 𝑖. 𝑒. , 𝑝1 , 𝑞1 .

0 1 0 0
𝑊1 = 1 1 1 0
0 0 0 1
0 0 0 0
Now we compute 𝑊2 from 𝑊1 . For 𝑊2 , we must consult column 2 and row 2 of 𝑊1 .
Locations of 1’s in 2nd column of 𝑊1 are : 1, 2
Locations of 1’s in 2nd row of 𝑊1 are : 1, 2 and 3.
Thus for 𝑊2 , we must put 1’s in positions (1, 1), (1, 2), (1, 3), (2, 1), (2, 2), (2, 3) of 𝑊1 (if
1’s are not already there).
Functions ( Review)
A function 𝑓: 𝐴 → 𝐵 is a special relation such that for each element 𝑎 ∈ 𝐴 there is
exactly (or at most) one element 𝑏 ∈ 𝐵. This is written as 𝑓(𝑎) = 𝑏.
or 𝑓 = 𝑎, 𝑏 𝑏 = 𝑓 𝑎 ∈ 𝐵, 𝑓𝑜𝑟 𝑎 ∈ 𝐴}
Here set is 𝐴 called domain and 𝐵 is called codomain of the function 𝑓. The element 𝑎 in 𝐴
is called argument of the function and 𝑓(𝑎) is called image of 𝑎 under 𝑓. The set of all images
of elements of 𝐴 is called range of 𝑓. So 𝑟𝑎𝑛𝑔𝑒 𝑓 = 𝑓 𝑎 ∈ 𝐵 𝑎 ∈ 𝐴}.
Example 1: Let 𝐴 = {1, 2, 3, 4} and 𝐵 = 𝑎, 𝑏, 𝑐, 𝑑 , and let
𝑓= 1, 𝑎 , 2, 𝑎 , 3, 𝑑 , 4, 𝑐
A f B
1 a Here 𝑟𝑎𝑛𝑔𝑒 𝑓 = {𝑎, 𝑐, 𝑑}.
2 b
3 c
4 d
Example 2: Let 𝐴 = {1, 2, 3} and 𝐵 = 𝑥, 𝑦, 𝑧 , consider the following relations
R= 1, 𝑥 , 2, 𝑥 , (3, 𝑧)
S= 1, 𝑥 , 1, 𝑦 , 2, 𝑧 , (3, 𝑦)
Here R is a function. But S is not a function, because 𝑆 1 = 𝑥, 𝑦 , 1 has two images.

Example 3: Let P be a computer program that accepts an integer as input and produces an
integer as output. Let 𝐴 = 𝐵 = ℤ. Then P determines a relation 𝑓𝑝 defined as follows:
𝑚, 𝑛 ∈ 𝑓𝑝 means that 𝑛 is the output produced by program P where the input is 𝑚.

Note: Example 3 can be generalized to a program with any set 𝐴 of possible inputs and set 𝐵 of
corresponding outputs. In general, therefore, we may think of functions are input-output
relations.
Different types of functions:
1. Injective (or one-to-one) function:
Let 𝑓: 𝐴 → 𝐵, be a function, then 𝑓 is said to be injective function,
if 𝑓 𝑥1 = 𝑓 𝑥2 ⇒ 𝑥1 = 𝑥2
or if 𝑥1 ≠ 𝑥2 ⇒ 𝑓 𝑥1 ≠ 𝑓 𝑥2 .
2. Surjective (or onto) function:
Let 𝑓: 𝐴 → 𝐵, be a function, then 𝑓 is said to be surjective function, if “𝑟𝑎𝑛𝑔𝑒 𝑜𝑓 𝑓 = 𝐵”
or every element of set 𝐵 is a image of some element of set 𝐴.
3. Bijective function:
A function 𝑓: 𝐴 → 𝐵 is bijective if 𝑓 is both injective and surjective.
Invertible functions:
A function 𝑓: 𝐴 → 𝐵 is said to be invertible function if its inverse relation, 𝑓 −1 , is also a
function.
Example 1: Let 𝐴 = {1, 2, 3, 4} and 𝐵 = 𝑎, 𝑏, 𝑐, 𝑑 , and let
𝑓= 1, 𝑎 , 2, 𝑎 , 3, 𝑑 , 4, 𝑐
here, 𝑓 −1 = 𝑎, 1 , 𝑎, 2 , 𝑑, 3 , 𝑐, 4 which is not a function, since 𝑓 −1 = 1, 2 .
Note: A function is invertible if and only if it is bijective. More over 𝑓 −1 is also bijective.
Composition of functions:
Let 𝑓: 𝐴 → 𝐵 and 𝑔 ∶ 𝐵 → 𝐶 be functions. Then the composition of 𝑓 and 𝑔, 𝑔 ∘ 𝑓, is a relation
from 𝐴 to 𝐶, defined by 𝑔 ∘ 𝑓 𝑥 = 𝑔 𝑓 𝑥 for every 𝑥 ∈ A.

Example 1: Let 𝑓: ℝ → ℝ , defined by 𝑓 𝑥 = 𝑥 3 ,


𝑔 ∶ ℝ → ℝ , defined by 𝑔 𝑥 = 4𝑥 2 + 1
ℎ ∶ ℝ → ℝ , defined by ℎ 𝑥 = 7𝑥 − 2
Then, 𝑔 ∘ 𝑓 𝑥 = 𝑔 𝑓 𝑥 = 𝑔 𝑥3 = 4 𝑥3 2
+ 1 = 4𝑥 6 + 1

𝑓∘𝑔 𝑥 =𝑓 𝑔 𝑥 = 𝑓 4𝑥 2 + 1 = 4𝑥 2 + 1 3

/* Till this topic review*/


Permutation functions: A bijection from a set 𝐴 to itself is called a permutation of 𝐴.
Example 1: Let 𝐴 = ℝ and let 𝑓: 𝐴 → 𝐴 be defined by 𝑓 𝑥 = 2𝑥 + 1. Since 𝑓 is
bijective(verify), it follows that 𝑓 is a permutation of 𝐴.
Example 2: Let 𝐴 = 1, 2, 3 . Then all the permutations of 𝐴 are

1 2 3 1 2 3 1 2 3
1𝐴 = , 𝑝1 = , 𝑝2 =
1 2 3 1 3 2 2 1 3
1 2 3 1 2 3 1 2 3
𝑝3 = 𝑝4 = 𝑝5 =
2 3 1 3 1 2 3 2 1
Example 3: Using the permutations of Example 2, compute 𝑎 𝑝4−1 ; b 𝑝3 ∘ 𝑝2 .
Solution: (a) Viewing 𝑝4 as a function, we have
𝑝4 = 1, 3 , 2, 1 , 3, 2 .

1 2 3
Then, 𝑝4−1 = 3, 1 , 1, 2 , 2, 3 = 1, 2 , 2, 3 , 3, 1 = = 𝑝3
2 3 1
(b) For 𝑝3 ∘ 𝑝2 ,

1 2 3 1 2 3
𝑝3 ∘ 𝑝2 = ∘
2 3 1 2 1 3
Here, The function 𝑝2 takes 1 to 2 and 𝑝3 takes 2 to 3, so 𝑝3 ∘ 𝑝2 takes 1 to 3.
𝑝2 𝑝3 𝑝3 ∘ 𝑝2
1 2 3, so 1 3
2 1 2, so 2 2
3 3 1, so 3 1

1 2 3 1 2 3 1 2 3
So, 𝑝3 ∘ 𝑝2 = ∘ = = 𝑝5 .
2 3 1 2 1 3 3 2 1
Or
Note: 1. The composition of two permutation is another permutation, usually referred to as the
product of these permutations.
2. Product of two permutations is not commutative.
3. If 𝐴 = {𝑎1 , 𝑎2 , … , 𝑎𝑛 } is a set with n elements, then there are 𝑛! Permutations of A.
Cyclic permutations:
Let 𝑏1 , 𝑏2 , … , 𝑏𝑟 be distinct elements of the set 𝐴 = {𝑎1 , 𝑎2 , … , 𝑎𝑛 }. The permutation
p: 𝐴 → 𝐴 defined by
𝑝 𝑏1 = 𝑏2
𝑝 𝑏2 = 𝑏3

𝑝 𝑏𝑟−1 = 𝑏𝑟
𝑝 𝑏𝑟 = 𝑏1 and 𝑝 𝑥 =𝑥 if 𝑥 ∈ 𝐴, 𝑥 ∉ {𝑏1 , 𝑏2 , … , 𝑏𝑟 },
Two cycles are said to be disjoint if no element of A appears in both cycles.
Example: Let 𝐴 = 1, 2, 3, 4, 5, 6 . Then the cycles 1, 2, 5 𝑎𝑛𝑑 (3, 4, 6) are disjoint,
whereas the cycles (1, 2, 5) and (2, 4, 6) are not.

Note:1. It is true that if 𝑝1 and 𝑝2 are disjoint cycles, then 𝑝1 ∘ 𝑝2 = 𝑝2 ∘ 𝑝1 .


2. A permutation of a finite set that is not the identity or a cycle can be written as a product
of disjoint cycles of length ≥ 2.

1 2 3 4 5 6 7 8 of the set
Example: Write the permutation 𝑝 =
3 4 6 5 2 1 8 7
𝐴 = {1, 2, 3, 4, 5, 6, 7, 8} as a product of cycles.
Solution:
We start with 1 and find 𝑝 1 = 3, 𝑝 3 = 6 𝑎𝑛𝑑 𝑝 6 = 1, so there is a cycle (1, 3, 6).
Next we choose the first element of A that has not appeared in a previous cycle.
We choose 2, and we have 𝑝 2 = 4, 𝑝 4 = 5 𝑎𝑛𝑑 𝑝 5 = 2, so we obtain the cycle
(2, 4, 5).
Now, we choose 7, 𝑝 7 = 8 𝑎𝑛𝑑 𝑝 8 = 7, we obtain the cycle 7, 8 .
Then, we can write 𝑝 as a product of disjoint cycles as
𝑝 = 1, 3, 6 ∘ 2, 4, 5 ∘ 7, 8 .

Transpositions:
A cycle of length 2 is called a transposition. That is, a transposition is a cycle 𝑝 = 𝑎𝑖 , 𝑎𝑗 ,

where 𝑝 𝑎𝑖 = 𝑎𝑗 and 𝑝 𝑎𝑗 = 𝑎𝑖 .
Every cycle can be written as a product of transpositions. In fact,
𝑏1 , 𝑏2 , … , 𝑏𝑟 = 𝑏1 , 𝑏𝑟 ∘ 𝑏1 , 𝑏𝑟−1 ∘ ⋯ ∘ (𝑏1 , 𝑏3 ) ∘ (𝑏1 , 𝑏2 ).
Example:
1. 1, 2, 3, 4, 5 = 1, 5 ∘ 1, 4 ∘ (1, 3) ∘ (1, 2).
2. 𝑝 = 1, 3, 6 ∘ 2, 4, 5 ∘ 7, 8 = 1, 6 ∘ 1, 3 ∘ (2, 5) ∘ (2, 4) ∘ 7, 8 .

Even and Odd permutations:


If a permutation of a finite set can be written as a product of an even number of
transpositions, then it can never be written as a product of an odd number of transpositions and
conversely.
A permutation of a finite set is called even if it can be written as a product of an even
number of transpositions, and it is called odd if it can be written as a product of an odd number
of transpositions.
Example: 1, 2, 3, 4, 5 = 1, 5 ∘ 1, 4 ∘ (1, 3) ∘ (1, 2) is an even permutation.
Problems:

1 2 3 4 5 6 7
1. Is the permutation 𝑝 = even or odd
2 4 5 7 6 3 1
Solution:
First we write 𝑝 as a product of disjoint cycles, obtaining
𝑝 = 1, 2, 4, 7 ∘ 3, 5, 6 = 1, 7 ∘ 1, 4 ∘ 1, 2 ∘ 3, 6 ∘ 3, 5 .
Since 𝑝 is a product of an odd number of transpositions, it is an odd permutation.

2. Let 𝐴 = 𝑎, 𝑏, 𝑐, 𝑑, 𝑒, 𝑓, 𝑔 . Write each permutation as a product of disjoint cycles.

𝑎 𝑏 𝑐 𝑑 𝑒 𝑓 𝑔
(a)
𝑔 𝑑 𝑏 𝑎 𝑐 𝑓 𝑒

𝑎 𝑏 𝑐 𝑑 𝑒 𝑓 𝑔
(b)
𝑑 𝑒 𝑎 𝑏 𝑔 𝑓 𝑐
3. Let 𝐴 = 1, 2, 3, 4, 5 . Let𝑓 = 5, 2, 3 and 𝑔 = (3, 4, 1) be permutation of A.
Compute each of the following and write the result as the product of disjoint cycles.
(a) 𝑓 ∘ 𝑔 (b) 𝑓 −1 ∘ 𝑔−1 .

1 2 3 4 5 6
4. Let 𝐴 = 1, 2, 3, 4, 5, 6 and 𝑝 = be a permutation of A.
4 3 5 1 2 6
(a) Write 𝑝 as a product of disjoint cycles.
(b) Compute 𝑝−1 .
(c) Compute 𝑝2 .
(d) Find the period of 𝑝, that is, the smallest positive integer 𝑘 such that 𝑝𝑘 = 1𝐴 .
Graphs
Graphs are discrete structures consisting of vertices and edges that connect the vertices.

Definitions:
A graph 𝐺 = (𝑉, 𝐸) consists of 𝑉, a nonempty set of vertices and 𝐸, a set of edges. Each
edge is associated with one or two vertices, called its end points.
Example: Let 𝐺 = 𝑉, 𝐸 , 𝑉 = 𝑣1 , 𝑣2 , 𝑣3 , 𝑣4 and 𝐸 = {𝑒1 , 𝑒2 , 𝑒3 , 𝑒4 , 𝑒5 }, where
𝑒1 = 𝑣1 , 𝑣2 , 𝑒2 = 𝑣1 , 𝑣3 , 𝑒3 = 𝑣2 , 𝑣3 , 𝑒4 = 𝑣3 , 𝑣4 𝑎𝑛𝑑 𝑒5 = 𝑣1 , 𝑣4 .
Graph G is given by: 𝑣1 𝑒1 𝑣2
𝑒4 𝑒2 𝑒3
𝑣4 𝑣3
𝑒5
Note: The set of vertices 𝑉 of a graph 𝐺 may be infinite. A graph with an infinite vertex set is
called an infinite graph, and graph with a finite vertex set is called a finite graph.
Here we will discuss about finite graphs.

Multiple edges:
Two or more edges connecting the same pair of vertices are called multiple edges.
Example:
𝑒1
𝑒2
𝑣1 𝑣2
𝑒3

Loops:
An edge having same vertex as its end points is called a loop.
Example: 𝑣 𝑒1
Simple graph: A graph without loops and without multiple edges is called simple graph.
Example:

Multigraph: A graph with multiple edges but no loops is called multigraph.


Example:

Pseudo graph: A graph with both loops and multiple edges is called pseudo graph.
Directed graph (or digraph):
A directed graph or digraph 𝐺 = (𝑉, 𝐸) consists of a nooempty set 𝑉 and a set of edges E.
Each directed edge is associated with an ordered pair of vertices. called it end points.
Example: Let 𝐺 = 𝑉, 𝐸 , 𝑉 = 𝑣1 , 𝑣2 , 𝑣3 , 𝑣4 and 𝐸 = {𝑒1 , 𝑒2 , 𝑒3 , 𝑒4 , 𝑒5 }, where
𝑒1 = 𝑣1 , 𝑣2 , 𝑒2 = 𝑣1 , 𝑣3 , 𝑒3 = 𝑣2 , 𝑣3 , 𝑒4 = 𝑣3 , 𝑣4 𝑎𝑛𝑑 𝑒5 = 𝑣1 , 𝑣4 .
Graph G is given by: 𝑣1 𝑒1 𝑣2
𝑒4 𝑒2 𝑒3
𝑣4 𝑣3
𝑒5
When a directed graph has no loops and no multiple directed edges is called a simple directed
graph.
A directed graph with multiple edges is called directed multi graph.
A graph with both directed and undirected edges is called a mixed graph.
Graph Terminology and Special Types of Graphs:
Two vertices 𝑢 𝑎𝑛𝑑 𝑣 in an undirected graph G are called 𝒂𝒅𝒋𝒂𝒄𝒆𝒏𝒕 (or neighbors) in
𝐺 if 𝑢 𝑎𝑛𝑑 𝑣 are endpoints of an edge 𝑒 of 𝐺.
Such an edge e is called 𝒊𝒏𝒄𝒊𝒅𝒆𝒏𝒕 𝒘𝒊𝒕𝒉 the vertices 𝑢 𝑎𝑛𝑑 𝑣 and 𝑒 is said to
𝒄𝒐𝒏𝒏𝒆𝒄𝒕 𝒖 𝒂𝒏𝒅 𝒗.
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 𝒅𝒆𝒈(𝒗).
Example 1: deg 𝑎 = 4
deg 𝑏 = 6
deg 𝑐 = 1
deg 𝑑 = 5 deg 𝑒 = 6
Example 2: deg 𝑎 = 2
deg 𝑏 = 4
deg 𝑐 = 4
deg 𝑑 = 1
deg 𝑒 = 3
deg 𝑓 = 4
deg 𝑔 = 0
Note:
1. A vertex of degree zero is called isolated. It follows that an isolated vertex is not adjacent to
any vertex. Vertex g in Example 2 is isolated vertex.
2. A vertex of degree 1 is called pendent. A pendant vertex is adjacent to exactly one other
vertex. Vertex d in Example 2 is pendant.
Theorem 1: The Handshaking Theorem:
Let 𝐺 = (𝑉, 𝐸) be an undirected graph with 𝑚 edges.
Then 2𝑚 = σ𝑣∈𝑉 deg(v) .
(Note that this applies even if multiple edges and loops are present.)

Justification: Each edge contributes two to the sum of the degrees of the vertices because an edge
is incident with exactly two (possibly equal) vertices. This means that the sum of the degrees of
the vertices is twice the number of edges.

Question: How many edges are there in a graph with 10 vertices each of degree six? (find !)
Theorem 2: An undirected graph has an even number of vertices of odd degree.
Proof:
Let 𝑉1 and 𝑉2 be the set of vertices of even degree and the set of vertices of odd degree,
respectively, in an undirected graph 𝐺 = (𝑉, 𝐸) with 𝑚 edges.
Then by Hand shaking property, we have,
2𝑚 = σ𝑣∈𝑉 deg(v) = σ𝑣∈𝑉1 deg(v) + σ𝑣∈𝑉2 deg(v)
Because deg(𝑣) is even for 𝑣 ∈ 𝑉1 , the first term in the right-hand side of the last equality is even.
Furthermore, the sum of the two terms on the right-hand side of the last equality is even, because this
sum is 2𝑚.
Hence, the second term in the sum is also even.
Because all the terms in this sum are odd, there must be an even number of such terms.
Thus, there are an even number of vertices of odd degree.
Definitions: If (𝑢, 𝑣) is a directed edge of the graph 𝐺, then 𝑢 is said to be adjacent to 𝒗
and 𝑣 is said to be adjacent from 𝒖.
The vertex 𝑢 is called the initial vertex of (𝒖, 𝒗), and 𝑣 is called the terminal or end vertex of
(𝒖, 𝒗).
The initial vertex and terminal vertex of a loop are the same.
In a graph with directed edges the in-degree of a vertex 𝑣, denoted by deg − (𝑣), is the
number of edges with 𝑣 as their terminal vertex.
The out-degree of 𝑣, denoted by deg + 𝑣 , is the number of edges with 𝑣 as their initial
vertex.
Some Special Simple Graphs
Complete Graphs: A complete graph on 𝒏 vertices, denoted by 𝐾𝑛 , is a simple graph that
contains exactly one edge between each pair of distinct vertices.
The graphs 𝐾𝑛 , for n = 1, 2, 3, 4, 5, 6, are given below.

A simple graph for which there is at least one pair of distinct vertex not connected by an edge is
called non complete.
Cycles: A cycle 𝑪𝒏 , 𝑛 ≥ 3, consists of 𝑛 vertices 𝑣1 , 𝑣2 , . . . , 𝑣𝑛 and edges
𝑣1 , 𝑣2 , 𝑣2 , 𝑣3 , . . . , 𝑣𝑛−1 , 𝑣𝑛 𝑎𝑛𝑑 𝑣𝑛 , 𝑣1 . The cycles 𝐶3 , 𝐶4 , 𝐶5 , 𝑎𝑛𝑑 𝐶6 are
shown below:

Wheels: We obtain a wheel 𝑾𝒏 by adding an additional vertex to a cycle 𝐶𝑛 , 𝑓𝑜𝑟 𝑛 ≥ 3,


and this new vertex is connected with each of the 𝑛 vertices in 𝐶𝑛 , by new edges. The wheels
𝑊3 , 𝑊4 , 𝑊5 𝑎𝑛𝑑 𝑊6 are given below:
Bipartite Graphs
A simple graph 𝐺 is called bipartite if its vertex set 𝑉 can be partitioned into two disjoint
sets 𝑉1 and 𝑉2 such that every edge in the graph connects a vertex in 𝑉1 and a vertex in 𝑉2 .
(So that no edge in 𝐺 connects either two vertices in 𝑉1 or two vertices in 𝑉2 ).
When this condition holds, we call the pair (𝑉1 , 𝑉2 ) a bipartition of the vertex set 𝑉 of 𝐺.

Example 1: 𝐶6 is bipartite, as shown in Figure, because its vertex set can be partitioned into the
two sets 𝑉1 = {𝑣1 , 𝑣3 , 𝑣5 } and 𝑉2 = {𝑣2 , 𝑣4 , 𝑣6 }, and every edge of 𝐶6 connects a
vertex in 𝑉1 and a vertex in 𝑉2 .

Example 2: 𝐾3 is not bipartite (Verify).


Are the graphs G and H given below bipartite?

Complete bipartite graphs:


A bipartite graph G with partite sets V1 and V2 is called a complete bipartite graph if for
every u ∈ V1 and v ∈ V2 there exist an edge u, v .
A complete bipartite graph G = (V1 , V2 , E) in which the bipartitions V1 and V2 contains
m , n elements respectively with m ≤ n, is denoted by K m, n.
A graph K m, n contains (𝑚 + 𝑛) vertices and 𝑚𝑛 edges.
Examples:
Representing Graphs:
Adjacency Matrices

The adjacency matrix 𝑿 = 𝒙𝒊𝒋 of a graph 𝐺 with 𝑝 vertices and containing no


multiple edges is a square matrix of order 𝑝 × 𝑝,

where 𝒙𝒊𝒋 = ቊ 1 𝑖𝑓 𝑡ℎ𝑒𝑟𝑒 𝑖𝑠 𝑎𝑛 𝑒𝑑𝑔𝑒 𝑐𝑜𝑛𝑛𝑒𝑐𝑡𝑖𝑛𝑔 𝑖𝑡ℎ 𝑎𝑛𝑑 𝑗𝑡ℎ 𝑣𝑒𝑟𝑡𝑖𝑐𝑒𝑠


0 𝑜𝑡ℎ𝑒𝑟𝑤𝑖𝑠𝑒
Example: Write adjacency matrix of following graph:

𝑋 =
Note:
Adjacency matrices can also be used to represent undirected graphs with loops and with
𝑡ℎ
multiple edges. A loop at the vertex 𝑣𝑖 is represented by a 1 at the 𝑖, 𝑖 position of the
adjacency matrix. When multiple edges connecting the same pair of vertices 𝑣𝑖 and 𝑣𝑗 ,
or multiple loops at the same vertex, are present, the adjacency matrix is no longer a
𝑡ℎ
zero–one matrix, because the 𝑖, 𝑗 entry of this matrix equals the number of edges
that are associated to {𝑣𝑖 , 𝑣𝑗 }. All undirected graphs, including multigraphs and pseudo
graphs, have symmetric adjacency matrices.
Example: The adjacency matrix of the graph given below is:

𝐴𝐺 =
1. Write adjacency matrix of following graphs:

(i) (ii) (iii)

2. Draw the graph if its adjacency matrix is:

0 1 0 1 1
1 0 1 0 1
(i) 𝑋 = 0 1 0 1 0 (ii) 𝑋 =
1 0 1 0 1
1 1 0 1 0
Incidence Matrices
Let 𝐺 = (𝑉, 𝐸) be an undirected graph. Suppose that 𝑣1 , 𝑣2 , . . . , 𝑣𝑛 are the vertices and
𝑒1 , 𝑒2 , . . . , 𝑒𝑚 are the edges of 𝐺. Then the incidence matrix with respect to this ordering of
𝑉 and 𝐸 is the 𝑛 × 𝑚 matrix 𝑴 = [𝑚𝑖𝑗 ], where

1 𝑤ℎ𝑒𝑛 𝑒𝑑𝑔𝑒 𝑒𝑗 𝑖𝑠 𝑖𝑛𝑐𝑖𝑑𝑒𝑛𝑡 𝑤𝑖𝑡ℎ 𝑣𝑖


𝑚𝑖𝑗 = ቊ .
0 𝑜𝑡ℎ𝑒𝑟𝑤𝑖𝑠𝑒
Example: Represent the graph with an incidence matrix:

Incidence matrix is: 𝑀=


1. Represent the following graphs with an incidence matrices:

(i) (ii) 2 3

2. Write the graph if its incidence matrix is:

1 0 0 1
0 1 0 0
𝑀= 0 0 1 1
1 1 0 0
0 0 1 0
3. Write adjacency and incidence matrices for the following graphs:
𝐾5 , 𝐶6 , 𝐶4 , 𝐾2,3 , 𝐾3,3 .

You might also like