MCA-25 Discrete Mathematics
MCA-25 Discrete Mathematics
MCA-25
DISCRETE MATHEMATICS
AND OPTIMIZATION
SITY OF S
I V ER CI
UN E
R
N
CE
M BE SHWA
& TE CH NO
JA
U
O L
R
GY
GU
CONTENTS
1. SET THEORY 3
4. GROUP 77
5. GRAPH 100
SIMPLEX METHOD
SET THEORY
REVISED /UPDATED SLM BY RENU BANSAL
STRUCTURE
1.2 Introduction
1.12 Summary
1.13 Keywords
1.2 INTRODUCTION
One of the widely used concepts in present day Mathematics is the concept of Sets. It is considered the
language of modern Mathematics. The whole structure of Pure or Abstract Mathematics is based on the
concept of sets. German mathematician Georg Cantor (1845-1918) developed the theory of sets and
subsequently many branches of modern Mathematics have been developed based on this theory. In this
unit, preliminary concepts of sets,set operations and some ideas on its practical utility will be
introduced.
The objects forming a set may be of any sort– they may or may not have any common property. Let us
consider the following collections:
(i) the collection of the prime numbers less than 15 i.e.,2,3,5,7, 11,13
Clearly the objects in the collections (i) and (ii) are well-defined. For example, 7 is a member of (i), but
20 is not a member of (i). Similarly, ‘a’ is a member of (ii), but M.S.Dhoni is not a member. So,the
collections (i) and (ii) are sets. But the collections (iii) and (iv) are not sets, since the objects in these
collections are not well-defined.
The objects forming a set are called elements or members of the set.Sets are usually denoted by capital
letters A, B, C, ...; X, Y, Z, ..., etc., and the elements are denoted by small letters a,b,c,...;x,y,z,...,etc.
If ‘a’ is an element of a set A, then we write aɛA which is read as‘ a belongs to the set A’ or in short,‘ a
belongs to A’. If ‘a’ is not an element of A, we write a ø A and we read as‘ a does not belong to A’. For
example, let A be the set of prime number less than15. Then
2A,3A,5A,7A,11A,1A,4A,17A,etc.
In the Roster method, the elements of a set are listed in any order, separated by commas and are
enclosed within braces, For example,
In the set C, the elements are all the odd natural numbers.We cannot list all the elements and hence the
dots have been used showing that the list continues in definitely.
In the Rule method,a variable x is used to represent the elements of a set, where the elements satisfy a
definite property, say P(x). Symbolically, the set is denoted by {x:P(x)} or {x|p(x)}.For example,
2
A = {x: x is an odd natural number} B = {x: x –3x+2 = 0}, etc.
A = {1, 3, 5, ...}
B = {1, 2}
Some Standard Symbols for Sets and Numbers: The following standard symbols are used to
represent different sets of numbers:
the set of real numbers Z+,Q+,R+respectively represent the sets of positive integers, positive rational
numbers and positive real numbers. Similarly, Z–, Q–, R– represent respectively the sets of negative
0 0 0
integers, negative rational numbers and negative real numbers. Z , Q , R represent the sets of non-zero
integers, non- zero rational numbers and non-zero real numbers.
Definition: A set which does not contain any element is called an empty set or a null set or a void
set. It is denoted by .
2
(i) the set {x: x = 3 and x cQ}
(ii) the set of people in Assam who are older than 500 years
2
(iii) the set of real roots of the equation x + 4 =0
Let us consider the sets A = {1, 2, 3, 4, 5}and B = {1, 4, 7, 10, 13, ...}
If we count the members (all distinct) of these sets, then the counting process comes to an end for the
elements of set A, where as for the elements of B, the counting process does not come to an end. In the
first case we say that A is a finite set and in the second case, B is called an infinite set. A has finite
number of elements and number of elements in B are infinite.
Definition: A set containing finite number of distinct elements so that the process of counting the
elements comes to an end after a definite stage is called a finite set; otherwise, a set is called an infinite
set.
Example: State which of the following sets are finite and which are infinite.
Solution:
1.3.3 EQUALSETS
Definition: Two sets A and B are said to be equal sets if every element of A is an element of B and
every element of B is also an element of A. In other words, A is equal to B, denoted by A = B if A and
B have exactly the same elements. If A and B are not equal, we write A ≠ B.
Solution: A = B, C = D, A ≠ C, A ≠ D, A ≠ E, B ≠ C, B ≠ D, B ≠ E, C ≠ E, D ≠ E
Let us consider the sets A = {1, 2, 3}, B = {1, 2, 3, 4} and C = {3, 2, 1}. Clearly, every element of A is
an element of B, but A is not equal toB.Again, every element of A is an element of C, and also A is
equal to C. In both cases, we say that A is a subset of B and C.In particular, we say that A is a proper
subset of B, but A is not a proper subset of C.
Definition: If every element of a set A is also an element of another set B, then A is called a subset of
B, or A is said to be contained in B, and is denoted by A B. Equivalently, we say that B contains A or
B is a super set of A and is denoted by B A.
If A is a subset of B, but the re exists at least one element in B which is not in A, then A is called a
proper subset of B, denoted by AB.In other words, AB(ABand A≠B).
The symbol ‘’ stands for ‘logically implies and is implied by’. Some examples of proper subsets are
as follows: N Z, N Q, N R, Z Q, Z R, Q R.
It should be noted that any set A is a subset of itself, that is, AA. Also, the null set is a subset of
every set, that is, A for any set A. Because, if A, then there must exist an element x such that x
A. But x , hence we must accept that A. Combining the definitions of equality of sets and that of
subsets.
1.3.5 POWERSET
Let us consider a set A = {a, b}. A question automatically comes to our mind– ‘What are the subsets of
A?’ The subsets of A are , {a}, {b} and A itself. These subsets, taken as elements, again form a set.
Such a set is called the power set of the given set A.
Definition: The set consisting of all the subsets of a given set A as its elements, is called the power set
A A
of A and is denoted by P(A) or 2 . Thus, P(A) or 2 = {X: X A}
Clearly,
1.3.6 UNIVERSALSET
A set is called a Universal Set or the Universal discourse if it contains all the sets under consideration in
a particular discussion. A universal set is denoted by U.
Example:
For the sets {1, 2, 3}, {3, 7, 8}, {4, 5, 6, 9}We can take U = {1, 2, 3, 4, 5, 6, 7, 8, 9}
In connection with the population in India, the set of all people in India is the universal set, etc.
1.4VENNDIAGRAM
Simple plane geometrical areas are used to represent relationships between sets in meaningful and
illustrative ways. These diagrams are called Venn-Euler diagrams, or simply theVenn-diagrams.
In Venn diagrams, the universal set U is generally represented by a set of points in a rectangular area
and the subsets are represented by circular regions within the rectangle, or by any closed curve within
the rectangle. As an illustration Venn diagrams of AU,ABU are given below:
U U B
A
A
AU ABU
Similar Venn diagrams will be used in subsequent discussions illustrating different algebraic
operations on sets.
1.5 SETOPERATIONS
We know that given a pair of numbers x and y, we can get new numbers x+y, x–y, xy, x/y (with y ≠ 0)
under the operations of addition, subtraction, multiplication and division. Similarly, given the two sets A
and B we can
form new sets under set operations of union, intersection, difference and complements. We will now
define these set operations, and the new sets thus obtained will be shown with the help of Venn
diagrams.
Definition: The union of two sets A and B is the set of all elements which are members of set A or set B
or both. It is denoted by A B, read as ‘A union B’ where ‘’ is the symbol for the operation of
‘union’. Symbolically we can describe A B as follows:
AB={x:xAorxB}
A B (Shaded)
Then A B = {1, 2, 3, 4, 5, 6}
Example2:Let Q be the set of all rational numbers and K be the set of all irrational numbers and R be
the set of all real numbers. Then QK = R
(i) AB=BA
(ii) AA=A
(iii) A$= A
(iv) AU = U
(v) (AB)C=A(BC)
Proof:
= {x: x B or x A}
= B A
=U
= {x: x A or (x B or xC}
= A(B C)
Definition: The intersection of two sets A and B is the set of all elements which are members of both A
and B. It is denoted by AB, read as ’A intersections B’, where ‘’ is the symbol for the operation of
‘intersection’. Symbolically we can describe it as follows:
AB (Shaded)
From definition it is clear that if A and B have no common element, then AB = . In this case, the two
sets A and B are called disjoint sets.
AB =
Identities:
(i) AB=BA
(ii) AA=A
(iii) A=
(iv) AU=A
(v) (AB)C=A(BC)
Proof:
= {x : x B and x A}
= BA
= {x : x A}
=A
Hence A=
=A
(v) (AB)C={x:xABandxC}
= {x : x A and x B C}
= A(B C)
(vi) xA(BC)Aandx(BC)
Definition: The difference of two sets A and B is the set of all elements which are members of A, but
not of B. It is denoted by A–B.
Then A – B = {2, 3}
A–C=A
B–C=B
B–A=
Properties:
(i) A – A =
(iv) A–(BC)=(A–B)(A–C)
(v) A–(BC)=(A–B)(A–C)
(A – B) (A – C)
So,A–(BC)(A–B)(A–C),(A–B)(A–C)A–(BC)
Hence,A–(BC)=(A–B)(A–C).
Definition:If U be the universal set of a set A, then the set of all those elements in U which are not
members of A is called the Compliment of A, denoted by AcorA.
Symbolically, A={x:xUandxA}.
A'
A
Clearly,A=U–A.
ThenA={1,3,5,7,9}
Identities:
(i) U'=,=U
(ii) (A)=A
(iii) AA=U,AA=
(iv) A–B=AB,B–A=BA
(v) (AB)=AB,(AB)=AB
(AB)={x:xUandxAB}
={x:xAandxB}
=AB.
In the preceding discussions we have stated and proved various identities under the
operations of union, intersection and complement of sets. These identities are considered as
Laws of Algebra of Sets. These laws can be directly used to prove different propositions on
Set Theory. These laws are given below:
A U = A, A =
(A)=A,U=,=U
(AB)=AB.
Example2:Prove thatA(AB)=AB
A set S is countable if S is finite or if the elements of S can be arranged as a sequence, in which case S
is said to be countably infinite; otherwise S is said to be uncountable. The set E of even integers is
countably infinite, whereas one can prove that the unit interval I = [0, 1] is uncountable.
The notation n(S) or |S| will denote the number of elements in a set S. Thus n(A) = 26, where A is the
letters in the English alphabet, and n(D) = 7, where D is the days of the week. Also n(Φ) = 0 since the
empty set has no elements.
Theorem: Suppose A and B are finite disjoint sets. Then A ∪ B is finite and
Suppose S is the disjoint union of finite sets A and B. Then S is finite and
Proof: In counting the elements of A ∪ B, first count those that are in A. There are n(A) of these. The
only other elements of A ∪ B are those that are in B but not in A. But since A and B are disjoint, no
element of B is in A, so there are n(B) elements that are in B but not in A. Therefore, n(A ∪
B) = n(A) + n(B).
For any sets A and B, the set A is the disjoint union of A\B and A ∩ B. Thus theorem gives us the
following useful result.
For example, suppose an art class A has 25 students and 10 of them are taking a biology class B. Then
the number of students in class A which are not in class B is:
Given any set A, recall that the universal set U is the disjoint union of A and AC. Accordingly, Theorem
also gives the following result.
For example, suppose a class U with 30 students has 18 full-time students. Then there are 30−18 = 12
part-time students in the class U.
There is a formula for n(A ∪ B) even when they are not disjoint, called the Inclusion–Exclusion
Principle. Namely:
Theorem (Inclusion–Exclusion Principle) : Suppose A and B are finite sets. Then A ∪ B and A ∩ B
are finite and
That is, we find the number of elements in A or B (or both) by first adding n(A) and n(B) (inclusion)
and then subtracting n(A ∩ B) (exclusion). since its elements were counted twice.
We can apply this result to obtain a similar formula for three sets:
EXAMPLE : Suppose a list A contains the 30 students in a mathematics class, and a list B contains the
35 students in an English class, and suppose there are 20 names on both lists. Find the number of
students:
(a) List A has 30 names and 20 are on list B; hence 30 − 20 = 10 names are only on list A.
By inclusion–exclusion,
In other words, we combine the two lists and then cross out the 20 names which appear twice.
(d) By (a) and (b), 10 + 15 = 25 names are only on one list; that is, n(A ᶿ B) = 25.
CLASSES OF SETS
Given a set S, we might wish to talk about some of its subsets. Thus we would be considering a set of
sets.Whenever such a situation occurs, to avoid confusion, we will speak of a class of sets or collection
of sets rather than a set of sets. If we wish to consider some of the sets in a given class of sets, then we
speak of subclass or subcollection.
(a) Let A be the class of subsets of S which contain exactly three elements of S. Then
That is, the elements of A are the sets {1, 2, 3}, {1, 2, 4}, {1, 3, 4}, and {2, 3, 4}.
(b) Let B be the class of subsets of S, each which contains 2 and two other elements of S. Then
The elements of B are the sets {1, 2, 3}, {1, 2, 4}, and {2, 3, 4}. Thus B is a subclass of A, since every
element of B is also an element of A. (To avoid confusion, we will sometimes enclose the sets of a class
in brackets instead of braces.)
Partitions
Let S be a nonempty set. A partition of S is a subdivision of S into non overlapping, nonempty subsets.
Aj ≠ Ak then Aj ∩ Ak = Φ
The subsets in a partition are called cells. Figure given below is a Venn diagram of a partition of the
rectangular set
Then (i) is not a partition of S since 7 in S does not belong to any of the subsets. Furthermore, (ii) is not
a partition of S since {1, 3, 5} and {5, 7, 9} are not disjoint.
What is a Multiset?
The difference between sets and multisets is in how they address multiples: a set includes any number at
most once, while a multiset allows for multiple instances of the same number. There is just one set with
elements a and b, the set {a,b}, but there are many multisets: {a, b, b}, {a, a, b}, and {a, a, a, a, b, b} are
just a few.
Multiplicity:
The multiplicity of an element x in a multiset is just the number of times that element appears in the
set. For instance, in the multiset {3, 3, 4, 5, 6} the element 3 has multiplicity 2. The elements 4, 5, and 6
all have multiplicity 1.
If we know the elements included and the multiplicity for each of them we know everything about a
multiset. A multiset which includes just 4 with multiplicity 2, 5 with multiplicity 7 and 99 with
multiplicity 2 can be written as {4, 4, 5, 5, 5, 5, 5, 99, 99}. Order doesn’t matter, so this is the same as
{4, 99, 5, 4, 99, 5, 5, 5, 5 }
To distinguish between sets and multisets, a notation that incorporates square brackets is sometimes
used: the multiset {a, a, b} can be denoted as [a, a, b].
The cardinality of a multiset is constructed by summing up the multiplicities of all its elements. For
example, in the multiset {a, a, b, b, b, c} the multiplicities of the members a, b, and c are respectively 2,
3, and 1, and therefore the cardinality of this multiset is 6.
Operations on Multisets
1. Union of Multisets: The Union of two multisets A and B is a multiset such that the multiplicity of an
element is equal to the maximum of the multiplicity of an element in A and B and is denoted by A ∪ B.
Example:
Let A = {l, l, m, m, n, n, n, n}
B = {l, m, m, m, n},
A ∪ B = {l, l, m, m, m, n, n, n, n}
2. Intersections of Multisets: The intersection of two multisets A and B, is a multiset such that the
multiplicity of an element is equal to the minimum of the multiplicity of an element in A and B and is
denoted by A ∩ B.
Example:
Let A = {l, l, m, n, p, q, q, r}
B = {l, m, m, p, q, r, r, r, r}
A ∩ B = {l, m, p, q, r}.
3. Difference of Multisets: The difference of two multisets A and B, is a multiset such that the
multiplicity of an element is equal to the multiplicity of the element in A minus the multiplicity of the
element in B if the difference is +ve, and is equal to 0 if the difference is 0 or negative
Example:
Let A = {l, m, m, m, n, n, n, p, p, p}
B = {l, m, m, m, n, r, r, r}
A - B = {n, n, p, p, p}
4. Sum of Multisets: The sum of two multisets A and B, is a multiset such that the multiplicity of an
element is equal to the sum of the multiplicity of an element in A and B
Example:
Let A = {l, m, n, p, r}
B = {l, l, m, n, n, n, p, r, r}
A + B = {l, l, l, m, m, n, n, n, n, p, p, r, r, r}
5. Cardinality of Sets: The cardinality of a multiset is the number of distinct elements in a multiset
without considering the multiplicity of an element
Example:
A = {l, l, m, m, n, n, n, p, p, p, p, q, q, q}
3
(iii) C = {x: x –1 =0}
3. List the elements of the following sets if the universal set is U = {a, b, c, …, y, z}.
4. Let A = {1, 2, …, 8, 9}, B = {2, 4, 6, 8}, C = {1, 3, 5, 7, 9}, D = {3, 4, 5}, E = {3, 5}.
Which of the these sets can equal a set X under each of the following conditions?
6. Consider the universal set U = {1, 2, 3, …, 8, 9} and sets A = {1, 2, 5, 6}, B = {2, 5, 7},
C= {1, 3, 5, 7, 9}. Find:
(b) A ∪ B and B ∪ C (d) A\B and A\C (f) (A ∪ C)\B and (B ΦC)\A
(ii) A = {x: x is a letter of the word WOLF} B = {x: x is a letter of the word FLOW}
(a) Find the number of people who read at least one of the three magazines.
(b) Find the number of people who read exactly one magazine.
12. Let A = [{1, 2, 3}, {4, 5}, {6, 7, 8}]. (a) List the elements of A; (b) Find n(A).
13. Let S = {a, b, c, d, e, f , g}. Determine which of the following are partitions of S:
(a) P1 = [{a, c, e}, {b}, {d, g}], (c) P3 = [{a, b, e, g}, {c}, {d, f }],
(b) P2 = [{a, e, g}, {c, d}, {b, e, f }], (d) P4 = [{a, b, c, d, e, f , g}].
1.12 SUMMARY
1. A set is a collection of well-defined and distinct objects. The objects are called members or
elements of the set.
2. Sets are represented by capital letters and elements by small letters. If’a’ is an element of set A,we
write 𝑎 ∈ 𝐴,otherwise 𝑎 ∉ 𝐴.
3. Sets are represented by (i) Roster or Tabular method and (ii)Ruleor Set-builder method.
4. Aset having no element is called empty set or null set or void set, denoted by$.
5. A set having a finite number of elements is called a finite set,otherwise it is called an infinite set.
6. Two sets AandB are equal,i.e. A=B if and only if every element of A is an element of B and also
every element of B is an element of A, otherwise AB.
9. The set of all the subsets 8 a set A is called the power set of A, denoted by P(A)or 2A. If |A|=n,
then |P(A)|=2n.
10. Venn diagrams are plane geometrical diagrams used for representing relationships between sets.
11. The union of two sets AandB is AB which consists of all elements which are either in Aor B or
in both. AB={x:xcAor xcB}
12. The intersection of two sets AandB is ABwhich consists of all the elements common to both A
andB.
13. For any two sets A and B, the difference set, A – B consists of all elements which are in A,but not
in B.A– B={x: xcA and xøB}
14. The Universal Set U is that set which contains all the sets under any
c
15. The complement of a set A, denoted by A orAis that set which consists of all those elements in
U which are not in A.
A'={x:xcUandxøA}=U–A
AA'=U,AA'=$,(A')'=A,U'=$,$'=U
(AB)'=A'B',(AB)'=AB'.
1.13 KEYWORDS
Singleton Set: -If a set contains only one element it is called to be a singleton set.
Finite Set: -A set consisting of a natural number of objects, i.e. in which number element is finite is
said to be a finite set. Consider the sets.
Infinite set: -If the number of elements in a set is finite, the set is said to be an infinite set.
Subset: -A subset A is said to be subset of B if every elements which belongs to A also belongs to B.
Power set: -Power set of a set is defined as a set of every possible subset. If the cardinality
of A is n than Cardinality of power set is 2^n as every element has two options either to belong to a
subset or not.
Universal set: -Any set which is a superset of all the sets under consideration is said to be universal set
and is either denoted by omega or S or U.
Multi sets: multi set isa collection of unordered numbers, where every element X occurs a finite
number of times.
E = {1, 2}
2
F = {x: x – 1 = 0}
3. Find the sets which are finite and which are infinite:
(i) 𝐴– 𝐵 = 𝐵′– 𝐴′
7. Write down the power set of the set 𝐴 = {{$}, 𝑎, {𝑏, 𝑐}}.
8. Given 𝐴 = {{𝑎, 𝑏}, {𝑐}, {𝑑, 𝑒, 𝑓}}, how many elements are there in 𝑃(𝐴)?
(i) 𝐴𝑢𝐵𝑐𝐴𝑢𝐶but𝐵ø𝐶
(ii) 𝐴𝑛𝐵𝑐𝐴𝑛𝐶but𝐵ø𝐶
10. A survey on a sample of 25 new cars being sold at a local auto dealer was conducted to see which
of three popular options, air-conditioning (A), radio (R), and power windows (W), were already
installed. The survey found:
Find the number of cars that had: (a) onlyW; (b) onlyA; (c) onlyR; (d)R andW but notA; (e)A and R
but not W; (f) only one of the options; (g) at least one option; (h) none of the options.
11. Let S = {1, 2, …, 8, 9}.Determine whether or not each of the following is a partition of S
(a) [{1, 3, 6}, {2, 8}, {5, 7, 9}] (c) [{2, 4, 5, 8}, {1, 9}, {3, 6, 7}]
(b) [{1, 5, 7}, {2, 4, 8, 9}, {3, 5, 6}] (d) [{1, 2, 7}, {3, 5}, {4, 6, 8, 9}, {3, 5}]
Ans:1
(ii) B = {January, February, March, April, May, June, July, August, September, October,
November, December}
2
(iii) C = {1, w,w }
(v) E = {A, B, E, G, L, R}
Ans: 2 B = C = E = F, A = D = G = H.
C = {a, b, c, d, e}.
Ans : 5 (i) True, (ii) False, (iii) True, (iv) True, (v) False, (vi)True.
Ans:7 (i) , (ii) $, (iii) finite, (iv) infinite, (v) infinite, (vi) .
Ans:9 A = {3, 6, 9, 12, 15, 18, 21, ...}, B = {1, 2, 3, ..., 18, 19, 20},
And B–A={1,2,4,5,7,8,10,11,13,14,16,17,19}
[Φ, {1}, {2}, {3}, {4}, {5}, {1, 2}, {1, 3}, {1, 4}, {1,5}, {2, 3}, {2, 4}, {2, 5},
{3, 4}, {3, 5}, {4, 5}, {1, 2,3}, {1, 2, 4}, {1, 2, 5}, {2, 3, 4}, {2, 3, 5}, {3, 4, 5},
{1, 3, 4}, {1, 3, 5}, {1, 4, 5}, {2, 4, 5}, {1, 2, 3, 4},{1, 2, 3, 5}, {1, 2, 4, 5},
= 65 + 45 + 42 − 20 − 25 − 15 + 8 = 100
Ans12: (a) A has three elements, the sets {1, 2, 3}, {4, 5}, and {6, 7, 8}.
(b) n(A) = 3.
Ans:13 (a) P1 is not a partition of S since f ∈ S does not belong to any of the cells.
1.12REFERENCES/SUGGESTED READINGS
STRUCTURE
2.2 Introduction
2.11 Summary
2.12 Keywords
3. equivalence relation
5. Equivalence class
8. Composition of function
2.2 INTRODUCTION
Set theory may be called the language of modern mathematics. We know that a set is a well-defined
collection of objects. Also we know the notion of subset of a set. If every element of a set B is in set A,
then B is a subset of A. Symbolically we denote it by B A.
Also we note that if A is a finite set having n elements, the number of subsets of A is2n. A gain if A, B
are two non-empty sets,
Cartesian product
The Cartesian product of A and B is denoted by A×B and is defined by AB{(a,b):aA, bB}
Also we know that if A, B are finite and n(A)=x, n(B)= y, then n(AXB) = n(BXA)=xy
In this unit we will study relations and functions which are subsets of Cartesian product of two sets.We
will denote the set of natural numbers by ‘N’, the set of integers by Z, the set of rational numbers by Q,
the set of real numbers by IR, the set of complex numbers by C.
11 is greater than10.
35 is divisible by7.
In each of the sentences there is a relation between two ‘objects’. Now let us see what is meant by
relation in set theory.
Definition Let A and B be two non-empty sets. A subset R of AXB is said to be a relation from Ato
B.If A=B, then any subset of A X A is said to be a relation on A. If R AxB, and
(a,b)R;aA,bB,it is also written as a Rb and is read as ‘a is R related to b’.
Note. The set of the first components of the ordered pairs of R is called the domain and the set of the
second components of the ordered pairs of R is called the range of R. If A,B are finite sets and
xy
n(A)=x,n(B)=y; then n(AXB)=xy.So,the number of subsets of AXB is2 .Therefore, the number of
xy
relations from A to B is 2 .
A x B ={(1, 8), (1, 9), (2, 8), (2, 9), (3, 8), (3, 9)}
Clearly RAxB
Domain of R = {1, 2, 3}
Range of R = {8, 9}
Example 2:Let IR be the set of real numbers. Let R = {(x, y): x, y IR, x<y} IR x IR
R is a relation of IR.
19<27, (19, 27)R i.e. 19R27 But 5>3, (5, 3) R, i.e. 5 R3.
Example 3: Let X be the set of odd integers. Let R = {(x, y): x, y X and x+y is odd}
R =X x X
Example 4: Let E be the set of even integers. Let R = {(x, y): x, y E and x+y is even}
R = E x EE x E
Let A be a non-emptyset. I = {(a, a): aA} A xA IAis called the identity relation on A.
Example 5: Let A = {1, 2, 3, 4} Then I = {(1, 1), (2, 2), (3, 3), (4, 4)} A x A.
Let A,B be two non-empty sets.Let R be a relation from AtoB,i.e. RAxB. The inverse relation of R is
-1 -1 -1
denoted by R ,and is defined by R = {(b, a): (a, b)R} B xA. Clearly, domain of R = range of R
-1
range of R = domain of R
Let S be a relation on the set R of real numbers; that is, S is a subset of R2 = R × R. Frequently, S
consists of all ordered pairs of real numbers which satisfy some given equation E(x, y) = 0 (such as x2 +
y2 = 25).
Since R2 can be represented by the set of points in the plane, we can picture S by emphasizing those
points in the plane which belong to S. The pictorial representation of the relation is sometimes called the
graph of the relation. For example, the graph of the relation x2+y2 = 25 is a circle having its center at
the origin and radius 5.
There is an important way of picturing a relation R on a finite set. First we write down the elements of
the set, and then we draw an arrow from each element x to each element y whenever x is related to y.
This diagram is called the directed graphof the relation. For example, shows the directed graph of the
following relation R on the set A = {1, 2, 3, 4}:
R = {(1, 2), (2, 2), (2, 4), (3, 2), (3, 4), (4, 1), (4, 3)}
Suppose A and B are finite sets. There are two ways of picturing a relation R from A to B.
(i) Form a rectangular array (matrix) whose rows are labeled by the elements of A and whose
columns are labeled by the elements of B. Put a 1 or 0 in each position of the array according
as a ∈A is or is not related to b ∈B. This array is called the matrix of the relation.
(ii) Write down the elements of A and the elements of B in two disjoint disks, and then draw an
arrow from a ∈A to b ∈B whenever a is related to b. This picture will be called the arrow
diagram of the relation. Figure below pictures the relation R by the above two ways.
2. R is called symmetric if whenever (a, b)R, then (b, a)R, i.e, if whenever aRb,then bRa;
a,bA.
3. R is called anti-symmetric if (a, b)R, (b, a)R a = b, i.e., if aRb, bRa a=b; a, bA.
4. R is called transitive if whenever (a,b),(b,cR, then (a,c)R, i.e., if whenever aRb, bRc, then
aRc;a,b,cA.
Example 7: Let A = {1, 2, 3} R = (1, 1), (2, 2), (1, 2), (2, 1)} Examine if R is reflexive, symmetric,
anti-symmetric, transitive.
Solution: Here (1, 1)R, (2, 2)R; but (3, 3)R. R is not reflexive.
R is not symmetric.
Again, ab, b a a = b
R is anti-symmetric.
Again a b, b c a c
R is transitive.
Example 9: Give an example of a relation which is transitive, but neither reflexive nor symmetric.
Solution: LetA={1,2} Let R = {(1, 1), (1, 2)} A x A Clearly R is a relation on A. Here (2, 2)R. R
is not reflexive.
2.5.1 EQUIVALENCERELATION
Example10:Let Z be the set of integers and R = {(x, y): x, yZ and x + y is even} Examine if R is an
equivalence relation on Z.
Solution: Let x Z
x + x is even
R is reflexive.
y + x is even
(y, x)R.
x + y is even, y + z is even
(x + y) + (y + z) is even
(x+ z) + 2y is even
x + z is even (x, z) R
R is transitive
R is an equivalence relation on Z.
Example11:Let A be the set of all straight lines in a plane. Let R={(x,y):x,yAandxy} Examine if
R is reflexive, symmetric and transitive.
(x, x) R
R is symmetric.
Ifxy,yz,thenxz
(x,z)R
(x,y),(y,z)R
R is not transitive.
Example12:Let A be the set of all straight lines in a plane. Let R={(x,y):x,yAandx||y}. Examine if R
is an equivalence relation on A.
(x, x) R, x R
R is transitive
Example13:Let IN be the set of natural numbers. Let a relation R be defined on INxIN by (a,b) R (c,d)
if and only if ad=bc Show that R is an equivalence relation on IN x IN.
Solution: : We have ab = ba
(a, b) R (a, b)
R is reflexive
cb = da
(c, d) R (a, b)
R is symmetric
ad = bc and cf = de
adcf = bcde
af = be
(a, b) R (e, f)
R is transitive.
Example 14: (Congruence modulo n) Let Z be the set of integers, and n be any fixed positive integer.
Let a, bZ a is said to be congruent to b modulo n if and only if a–b is divisible by n. Symbolically, we
write. a b (mod n) Show that the relation ‘congruence modulon’ is an equivalence relation on Z.
a–b is divisible by n.
b–a is divisible by n.
b a (mod n)
a–b+b–c is divisible by n
a–c is divisible by n
a c (mod n)
15 3 (mod 4)
i.e.153(mod7)
Example 15: Let Z be the set of integers. Let R = {(a, b): a, b Z, ab0}
Solution: We have aa 0
(a, a)R,aZ
ab 0
ba 0
(b, a)R
R is symmetric.
We have(–2) x 0 = 0, 0 x2=0
(–2, 2) R
-1
(x, x) R , xA
-1 –1
R is reflexive. Let (x, y)R
-1
This(y, x)R [by defn of R ]
-1
(x, z) R
-1
R is transitive
-1
Thus, R is an equivalence relation.
(y, x) RS
RS is symmetric.
(x, z) RS
RS is transitive.
Remarks: The union of two equivalence relations is not necessarily an equivalence relation.
Now, R = {(1, 1), (2, 2), (3, 3), (1, 3), (3,1)}
RS = {(1, 1), (2, 2), (3, 3), (1, 3), (3, 1), (1, 2), (2, 1)}
Then R is called a partial order or, simply an order relation, and R is said to define a partial ordering of
S. The set S with the partial order is called a partially ordered setor, simply, an ordered set or poset.
We write (S,R)
The most familiar order relation, called the usual order, is the relation ≤ (read “less than or equal”) on
the positive integers N or, more generally, on any subset of the real numbers R.
EXAMPLE :
(a) The relation ⊆ of set inclusion is a partial ordering on any collection of sets since set inclusion has
the three desired properties. That is,
(b) The relation ≤ on the set R of real numbers is reflexive, antisymmetric, and transitive. Thus ≤ is a
partial ordering on R.
(c) The relation “a divides b,” written a | b, is a partial ordering on the set N of positive integers.
However, “a divides b” is not a partial ordering on the set Z of integers since a | b and b | a need not
imply a = b. For
EXAMPLE:
Consider the set Z of integers. Define aRb by b = ar for some positive integer r. Show that R is a partial
order on Z, that is, show that R is: (a) reflexive; (b) antisymmetric; (c) transitive.
(b) Suppose aRb and bRa, say b = ar and a = bs . Then a = (ar )s = ars . There are three possibilities:
(i) rs = 1,
(ii) a = 1, and
Thus R is antisymmetric.
(c) Suppose aRb and bRc say b = ar and c = bs . Then c = (ar )s = ars and, therefore, aRc. Hence R
is transitive.
Accordingly, because given relation satisfy all the three relations ,so R is a partial order on Z
2.6 EQUIVALENCECLASS
R is an equivalence relation on Z.
Let [0] denote the set of integers congruent to 0 modulo 3. Then [0] = {...., –9, –6, –3, 0, 3, 6, 9, ...}
Let [1] denote the set of integers congruent to 1 modulo 3. Then [1] = {..., –8, –5, –2, 1, 4, 7, 10, ...}
Let[2]denotethesetofintegerscongruentto2modulo3.Then [2]={....,–7,–4,–1,2,5,8,11, …}
We see that
Each of [0], [1], [2] is called an equivalence class. [0] is the equivalence class of 0, [1] is the
equivalence class of 1, [2] is the equivalence class of 2.We see that there are 3 distinct equivalence
classes, viz, [0], [1], [2].
[0] [2]
[1]
FIG 2.1
Definition: Let A be a non-empty set and R be a relation on A. For any aA, the equivalence class [a]
of a is defined by [a ] = {xA : xRa}i.e.the equivalence class [a] of a is the collection of all those
elements of A which are related to a under the relation R.
Theorem 3: Let A be a non-empty set and R be an equivalence relation of A. Let a, bA. Then [a] =
[b] if and only if (a, b) R.
a[b] [[a]=[b]]
aRb (a, b) R
xRb [R is transitive]
x[b]
Again,lety[b] yRb
yRa [R is transitive]
y[a]
Let a, bA.
Then [a], [b] are either not disjoint or disjoint. Let [a], [b] be not disjoint,
aRb [R is transitive]
Lety[a]
yRa
y [b]
[a] = [b]
So, if [a], [b] are not disjoint, they are equal. [a], [b] are either equal or disjoint.
In this case f is said to be a function (or a mapping) from the set A to the set B. Symbolically we write
it as f:A B.
Here, each element of A appears as the first component exactly in one of the ordered pairs of f.
f is a function from A to B.
Here, two distinct ordered pairs have the same first component.
Example 18:Let A = {1, 2, 3, 4}, B = {x, y, z, w} Are the following relations from A to B be
functions?
(i) f1 = {(1, x), (1, w), (2, x), (2, z), (4, w)}
Solution: (i) No. Here two distinct ordered pairs (1, x), (1, w) have the same first component.
(ii) Yes. Here, each element of A appears as the first component exactly in one of the ordered pairs of
f2. Thus we see that.
We observe that if A and B are two non- empty sets and if each element of A is associated with a
unique element of B, then the rule by which this association is
made, is called a function from the set A to the set B.The rules are denoted by f,g etc. The sets A, B
may be the same.
A f B
x y = f(x)
FIG 2.2
f:AB.The unique element y of B that is associated with x of A is called the image of x under
f.Symbolically we write it as f = f(x). x is called the pre- image of y.The set of all the images under f is
called the range off.
Example 19: Let IN be the set of natural members, and Z be the set of integer and f : IN Z, f(x) = (–
codomain of f = Z
Now f(1) = (–1)1 = –1, f(2) = (–1)2 = 1, f(3) = (–1)3 = –1 and so on.
range of f = {–1, 1}
Identity Function: Let A be a non-empty set and i:AA,i(x)=x,xA I is called the identity function.
Note: In case of identity function, domain and co domain are the same.
Constant Function: Let A,B be two non-empty sets and f:AB be a function such that f(x) = k, x
A
If there is at least one element in B which is not the image of any element in A, then f is called an “into”
function.
If each element in B is the image of at least one element in A,then f is called an“onto”function (or a
surjective function or a surjective).
If different elements in A have different images in B,then f is called a one-one function(or an injective
function or an injection).
If two (or more) different elements in A have the same image in B,then f is called a many-one function.
We find x in terms of y
Solution:
A has n elements,
Note: The result does not hold good if A is an infinite set. Let IN be the set of natural numbers.
Proof:Let A be a finite set having n elements. Let A ={a1,a2, ……, an}, where ai’s are distinct.
Let u A (codomain).
Let u = f(ai), 1 i n
Note:The result does not hold good if A is an infinite set. Let IN be the set of natural numbers.
If f : A → B is one-to-one and onto, then f is called a one-to-one correspondence between A and B. This
terminology comes from the fact that each element of A will then correspond to a unique element of B
and vice versa.
Example:
Solution: For any input x, the function machine corresponding to f spits out the value y=f(x)=3x+1. We
want to find the function f−1that takes the value y as an input and spits out x as the output. In other
words, y=f(x) gives y as a function of x, and we want to find x=f−1(y) that will give us x as a function
of y.
To calculate x as a function of y, we just take the expression y=3x+1 for y as a function of x and solve
for x.
y=3x+1
y-1= 3x
(y-1)/3=x
Therefore, we found out that x=y/3−1/3 , so we can write the inverse function as
f−1(y)=y/3−1/3.
In the definition of the function f−1, there's nothing special about using the variable y. We could use any
other variable, and write the answer as
f−1(x)=x/3−1/3.
The placeholder variable used in the formula for a function doesn't matter.
Composition of Function
Consider functions f: A → B and g: B → C; that is, where the codomain of f is the domain of g. Then we
may define a new function from A to C, called the composition of f and g and written g◦f , as follows:
That is, we find the image of a under f and then find the image of f (a) under g. we use the functional
notation g◦f for the composition of f and g .
Example:
Let A = {a, b, c},B = {x, y, z},C = {r, s, t}. Let f: A → B and g: B → C be defined by:
f = {(a, y)(b, x), (c, y)} and g = {(x, s), (y, t ), (z, r)}.
Solution:
1. Let A, B be two finite sets, and n(A)=4, n(B)=3. How many relations are there from A to B?
-1
4. Let A = {4, 5, 6}, B = {7, 8, 9} Let R = {(4, 7), (5, 8), (6, 7), (6, 8), (6, 9)}. Write down R .
Determine which of the relations are: (a) reflexive; (b) symmetric; (c) antisymmetric; (d)
transitive.
(b) Find [(2, 5)], that is, the equivalence class of (2, 5).
7. Let A be the set of all triangles in a plane. Let R = {(x, y): x, y A., x is similar to y} Examine if
R is an equivalence relation on A.
8. Let IN be the set of n natural numbers. Let f: IN IN, f(x) = x2+1 Examine if f is (i) one-one,
(ii) onto.
9. Let V = {1, 2, 3, 4}. For the following functions f: V → V and g: V → V , find:(a) f ◦g; (b), g◦f ;
(c) f ◦f :
f = {(1, 3), (2, 1), (3, 4), (4, 3)} and g = {(1, 2), (2, 3), (3, 1), (4, 1)}
10.Decide which of the following functions are: (a) one-to-one; (b) onto; (c) both; (d) neither.
(2) g: Z2 → Z2 where g(n, m) = (m, n); (4) k: Z → Z2 where k(n) = (n, n).
11. Let l be any collection of sets. Is the relation of set inclusion ⊆ a partial order on l ?
2.11 SUMMARY
2. If A,B are two non-empty sets, a subset of AXB in said to be a relation from AtoB.
xy
3. If A,B are two finite sets and n(A)=x, n(B)=y, the number of relations from A to B is 2 .
-1 -1
4. If A is a non-n-empty and R is a relation from A to B, the inverse relation R is defined by R =
{(b, a): (a, b)R}, which is a relation from B to A.
9. If R is a relation on a non-empty set A, then for any aA; the equivalence class [a] of a is the
collection of all those elements of A which are related to a under the relation R.
11. If A and B are two non-empty sets and if each element of A is associated with a unique element of
B, then the rule by which this association is made, is called a function from AtoB.
13. If different elements in domain have different images in codomain, then the function is one-
one(injective).
14. If each element in codomain is the image of at least one element in domain then the function is
onto(surjective).
2.12 KEYWORDS
Relation: A binary relation R from set x to y (written as xRy or R(x,y)) is a subset of the Cartesian
product x×y. If the ordered pair of G is reversed, the relation also changes. Generally, an n-ary relation
R between sets A1…, and An is a subset of the n-ary product A1×⋯×An. The minimum cardinality of a
relation R is Zero and maximum is n2 in this case.
Function: A function or mapping (Defined as f: X→Y) is a relationship from elements of one set X to
elements of another set Y (X and Y are non-empty sets). X is called Domain and Y is called Codomain
of function ‘f’.
Surjective / Onto function: A function f: A→B is surjective (onto) if the image of f equals its range.
Equivalently, for every b∈B, there exists some a∈A such that f(a)=b. This means that for any y in B,
there exists some x in A such that y=f(x).
1. Let A = {1, 2, 3}, B = {3, 4, 5}. How many relations are there from A to B? Write down any four
relations from A to B.
2. Let A = {3, 4, 5}, B = {5, 6, 7} Which of the following relations are functions from A to B? If it
is a function, determine whether it is one-one and whether it is onto?
3. Let Q be the set of rational numbers and f:QQ be a function defined f(x)=4x+5. Examine if f is
bijective
4. Let A be the set of all triangles in a plane. Let R = {(x, y): x, y A and x is congruent to y}
Examine if R is an equivalence relation on A.
5. Let IN be the set of natural numbers. A relation R is defined on INxIN by (a,b), R(c,d) if and
only if a+d=b+c. Show that R is an equivalence relation on IN x IN.
6. Let A = {1, 2, 3} R = {(1, 1), (2, 2), (3, 3), (1, 2), (2, 3)} Show that R is reflexive but neither
symmetric nor transitive.
7. Let C be the set of complex numbers and IR be the set of real numbers. Let f : CIR, f(z) = |z|, z
C. Examine if f is (1) one-one, (ii) onto.
8. Let A, B be two non-empty sets. Let f:AxBB xA, f (a,b)=(b,a);(a,b) AxB Show that f is
bijective.
a b
9. Let f:INxIN, f(a,b)=3 4 ,(a,b) INxIN Examine if f is(i)one-one,(ii)onto.
10. Let f : Z x Z Z, f(a, b) = ab, (a, b) Z x Z Examine if f is (i) injective, (ii)surjective.
11. Let V = {1, 2, 3, 4}. For the following functions f: V → V and g: V → V , find:
f = {(1, 3), (2, 1), (3, 4), (4, 3)} and g = {(1, 2), (2, 3), (3, 1), (4, 1)}
12
1. 2
2. IA = {(1, 1), (2, 2), (3, 3), (4, 4), (5, 5)}
3. {(a, b, a), (a, b, d), (a, c, a), (a, c, d), (a, d, a), (a, d, d), (b, b, a), (b, b, d) (b, c, a), (b, c, d), (b, d,
a), (b, d, d), (c, b, a), (c, b, d), (c, c, a), (c, c, d), (c, d, a), (c, d, d)}
4. R-1 = {(7, 4), (8, 5), (7, 6), (8, 6), (9, 6)}
5. (a) None; (b) (2) and (3); (c) (1) and (4); (d) all except (3).
6. (b) {(1, 4), (2, 5), (3, 6), (4, 7), (5, 8), (6, 9)}.
7. Equivalence relation.
9. (a) {(1, 1), (2, 4), (3, 3), (4, 3)}; (b) {(1, 1), (2, 2), (3, 1), (4, 1)}; (c) {(1, 4), (2, 3), (3, 3), (4, 4)}.
2. Vasistha,A.R.:ModernAlgebra(Abstractalgebra),KrishnaPrakashan Media(p)Ltd.Meerut-
250001(U).
STRUCTURE
3.2 Introduction
3.11 Summary
3.12 Keywords
3.2 INTRODUCTION
7.6.2 Introduction
Therefore it is necessary to know the cases in which these expressions are TRUE or FALSE, that is, to
know the “truth value” of such expressions.
In logic we are interested in true or false of statements, and how the truth/falsehood of a statement can
be determined from other statements. However, instead of dealing with individual specific statements,
we are going to use symbols to represent arbitrary statements so that the results can be used in many
similar but different cases. The formalization also promotes the clarity of thought and eliminates
mistakes. There are various types of logic such as logic of sentences (propositional logic), logic of
objects (predicate logic), logic involving uncertainties, logic dealing with fuzziness, temporal logic etc.
Here we are going to be concerned with propositional logic and predicate logic, which are fundamental
to all types of logic.
Proposition
A proposition (or statement) is a declarative statement which is true or false, but not both.
Sentences considered in propositional logic are not arbitrary sentences but are the ones that are either
true or false, but not both. This kind of sentences are called propositions. If a proposition is true, then
we say it has a truth value is "true"; if a proposition is false, its truth value is "false".
The first four are propositions, the last two are not. Also, (i) and (iii) are true, but (ii) and (iv)
are false.
Compound Propositions
In everyday life we often combine propositions to form more complex propositions or we can say
compound proposition. For example combining "Grass is green", and "The sun is red" we say
something like "Grass is green and the sun is red", "If the sun is red, grass is green", "The sun is red and
the grass is not green" etc. Here "Grass is green", and "The sun is red" are propositions, and form them
using connectives "and", "if... then ..." and "not" a little more complex propositions are formed. These
new propositions can in turn be combined with other propositions to construct more complex
propositions. They then can be combined to form even more complex propositions.
Many propositions are composite, that is, composed of subpropositions and various connectives
discussed subsequently. Such composite propositions are called compound propositions
“Roses are red and violets are blue.” and “John is smart or he studies every night.”
The fundamental property of a compound proposition is that its truth value is completely determined by
the truth values of its sub propositions together with the way in which they are connected to form the
compound propositions.
Simple sentences which are true or false are basic propositions. Larger and more complex sentences are
constructed from basic propositions by combining them with connectives. Thus propositions and
connectives are the basic elements of propositional logic. Though there are many connectives, we are
going to use the following three basic connectives or operators here:
Conjunction, p ∧ q Any two propositions can be combined by the word “and” to form a compound
proposition called the conjunction of the original propositions. Symbolically, p ∧ q read “p and q,”
denotes the conjunction of p and q. Since p ∧ q is a proposition it has a truth value, and this truth value
depends only on the truth values of p and q as follows:
If p and q are true, then p ∧ q is true, otherwise p ∧ q is false. The truth value of p ∧ q may be
defined equivalently by the table in Fig. 3-1(a). Observe that there are four lines corresponding to the
four possible combinations of T and F for the two subpropositions p and q. Note that p ∧ q is true only
when both p and q are true.
Fig. 3-1
EXAMPLE 4.1 Consider the following statements: (i) Ice floats in water and 2 + 2 = 4. (ii) Ice floats in
water and 2 + 2 = 5. Only the first statement is true and the others is false since at least one of its
substatement is false.
Disjunction (or) ( ∨ ):
Any two propositions can be combined by the word “or” to form a compound proposition called the
disjunction of the original propositions. Symbolically, p ∨ q read “p or q,” denotes the disjunction of p
and q. The truth value of p ∨ q depends only on the truth values of p and q as follows.
If p and q are false, then p ∨ q is false; otherwise p ∨ q is true. The truth value of p ∨ q may be defined
equivalently by the table in Fig. 3-1(b). Observe that p ∨ q is false only in the fourth case when both p
and q are false.
Both the statement are true because at least one of its sub-statements is true.
Negation,(NOT), ¬p
Given any proposition p, another proposition, called the negation of p, can be formed by writing
“It is not true that ...” or “It is false that ...” before p or, if possible, by inserting in p the word “not.”
Symbolically, the negation of p, read “not p,” is denoted by
¬p
The truth value of ¬p may be defined equivalently by the table in Fig. 3-1(c). Thus the truth value
of the negation of p is always the opposite of the truth value of p.
(1) sun rises in the east. (2) It is false that sun rises in the east. (3) sun does not rises in the east
Truth Tables
An expression constructed from logical variables ( p, q,...,) will be called a proposition. The main
property of a proposition P (p, q, . . .) is that its truth value depends exclusively upon the truth values of
its variables, that is, the truth value of a proposition is known once the truth value of each of its
variables is known. A simple concise way to show this relationship is through a truth table. We describe
a way to obtain such a truth table below.
Consider, for example, the proposition ¬(p ∧ ¬q). Figure 3-2(a) indicates how the truth table of ¬(p ∧
¬q) is constructed. Observe that the first columns of the table are for the variables p, q,... and that there
are enough rows in the table, to allow for all possible combinations of T and F for these variables. (For
2 variables, as above, 4 rows are necessary; for 3 variables, 8 rows are necessary; and, in general, for n
variables, 2n rows are required.) There is then a column for each “elementary” stage of the construction
of the proposition, the truth value at each step being determined from the previous stages by the
definitions of the connectives ∧, ∨, ¬. Finally we obtain the truth value of the proposition, which
appears in the last column.
The actual truth table of the proposition ¬(p∧¬q)is shown in Fig. 3-2(b). It consists precisely of the
columns in Fig. 4-2(a) which appear under the variables and under the proposition; the other columns
were merely used in the construction of the truth table.
Fig: 3-2
A T AU T O L OG Y is a formula which is "always true" --- that is, it is true for every assignment of truth
values to its simple components.
Some propositions P (p, q, . . .) contain only T in the last column of their truth tables or, in other words,
they are true for any truth values of their variables. Such propositions are called tautologies.
For example:
Proposition [ p ∨ ¬(p ∧ q)] is tautology. As if we construct the truth table of p ∨ ¬(p ∧ q) as shown in
Fig.
Since the truth value of p ∨ ¬(p ∧ q) is T for all values of p and q, the proposition is a tautology.
Analogously, a proposition P (p, q, . . .) is called a contradiction if it contains only F in the last column
of its truth table or, in other words, if it is false for any truth values of its variables. For example,
the proposition “p and not p,” that is, p ∧ ¬p, is a contradiction. This is verified by looking at their truth
tables in following Fig.
Logical Equivalence
Two propositions P (p, q, . . .) and Q(p, q, . . .) are said to be logically equivalent, or simply equivalent
or equal, denoted by
P (p, q, . . .) ≡ Q(p, q, . . .)
If they have identical truth tables. Consider, for example, the truth tables of ¬(p ∧ q) and ¬p ∨ ¬q
appearing in Fig. Observe that both truth tables are the same, that is, both propositions are false in the
first case and true in the other three cases. Accordingly, we can write
¬(p ∧ q) ≡ ¬p ∨ ¬q
Note:
logical equivalence can also apply for compound statements, for example:
Then S can be written in the form ¬(p ∧ q). However, as noted above, ¬(p ∧ q) ≡ ¬p ∨ ¬q. Accordingly,
S has the same meaning as the statement:
ALGEBRA OF PROPOSITIONS
Propositions satisfy various laws which are listed in Table 4-1. (In this table, T and F are restricted to
the truth values “True” and “False,” respectively.) We state this result formally.
Conditional Statement
Let p and q are two statements and these two statements are of the form “If p then q.” Then Such
statements are called conditional statements and are denoted by
p→q
The implication p→ q is false only when p is true, and q is false; otherwise, it is always true. In this
implication, p is called the hypothesis (or antecedent) and q is called the conclusion (or consequent).
1. If a = b and b = c, then a = c.
Bi Conditional Statement
If p and q are two statements then "p if and only if q" is a compound statement, denoted as p ↔ q and
referred as a biconditional statement or an equivalence. The equivalence p ↔ q is true only when both p
and q are true or when both p and q are false.
p↔q
For Example: (i) Two lines are parallel if and only if they have the same slope.
(ii) You will pass the exam if and only if you will work hard.
The truth values of p ↔ q are defined by the tables in below Fig. Observe that:
The biconditional p ↔ q is true whenever p and q have the same truth values and false otherwise.
Note :The truth table of ¬p ∧ q appears in following Fig. Note that the truth table of ¬p ∨ q and p → q
are identical, that is, they are both false only in the second case. Accordingly, p → q is logically
equivalent to ¬p ∨ q; that is,
p → q ≡ ¬p ∨ q
Q1. Let p be “It is cold” and let q be “It is raining”. Give a simple verbal sentence which describes each
In each case, translate , , and to read “and,” “or,” and “It is false that” or “not,” respectively, and
then simplify the English sentence.
Q3 Show that the propositions ¬(p q) and ¬p ¬q are logically equivalent.
Q5. Which of the following propositions are tautologies? Which are contradictions? Why?
Q6.Use the laws in Table 4-1 to show that ¬(p q) (¬p q) ≡ ¬p.
3.11 Summary
1. A proposition (or statement) is a declarative statement which is true or false, but not both.
2. Many propositions are composite, that is, composed of subpropositions and various connectives
discussed subsequently. Such composite propositions are called compound propositions
3. Though their are three basic connectives or operators known as AND, OR, not
4. Property of proposition is that its truth value depends upon the truth value of its variables.
5. If propositions have true for any truth value of their variables, such propositions are called
tautaology.
6. If propositions have false for any truth value of their variables, such propositions are called
contradiction.
7. Two propositions are said to be logically equivalent if they have identical truth tables.
8. The conditional statement are denoted by p → q and is frequently read “p implies q”.
Propositions
Tautology
Contradiction
Conditional statements
Biconditional statements
Logical equivalence
Ans.3 As shown in figure both tables have same output so they are logically equivalent
Ans.4 Recall that “If p then q” is equivalent to “Not p or q;” that is, p → q ≡ ¬p ∨ q. Hence,
(b)Answer: contradiction
Example reasoning: All rows in the truth table evaluate to false.
(1) ¬(p q) (¬p q) ≡ (¬p ¬q) (¬p q) DeMorgan’s law
(a) If the teacher is absent, then some students do not complete their homework.
(b) All the students completed their homework and the teacher is present.
(c) Some of the students did not complete their homework or the teacher is absent
Q3. Find the truth tables for. (a) p ∨ ¬q; (b) ¬p ∧ ¬q.
2. Discrete Structures, Logic, and Computability, 2nd edition, by J.L. Hein, published by Jones
and Bartlett, 2002.
3. Discrete Mathematics for Computer Scientists, by J. Truss, published by Addison Wesley, 1999.
4. Discrete Mathematics, 5th edition, by K.A. Ross and C.R.B. Wright, published by Prentice Hall,
2003.
GROUP THEORY
STRUCTURE
4.2 Introduction
4.3 Group
4.4 Semi-group
4.5 Monoid
4.7 Subgroups
4.8 Coset
4.13 Summary
4.14 Keywords
4.1 LEARNINGOBJECTIVES
2. Description of subgroups
3. Definitions of cosets
4.2 INTRODUCTION
In this unit we will introduce the notion of groups. Group is an algebraic structure, i.e, a non- empty set
equipped with a binary operation satisfying certain postulates. Group theory occupies an important
position in the study of abstract algebra.
4.3 GROUP
A non-empty set G, equipped with a binary operation *, is called a group if the following postulates are
satisfied.
∀ a,b ∈G : ∀ a*b ∈ G
It means that for a,b belongs to G such that a*b also belongs to G
(ii) Associativity
For every aG, there exists bG such that a *b = e = b *a. so b is called inverse of a.
Note: 1. In order to be a group, there must be a non-empty set equipped with a binary operation
satisfying the postulates mentioned above.
2. We will drop the binary operation symbol and simply write ab. It should be keep in mind that this
is not our usual multiplication.
Semi Group
A non-empty set G equipped with a binary operation is called a semigroup, if the binary operation is
associative.
For example : Consider the positive integer N. then (N,+) are semi group, since addition in N are
associative.
4.5 Monoid
Monoid
A non-empty set G equipped with a binary operation is called a monoid , if the binary operation is
associative as well as operation also has an identity element.
For example: Consider the positive integer N. then (N,×) are monoid , since multiplication in N are
associative and it has identity element as 1.
Abelian group
A group G is said to be abelian if the commutative law holds, i.e., if a*b=b*a for every a,b ∈ G.
a*b=b*a
For example: The set Z of integers is an abelian group under addition. The identity element is 0 and –a
is additive inverse of a in Z. and addition is associative and commutative both.
Order of a group
The number of elements of a finite group G is called the order of G. Symbolically it is denoted by 0(G)
or |G|.
Example 1: Let G = {1} Clearly multiplication is a binary operation on G. Moreover, all the postulates
for a group are satisfied.
* -1 1
-1 1 -1
1 -1 1
Fig. 3.1
(iv) Every element G possesses inverse in G. 1 is the inverse of1, –1 is the inverse of –1. G is a group
under multiplication.
a+bZ, a, b Z
0 is the identity.
(iv) Forever yaZ, there exists –aZ such that a+(–a)= 0= (–a)+a.
Q0, the set of non-zero rational numbers is an Abelian group under multiplication.
IR0, the set of non-zero real numbers is an Abelian group under multiplication.
C0, the set of non-zero complex numbers is an Abelian group under multiplication.
a0 = a + 0 – a0 = a
0 a = 0 + a –0a = a
𝑎 𝑎
𝑎∗ =0= ∗𝑎
𝑎−1 𝑎−1
𝑎
𝑎−1is the inverse of a under x.
G is an Abelian group.
e=f
= ec[∵e is theidentity]
=c
Note: In view of the above theorem, we write ‘the inverse of a’, not ‘an inverse of a’.
–1 –1
(iii) We have aa = e =a a
–1 –1 –1 –1
a is the inverse of a, and vice versa, a is the inverse of a i.e. (a ) = a
–1 –1 –1 –1
(iv) Let e be the identity of G and a,bG Now (ab)(b a ) =a(bb )a
–1
=aea
–1
= aa
–1 –1 –1 –1
= e (b a )(ab) = b (a a)b
–1
= b eb
–1
=b b
=e
–1 –1 –1
b–1a–1is the inverse of ab, i.e. (ab) = b a
a–1(ab) = a–1(ac)
eb = ec
Again ba = ca
–1 –1
(ba)a = (ca) a
–1 –1
b(aa ) = c(aa ) [by associativity]
be = ce
Example5:If, in a group G, every element is its own inverse, prove that G is Abelian.
4.7 SUBGROUP
Let us consider the set Z of integers. We know that Z is a group under addition.
Clearly 2Z is a non-empty subset of Z. Moreover, 2Z is also a group under addition. In this case, 2Z is
said to be a subgroup of Z.
Definition: A non-empty subset H of a group G is a subgroup of G if H is also a group under the same
binary operation of G. Symbolically, we write H G.
Note: (1) If e is the identity of G, {e} is also a subgroup of G, called the trivial subgroup of G. All other
subgroups are nontrivial.
(2)G itself is a subgroup of G, called the improper subgroup of G. All other subgroups are proper.
We have H G.
H ≤ G.
The set of real numbers IR is a group under addition. The set IR+of positive real numbers is a group
under multiplication. IR+ is a subset of IR, but not a subgroup of IR. Binary operations are different.
(ii) The inverse of any element of H is the same as the inverse of the element of G.
Let a H.
af =ae
Let a H.
ab = e =ba
ac = e =ca
Note: If H,K are two subgroups of a group G and e is the identity of G, then e is also the identity of H as
well as of K. So, H and K have at least one common element, viz., the identity element. Thus, we can
conclude that there cannot be two disjoint subgroups of a group.
–1
Theorem : A non-empty subset H of a group G is a subgroup of G if and only if a, b H ab H.
–1
Now aH, b H
–1 –1 –1 –1
a(b ) H (Since (b ) H)
ab H
H ≤ G.
Note: If G is an additive group, i.e., if G is a group under addition, then a non-empty subset H of G is a
subgroup of G if and only if a,bHa–bH.
Theorem : The intersection of two subgroups of a group is again a subgroup of the group.
Let H ≤ G, K ≤ G.
–1
ab H a, b K and KG.
–1 –1 –1 –1
ab K ab H and ab K ab HK
HK G
∵KG, H KG
HKandKH
there exists a H such that a K Also, there exists b K such that b H
Now aH a H K
bK b H K H KG,
ab H K
This ab H or ab K
–1
IfabH,thenaH,ab H a (ab) H
–1
(a a)b H
ebH
bH,
which is a contradiction.
–1
Similarly, if ab K, then abK, bK (ab)b K
–1
a(bb )K
aeK
a K
which is acontradiction.
4.8 COSET
Let aG
Note:(1) Right (or left) Coset cannot be empty we haveeH ea = a Ha Ha
(3) If H is a subgroup of the additive group G and aG, the right Coset of H in G is given by
H+a={h+a:hH}
Example: Let us consider the additive group of integers Z. We know that 2 Z = {0, 2, 4,6, …} Z
We have
2Z has two distinct left cosets viz. 2Z and 1+2Z suchthat 2Z (1+2Z) =Z
2Z(1+2Z)=
Similarly,2Z has two distinct right cosets 2Z and 2Z+1 such that 2Z (2Z+1) =Z
2Z(2Z+1)=
(i) aH = H a H; Ha = H a H
–1
(ii) aH = bHa–1bH ; Ha = Hbab H, where a, bG
a H
aHH ...(1)
–1 –1
Again, let y H aH, a H a yH
–1
a y = h1, for some h1H
–1
a(a y) =ah1
–1
(aa )y =ah1
ey = ah1
y = ah1aH
Thus, y H y aH
HaH ...(2)
(ii) aH = bH
–1 –1
a (aH) =a (bH)
–1 –1
(a a)H =(a b)H
–1
eH = (a b)H
–1
H = (a b)H
–1 –1
a b H (using (1) Similarly, Ha = Hbab H.
Theorem : Any two left (or right) cosets of a subgroup are either disjoint or identical.
Then aH, bH are two left cosets of H in G. Clearly aH, bH are either disjoint or not disjoint. Let aH, bH
be not disjoint, i.e, aHbH.
Let x aHbH
–1 –1
(ah1)h1 = (bh2)h1
–1 –1
a h1h1 = b h2h1
–1
ae = bh2h1 , where e is the identity of G
–1 –1
a = bh2h1 Similarly b = ah1h2
–1
= bh2h1 h3
–1
bH, h2h1 h3H
q = ah1h2–1h4
aH, h1h2–1h4H
Theorem: The order of a subgroup of a finite group divides the order of the group.
Let H = {h1, h2, h3,... hm}, where the hi’s are distinct. Let a G, a H.
Let us consider the left Coset. aH = {ah1, ah2, ah3, ..., ahm}
We claim that all the elements in aH are distinct, for if ahi= ahj, 1im, 1
j m, i j then hi=hj , (by left cancellation law), which is a contradiction. Again, no element of H is
–1 –1 –1
then hihj i.e. hihj = a i.e. a = hihj H
Thus, we have listed m+m = 2m elements of G. If this exhausts all the elements of G, then 2m=n.m
dividesn.
Clearly, all the elements in bH are distinct.No element of H is equal to any element of bH.
–1
(hihj H) i.e. b aH, which is acontradiction.
Thus, we have listed m+m+m = 3m elements of G. If this exhausts all the elements of G, then 3m=n.
m divides n.
If not, we proceed as above. Since G is finite, we must stop somewhere, say, after k times.
mk = n m divides n.
4.10 NORMALSUBGROUP
Definition: A subgroup H of a group G is said to be a normal subgroup of G if aH=Ha, for all aG,
i.e., if its left and right cosets coincide. Symbolically we write HG.
Note: A group G has at least two normal subgroups, viz., G and {e}. A group, having no normal
subgroups other than G and {e},is called a simple group.
We know that G is a group under multiplication. Let H = {–1, 1}, and HG
Now 1H = {–1, 1} = H1
iH = {–i, i} = Hi
Note:In the above example, H has two distinct left (or right) cosets, viz H, iH. We note that iH is not a
subgroup of G.
Let a G
= HaHG.
Theorem :The intersection of any two normal subgroup of a group is again a normal subgroup of the
group.
–1
Again gG, hK and K G ghg K
–1 –1 –1
Thus, ghg H and ghg K. ghg H K
H K G.
4.11 CYCLICGROUPS
Definition: A group G is said to be cyclic if there exist an element a in G such that every element of G
Note: If the group G is additive, every element of G is expressed in the form na.
Examples
1 2
1. We know that G={–1,1}is a group under multiplication. We have (–1) =–1, (–1) =1
Let x, y G.
=am+n
=an+m
= an am
= yx therefore G is Abelian.
–1
Theorem :If a is a generator of a cyclic group G, a is also a generator of G.
𝑎
1. Is * defined by a * b = 𝑏 binary operation on IR?
3. Is the multiplicative group IR+ of positive real numbers a subgroup pf the additive group IR of
real numbers? Justify your answer.
7. Let G = {1, ,2 } be the multiplicative group; being a complex cube root of unity. Is the group
simple?
4.13 SUMMARY
m2
2. If S is a finite set having m elements, the number of binary operations on S is m .
6. An element e in a non-empty set S equipped with a binary operation is called an identity
7. An element b in a non-empty set S equipped with a binary operation is called an inverse
element of a S if a b = e = b a.
8. A group is an algebraic structure i.e., a non-empty set equipped with a binary operation satisfying
certain postulates.
9. The order of a group G is the number of elements in G and the order of an element in a group is
the least positive integer n such that an is the identity element of that group G.
10. A non-empty subset H of a group G is a subgroup of G if H is also a group under the same binary
operation of G.
11. If H is a subgroup of a group G, the set Ha = {ha: h H}, aG, is called a right coset of H in G.
Similarly,a left coset is defined.
12. A group G is said to be cyclic if there exists an element a in G such that every element of G can
4.14KEYWORDS
Semigroup: A finite or infinite set ‘S′ with a binary operation ‘*’ (Composition) is called semigroup if
it holds following two conditions simultaneously −
Closure − For every pair (a, b) ∈S, (a*b) has to be present in the set S.
Monoid: A monoid is a semigroup with an identity element. The identity element (denoted by e or E) of
a set S is an element such that (a*e) = a, for every element a∈S. An identity element is also called a unit
element. So, a monoid holds three properties simultaneously − Closure, Associative, Identity element.
Group: A group is a monoid with an inverse element. The inverse element (denoted by I) of a set S is
an element such that (a*I) =(I*a) =a, for each element a∈S. So, a group holds four properties
simultaneously - Closure, Associative, Identity element, Inverse element.
Abelian group: An abelian group G is a group for which the element pair (a,b)∈G always holds
commutative law. So, a group holds five properties simultaneously - Closure, Associative, Identity
element, Inverse element, Commutative.
Cyclic group: A group that can be generated by a single element. Every element of a cyclic group is a
power of some specific element which is called a generator. A cyclic group can be generated by a
generator ‘g’, such that every other element of the group can be written as a power of the generator ‘g’.
Subgroup: A subgroup H is a subset of a group G (denoted by H≤G) if it satisfies the four properties
simultaneously − Closure, Associative, Identity element, and Inverse.
1. No.
2. Yes
4. No. Two subgroups of a group have at least one common element, viz., the identity element.
5. No.
1. Let IR be the set of real numbers. Examine if the binary operation defined by ab=a+5b;
3. Let G be the set of odd integers. A binary operation on G is defined as follows a b = a+b–1; a,
–1 –1 –1
4. Prove that a group G is Abelian if and only if (ab) =a b ,for all a,bG.
–1
5. Let G be an Abelian group.Prove that the set H={xG:x=x }is a sub group of G.
8. Let G be a group and H be a subgroup of G. Let a,bG. Show that the two right cosets Ha,Hb are
–1 –1
equal if and only if the two left cosets a H, b H are equal.
2. Vasistha,A.R.:ModernAlgebra(Abstractalgebra),KrishnaPrakashanMedia(p)Ltd.Meerut-
250001(U.P).
3. Vinberg,E.B.:AcourseinAlgebra(FirstIndianedition,2009),American MathematicalSociety).
4. Vatsa,B.S.andVatsa,Suchi:ModernAlgebra,NewAgeInternational
GRAPH THEORY
REVISED /UPDATED SLM BY RENU BANSAL
STRUCTURE
5.1 Learning Objective
5.2 Introduction
5.3 Graph
5.3.1 Directed graph
5.3.2 Undirected graph
5.3.3 Multi graph
5.4 Paths and circuits
5.5 Some definitions
5.6 Connected and disconnected graphs.
5.7 Matrix representation of graphs
5.7.1 Incidence Matrix
5.7.2 Adjacency Matrix
5.7.3 Adjacency Matrix of a Digraph
5.8 Some Special Graph
5.8.1 Regular Graph
5.8.2 Bipartite Graph
5.8.3 Connected Graph
5.8.4 Euler Graph
5.8.5 Hamiltonion Graph
5.9 Sub graphs
5.9.1 Isomorphic graphs
5.9.2 Homeomorphic graphs
5.1 LEARNINGOBJECTIVES
2. Types of graph
3. Representation of graph
4. Graph traversal algorithms
5.2 INTRODUCTION
In this chapter we have defined graph which is pictorial representation of relations on sets. We have
defined directed graph, undirected graphs, paths, circuits and matrix associated with graphs.
5.3 GRAPH
A pair of set {V, E}, V, constitute a graph. Elements of set V are called vertices while elements of set
E are called edges or lines or curves. Generally, lines and points of plane represent the edges and
vertices of the graph.
2. Each edge is represented by a pair of vertices say u and v, these vertices are called end points of
edges we will denote it by E(u, v).
If we put u and v as an ordered pair, then edge is called directed from u to v and such a graph in which
each edge is directed is called directed graph. For example, figures given below is directed graph.
If a graph is not directed is called undirected graph in such graph edges are given as E(u, v). Graphs given
in Figure 5.2are undirected graphs.
Consider the diagram, The edges e4 and e5 are called multiple edges since they connect the
same endpoints, and the edge e6 is called a loop since its endpoints are the same vertex. Such a
diagram is called a multigraph.
Note: (1) Edge E (u, u) is called a self-loop. A graph with no self loop and no parallel edge is called a
simple graph otherwise it is called non-simple or multi graph. For example, graph of a relation which is
neither reflexive nor symmetric is simple and that of reflexive relation is not simple. Figure (a) and (b)
are graph which are non-simple and simple respectively.
F IG ( A ) F IG ( B )
(2) Edges e1 and e2 are parallel edges if they have same vertices. Here e1 and e2 are parallel edges.
e1
a b
e2
F IG 5.3 P ARALLEL E DGES
we move from a1 to a6 along these edges without using an edge more than once.
WALK: -Let G be a graph. Then a sequence of vertices v0, v1, v2, ……. vt each adjacent to the next and
there is always an edge between vi, and vi+1, is called a walk. The vertex v0 is called the initial vertex
and the vertex vt is called terminate vertex of the path. Number of edges in a walk I s called its length.
A walk is called open walk if it has different beginning and end points and is called closed walk if it’s
beginning and end points are same.
Definition: A Trail is a walk having all distinct edges. A Path is a walk in which all vertices are
distinct. A closed trail is called a Circuit. A circuit in which vertices (except the first and last) do not
repeat is called a Cycle.
Note: A path is always a trail but a trail need not be a path. Similarly, a cycle is always a circuit but a
circuit is not a cycle always.
In figure given below for the graph aba, one is circuit while other is not a circuit.
F IG 5.7
Degree of a vertex: In a non-directed graph G, the degree of a vertex v is determined by counting each
loop on v twice and each other edge once. It is denoted by d (v).
Example: d (V1) = 1, d (V2) = 2, d (V3) = 3 are the degrees of V1, V2 and V3 in following figure.
F IG 5.8
Theorem: The sum of d(vi) for each vi of a undirected graph G (V, E) is twice the number of edges in G
Proof: Since G is undirected graph, each edge of G is incident with two vertices, therefore, contributes
2 to the sum of degree of all the vertices of the undirected graph. Therefore, the sum of degrees of all
the vertices in G is twice the number of edges in G.
Example: Draw a simple graph with three vertices i.e. draw a graph with no self-loop and no parallel
edges.
F IG 5.9
F IG 5.10
There are five edges in this graph in which edge e4 and e5 has same vertices (c, d). Therefore, these
edges are parallel edges. Further sum of degrees of the vertices is 2+2+3+3=10 = 2.5= 2 times the
number of edges.
Definitions
1. Isolated vertex: A vertex on which no edge incident is called isolated vertex, i.e. a vertex v such that
d (v) = 0.
2. Null graph: A graph G = (V, E) such V and E = is called null graph, therefore null graph in which
every vertex is isolated.
Theorem 1: In a non-directed graph, the number of vertices of odd degree is always even.
Proof: Let the number of vertices in a graph G be n. Let’s suppose that the degree of first k vertices
say v0, v1, v2, …. vk be even and remaining n-k vertices be odd i.e. the vertices with odd degree.
n k n
Now dv dv dv
i 1
i
i 1
i
i k 1
i
But we know by Theorem (3.4.2) that L.H.S. of (1) is even. As d(vi) in first term of R.H.S. is even,
k n
therefore, dv i is also even. It gives us that
i 1
dv
i k 1
i must be even. But each d (vi) in that
dv is odd. Moreover, we know that sum of odd number is even if they are taken even number
i k 1
i
of times. So here n-k must be even. i.e. odd number vertices in the graph must be even. Hence the
proof is over.
Definition: If in a graph we can move from any vertex to the any other vertex of the graph then such
graphs are called connected graphs otherwise it is called disconnected graph. Simple we can say that if
there exists a path between every pair of vertices the graph is called connected.
For example, Graph in Fig. 5.13 is connected graph while in Fig. 5.14 it is disconnected.
F IG 5.11 F IG 5.12
Definition:
1. Let G be a connected graph. The edge connectivity of G is the minimum number of lines (Edges)
whose removal results in a disconnected or trivial graph. It is generally denoted by (G).
2. Vertex connectivity of a graph G is the minimum number of vertices whose removal results in a
disconnected or trivial graph is called the vertex connectivity of G. It is generally denoted by k(G).
Theorem. The edge connectivity of a connected graph G cannot exceed the minimum degree of G, i.e.
(G) (G).
Proof: Let G be a connected graph and v be a vertex of minimum degree in G. Then the removal of
edges incident with the vertex v disconnects the vertex v from the graph G. Thus the set of all edges
incident with the vertex v forms a cut set of G. But from the definition, edge connectivity is the edge
connectivity of G cannot exceed the minimum degree of v, i.e. (G) (G).
Theorem: The vertex connectivity of a graph G is always less than or equal to the edge connectivity of
G, i.e., k (G) (G).
Proof: If graph G is disconnected or trivial the k (G) = (G) = 0. If G is connected and has a bridge e,
then = 1. In this case K = 1, since either G has a cut point incident with e or G is K 2.( k (G) (G)
when (G) = 0 or 1). Finally let us suppose that (G) 2. The G has lines whose removal disconnects
G. Clearly the -1 of these edges produces a graph with a bridge e = {u, v}. For each of these -1 edges
select an incident point which is different from u or v. The removal of these points (vertices) also
removes -1 edges and if the resulting graph is disconnected then k -1 <. If not the edge e = {u, v}
is a bridge and hence the removal of u and v will result in either a disconnected or a trivial graph.
Hence k in each case and this completes the proof of the theorem.
Thus, the vertex connectivity of a graph does not exceed the edge connectivity and edge connectivity
of a graph cannot exceed the minimum degree of G. Hence the theorem given below.
Theorem: A graph is disconnected if V can be written as union of two non-empty, disjoint subsets V1
and V2 such that there exist no element of E whose one vertex in V1 and other in V2.
Proof: Let us suppose that G be a connected graph. Take any vertex v in G. Let V1 be the collection of
all these vertices, which are joined by paths to v. Since G is not connected V V1 [if V= V1 then G will be
connected]. So take v2 a set having all vertices of G which are not in all vertices of V which are not in
V1. Therefore, V1 and V2 are required subsets of V.
Conversely, suppose that V = V1V2, v1, v2 V1V2 = , then if we take v1V1 and v2V2
then there exist no edge between v1 and v2 i.e. graph is disconnected.
Component of a graph means maximal connected subgraph of graph G (V, E). For example, in Fig.
5.15.
F IG 5.13
{v1,v2,v3}, {v4,v5}, {v6,v7,v8,v9}, are components. Further it is clear that a graph is connected if and only
if it has exactly one component.
Theorem: A simple graph with m vertices and r components can have at most (m-r) (m – r + 1)/2 edges.
Proof: Let G (V, E) be a graph with m vertices and r components let m 0, m1, … mr be the number of
vertices in each components of G (V, E). Then we have
(2)
mi 1 m r
r
i 1
2
r
m i 1 m 2 r 2 2mr
i 1
2
r
1 2m i 1m j 1 m 2 r 2 2mr
r
But m i 1 m
2
i
i 1 i 1
r
(mi 2mi ) r m 2 r 2 2mr (mi 1) 0 and (m j 1) 0 )
i 1
r r
mi 2 mi m r 2mr r
2 2 2
i 1 i 1
r
m i m r 2mr r 2m
2 2 2
i 1
We also know that in a simple graph with mi vertices have at most mi (mi -1)/2. Thus the
maximum number of edges in G is
1 r 1 2
r r
m i m i 1 2 i m i 2 m r 12m r m
1
i 1 2 i 1
m 2
i 1
1
m r m r 1
2
Definition: Two vertices u and v in a digraph are said to be mutually reachable if G contains both
directed u-v walk and a directed v-u walk. A digraph is said to be strongly connected if every two of its
vertices are mutually reachable.
Since we know that it is very easy to manipulate matrices. We take the matrix associated with
different graphs. There are two ways of representing graph- (1) incidence matrix; (2) Adjacency matrix.
Let v1, v2, …. vn be n vertices and e1, e2, …, em be m edges of graph G. Then an n × m matrix I = [aij]
whose n rows correspond to n vertices and m columns corresponds to m edges where aijis as
e1 e2 e3 e4
v 1 1 0 0 0
v 2 1 1 0 1
v 3 0 1 1 0
v 4 0 0 1 1
1. Number of one’s in each column is exactly two since each edge incident exactly on two vertices.
2. With given incidence matrix there always exists a graph.
3. Sum of entries of any row of matrix gives us the degree of corresponding vertex.
4. A row with all zeroes represents an isolated vertex.
Let us consider a graph with n vertices say v1, v2, …, vn. Then a square matrix X [ x ij ] of order n,
where
v1 v 2 v 3 v 4
v 1 0 1 0 1
v 2 1 0 1 0
v 3 0 1 1 1
v 4 1 0 1 1
(2) If G has no self-loops then diagonal entries of adjacency matrix are zero. If ithdiagonal entry is 1,
then it indicates that there is a self-loop at ith vertex vi.
(i.e. a directed graph) is defined as A (G) = [xij] nxn where G is a graph with n vertices and no parallel
edges and
By definition it is clear that the sum of elements of ith row of adjacency matrix is equal to the outgoing
degree of vertex vi i.e. the number of edges going out of vertex vi.
v1 v2 v3 v4
v1 0 1 1 1
v 2 0 0 1 0
v 3 0 0 0 1
v 4 0 0 0 0
A graph in which every vertex has the same degree is called a regular graph. If every vertex has degree
K, then the graph is called a k-regular or regular graph of degree K.
Note:
1. A graph is called a null graph is every vertex in the graph is an isolated vertex i.e every null graph is
3. If a graph has n vertices and is regular of degree k, then it has k n/2 edges.
A simple graph is called bipartite if its vertex set V can be Partitioned into two disjoint sets
v1andv2such that every edge in the graph connects a vertex in v1 and a vertex in v2. In other words, a
graph G is called bipartite graph when V=v1U v2 and v1v2=and every edge of G is of the form (vi, vj)
A complete bipartite graph is a bipartite graph in which every vertex of v1 is adjacent to every vertex of
v2. If number of vertices in v1 are m and number of vertices in v2 are n, then the complete bipartite graph
is denoted by Km,n. A complete bipartite graph km,n has m+n vertices and mn edges. The complete
bipartite graph k3.3 and k3,4 are displayed in fig.6.20
A graph is said to be connected if we can reach any vertex from any other vertex by traveling along the
edges. More formally, A graph is said to be connected if there exists at least one path between every
pair of its vertices, otherwise, the graph is disconnected. That is a graph G is connected if give any
vertices u and v, it is possible to travel from u to v along a sequence of adjacent edges fig.6.21 is
connected graph but in fig.6.22 is a disconnected graph.
A disconnected graph consists of two or more connected graphs. Each of these connected subgroups is
called a component. Figure 5.22 is a disconnected graph with two components.
An undirected graph with no isolated vertices is said to have an Euler circuit if there is a circuit in G
that traverses every edge of the graph exactly once. If there is an open trail from vertex u to v in G and
this trail traverses each edge in G exactly once, the trail is called Euler trail. [A trail from a vertex u to
v is a path that does not involve a repeated edge] An Eulerian tour is a closed walk that starts at some
vertex, passes through each edge exactly once and returns to the starting vertex.
Since any closed walk in an undirected graph enters and leaves any vertex the same number of times,
the subgraph composed of the edges in any closed walk is even.Thus, if the graph contains a closed
walk passing through each edge exactly once, the graph must be even, conversely,if the graph is even,
then it contains an Euler tour,A path that passes through each edge exactly once but vertices may be
repeated is called Euler path.
A graph that contains an Euler tour or Euler circuit is called an Eulerian graph.
Note:1.If a graph G has a vertex of odd degree,then there can be no Euler circuit in G.
2. If a graph G is connected and each vertex has even degree, then there is an Eulercircuit.
Forexample, the graph in figure5.23 is an Eulerian graph because all the vertices are of even degree,
so it has an Euler circuitv1v2v3v5v4v3v1. But the graph G in figure 5.24 is not an Euler
graph because all the vertices of G are not even degrees, so there does not have any Euler circuit.
Let G be a connected graph with more than two vertices. If there is a path in G that uses each vertex of
the graph exactly once, then such a path is called Hamiltonian path. If the path is a circuit that contains
each vertex in G exactly once, except the initial vertex, then such a path is called a Hamiltonian circuit.
A graph that contains a Hamiltonian circuit is called a Hamiltoniangraph.
ii) Eulerian circuit uses every edge exactly once but many repeat vertices, while Hamiltonian circuit
uses each vertex exactly once except for the first and last vertex.
For example, the graph in figure 5.25 is Hamiltonian because there is a Hamiltonian circuit shown by
the arrow symbols
F IG 5.24
F IG 5.25
Consider a graph G = G (V,E). A graph H = H(V’,E’) is called a subgraph of G if the vertices and edges of
H are contained in the vertices and edges of G, that is, if V’ ⊆V and E’ ⊆E. In particular:
(i) A subgraph H(V’,E’) of G(V,E) is called the subgraph induced by its vertices V’ if its edge set
E’contains all edges in G whose endpoints belong to vertices in H.
(ii) If v is a vertex in G, then G − v is the subgraph of G obtained by deleting v from G and deleting all
edges in G which contain v.
(iii) If e is an edge in G, then G − e is the subgraph of G obtained by simply deleting the edge e from G.
Two graphs are said to be isomorphic it they have identical behavior in terms of graph-theoretic
properties. More precisely:
Let G1(V1, E1) and G2(V2, E2) be two simple undirected graphs. A function f: V1V2is called a graph
isomorphism if
1. F is one-one and onto, i.e, there exists a one-to-one correspondence between their vertices as
well as edges (both the graphs have equal number of vertices and edges, however, vertices may
have different levels.)
If such a function exists, then the graphs G1and G2 are called isomorphic graphs. For example,we can verify
that the graph G and H in figure5.28 and are isomorphic
F IG 5.26
F IG 5.27
Note:i) Two isomorphic graphs have equal number of vertices and edges.
Example 8:Show that the graph displayed in figure5.30 are not isomorphic.
F IG 5.28
Solution: The graph G and H both have five vertices and six edges. However, the graph H has a vertex
of degree one namely v3. Whereas G has no vertices of degree one. Hence G and H are not isomorphic.
Given any graph G, we can obtain a new graph by dividing an edge of G with additional vertices. Two
graphs G and G* are said to homeomorphic if they can be obtained from the same graph or
isomorphic graphs by this method. The graphs (a) and (b) in given Fig. are not isomorphic, but they are
homeomorphic since they can be obtained from the graph (c) by adding appropriate vertices.
Note, that G−v is the graph obtained from G by deleting v and all edges containing v.
Note, that G − e is the graph obtained from G by simply deleting the edge e.
For example: In given Fig.(a),the vertex D is a cutpoint and there are no bridges. In Fig.(b), the edge =
{D,F} is a bridge. (Its endpoints D and F are necessarily cutpoints.)
PLANAR GRAPHS
A graph or multigraph which can be drawn in the plane so that its edges do not cross is said to be
planar.
Although the complete graph with four vertices K4 is usually pictured with crossing edges as in Fig. (a),
it can also be drawn with non crossing edges as in Fig.(b); hence K4 is planar. Tree graphs form an
important class of planar graphs.
A particular planar representation of a finite planar multigraph is called a map. We say that the map is
connected if the underlying multigraph is connected. A given map divides the plane into various
regions. For example, the map in below Fig. with six vertices and nine edges divides the plane into five
regions. Observe that four of the regions are bounded, but the fifth region, outside the diagram, is
unbounded. Thus there is no loss in generality in counting the number of regions if we assume that our
map is contained in some large rectangle rather than in the entire plane. Observe that the border of
each region of a map consists of edges. Sometimes the edges will form a cycle, but sometimes not. For
example, in given Fig. the borders of all the regions are cycles except for r3. However, if we do move
counterclockwise around r3 starting, say, at the vertex C, then we obtain the closed path (C,D,E, F,E,C)
where the edge {E,F} occurs twice. By the degree of a region r, written deg(r), we mean the length of
the cycle or closed walk which borders r. We note that each edge either borders two regions or is
contained in a region and will occur twice in any walk along the border of the region
Fig.
Thus we have a theorem for regions which is analogous to Theorem for vertices.
Theorem: The sum of the degrees of the regions of a map is equal to twice the number of edges.
The sum of the degrees is 18, which, as expected, is twice the number of edges.
For notational convenience we shall picture the vertices of a map with dots or small circles, or we shall
assume that any intersections of lines or curves in the plane are vertices.
Euler gave a formula which connects the number V of vertices, the number E of edges, and the
number R of regions of any connected map. Specifically:
Theorem (Euler): V − E + R = 2.
Proof of Theorem:
Suppose the connected map M consists of a single vertex P as in Fig. (a). Then V = 1, E = 0, and R = 1.
Hence V − E + R = 2. Otherwise M can be built up from a single vertex by the following two
constructions:
(1) Add a new vertex Q2 and connect it to an existing vertex Q1 by an edge which does not cross any
existing edge as in Fig. (b).
(2) Connect two existing vertices Q1 and Q2 by an edge e which does not cross any existing edge as in
Fig.(c).
Neither operation changes the value of V −E +R. Hence M has the same value of V −E +R as the map
consisting of a single vertex, that is, V − E + R = 2. Thus the theorem is proved.
For example: Observe that, in above given Fig., V = 6, E = 9, and R = 5; and, as expected by Euler’s
formula.
V−E+R=6−9+5=2
It emphasize that the underlying graph of a map must be connected in order for Euler’s formula to
hold.
1. A graph G = (v,E) is a pair of sets, where V ={v1,v2, ............... } is a set of vertices and E ={e1,e2,……}
2. A graph is said to be undirected graph if its edges are unordered pairs of distinct vertices
otherwise the graph is said to be directed.
3. The degree of a vertex is the number of edges incident with that vertex.
4. A loop is an edge from a vertex to itself. It there is more than one edge between a pair of
vertices, them these edges are called parallel edges.
6. A simple graph in which there is an edge between every pair of vertices is called a complete
graph.
8. In computers, a graph can be represented in two ways, viz, adjacency matrix and incidence matrix.
9. The simple graph G1= (v1, E1) and G2= (v2, E2) are isomorphic if there is a one-to-one and onto
function f from v1 to v2 with the property that vertices a and b are adjacent in G1 iff f(a)andf(b)
10. A graph is connected if we can reach any vertex from any other vertex by traveling along the
edges. Otherwise, the graph is disconnected.
11. A graph is Hamiltonian if every vertex of the graph has even number of degrees.
6.11KEYWORDS
Graph: -A graph G = (v,E) is a pair of sets, where V = {v1, v2, ....... } is a set of vertices and E = {e1,
e2,……} is a set of edges connecting pair of vertices.
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 a simple graph.
Multigraph: – A graph in which multiple edges may connect the same pair of vertices is called a
multigraph.
Complete Graphs: – A simple graph of n vertices having exactly one edge between each pair of
vertices is called a complete graph. A complete graph of n vertices is denoted by Kn.
Bipartite Graphs: – A simple graph G is said to be bipartite if its vertex set V can be divided into two
disjoint sets such that every edge in G has its initial vertex in the first set and the terminal vertex in the
second set. Total number of edges are (n*m) with (n+m) vertices in bipartite graph.
Regular Graph: -A Regular graph is a graph in which degree of all the vertices is same. If the degree
of all the vertices is k, then it is called k-regular graph.
Planar graph: - A planar graph is a graph that we can draw in a plane in such a way that no two edges
of it cross each other except at a vertex to which they are incident.
1. Write the adjacency matrix associated with the graph shown below:
0 1 0 1
1 0 1 1
0 0 1 1 0 0
and
0 0 0 1
1 1 0
1 1 1 0
0 0 0 1
0 0 0 0
0 0 0 0
1 1 1 0
2. The degree of a vertex is the number of edges incident with that vertex.
3. A vertex of degree one is called a pendant vertex and a vertex of degree zero is called an isolated
vertex
4. A vertex is said to be an even or odd vertices according as its degree is an even or odd number.
5. A simple graph is which there exists an edge between every pair of vertices is called a complete
graph. Again a graph in which every vertex has the same degree is called a regular graph.
6. Suppose that G be a simple undirected graph with n vertices. suppose that the vertices of G are
listed arbitrarily as v1, v2, ...... ..., vn. The adjacency matrix denoted by A(G) of G is ann×n matrix
[aij] defined as:[aij] = 1, if vertex viis adjacent to vj 0,otherwise
7. Two simple graph G1 = (V1, E1) and G2 = (V2, E2) are isomorphic if there is a one-to-one and onto
function f from V1toV2with the property that vertices a and b are adjacent in G1 iff f(a) and f(b) are
8. A path that passes through each edge exactly once but vertices may be repeated is called on Euler
path. Again a circuit that covers every edge exactly once is called an Euler circuit.
STRUCTURE
6.2 Introduction
6.4 Tree
6.7 Summary
6.8 Keywords
6.1 LEARNINGOBJECTIVES
5. How to find minimum cost path between two nodes using prim’s and kruskal algo.
6.2 INTRODUCTION
In Unit 5, we have discussed about various types of graphs and its applications. In this unit further on
we discussed about what is weighted graphs, and various algos, which we can use in daily life for
computing shortest path and minimum cost path between two nodes.
A graph G is called a weighted graph if it’s edges and/or vertices are assigned data of one kind or
another. In particular, G is called a weighted graph if each edge e of G is assigned a non negative
number w(e) called theweight or length of v. Below Figure shows a weighted graph where the weight of
each edge is given in the obvious way. The weight (or length) of a path in such a weighted graph G is
defined to be the sum of the weights of the edges in the path. One important problem in graph theory is
to find a shortest path, that is, a path of minimum weight (length), between any two given vertices. The
length of a shortest path between P and Q in Fig. is 14; one such path is
(P,A1,A2,A5,A3,A6,Q)
It is a greedy algorithm that solves the single-source shortest path problem for a directed graph G = (V,
E) with nonnegative edge weights, i.e., w (u, v) ≥ 0 for each edge (u, v) ∈ E.
Dijkstra's Algorithm maintains a set S of vertices whose final shortest - path weights from the source s
have already been determined. That's for all vertices v ∈ S; we have d [v] = δ (s, v). The algorithm
repeatedly selects the vertex u ∈ V - S with the minimum shortest - path estimate, insert u into S and
relaxes all edges leaving u.
Because it always chooses the "lightest" or "closest" vertex in V - S to insert into set S, it is called as
the greedy strategy.
2. S←∅
3. Q←V [G]
4. while Q ≠ ∅
6. S ← S ∪ {u}
8. do RELAX (u, v, w)
Example:
Solution:
Step1: Q =[s, t, x, y, z]
We scanned vertices one by one and find out its adjacent. Calculate the distance of each adjacent to the
source vertices.
We make a stack, which contains those vertices which are selected after computation of shortest
distance.
1. M = [S] Q = [t, x, y, z]
Case - (i) s → t
d [v] > d [u] + w [u, v]
d [t] > d [s] + w [s, t]
Case - (ii) s→ y
d [v] > d [u] + w [u, v]
d [y] > d [s] + w [s, y]
∞>0+5 [false condition]
∞>5
Then d [y] ← 5
π [y] ← 5
Case - (i) y →t
d [v] > d [u] + w [u, v]
d [t] > d [y] + w [y, t]
10 > 5 + 3
10 > 8
Then d [t] ← 8
π [t] ← y
Case - (ii) y → x
d [v] > d [u] + w [u, v]
d [x] > d [y] + w [y, x]
∞>5+9
∞ > 14
Then d [x] ← 14
π [x] ← 14
Case - (iii) y → z
d [v] > d [u] + w [u, v]
d [z] > d [y] + w [y, z]
∞>5+2
∞>7
Then d [z] ← 7
π [z] ← y
Case - (i) z → x
d [v] > d [u] + w [u, v]
d [x] > d [z] + w [z, x]
14 > 7 + 6
14 > 13
Then d [x] ← 13
π [x] ← z
Case - (ii) z → s
d [v] > d [u] + w [u, v]
d [s] > d [z] + w [z, s]
0>7+7
0 > 14
∴ This condition does not satisfy so it will be discarded.
Now we have x = 13.
Case - (i) t → x
d [v] > d [u] + w [u, v]
d [x] > d [t] + w [t, x]
13 > 8 + 1
13 > 9
Then d [x] ← 9
π [x] ← t
Case - (ii) t → y
d [v] > d [u] + w [u, v]
d [y] > d [t] + w [t, y]
5 > 10
∴ This condition does not satisfy so it will be discarded.
Weight from s to y is 5
Weight from s to z is 7
Weight from s to t is 8
Weight from s to x is 9
These are the shortest distance from the source's' in the given graph.
3. It leads to the acyclic graph and most often cannot obtain the right shortest path.
6.4 Tree
A graph T is called a tree if T is connected and T has no cycles. Examples of trees are shown in Fig. A
forest G is a graph with no cycles; hence the connected components of a forest G are trees. A graph
without cycles is said to be cycle-free. The tree consisting of a single vertex with no edges is called the
degenerate tree. Consider a tree T . Clearly, there is only one simple path between two vertices of T ;
otherwise, the two paths would form a cycle. Also:
(a) Suppose there is no edge {u, v} in T and we add the edge e = {u, v} to T . Then the simple path from
u to v in T and e will form a cycle; hence T is no longer a tree.
(b) On the other hand, suppose there is an edge e = {u, v} in T , and we delete e from T . Then T is no
longer connected (since there cannot be a path from u to v); hence T is no longer a tree.
Theorem : Let G be a graph with n >1 vertices. Then the following are equivalent:
(i) G is a tree.
Proof:
The proof is by induction on n. The theorem is certainly true for the graph with only one vertex and
hence no edges. That is, the theorem holds for n = 1.We now assume that n >1 and that the theorem
holds for graphs with less than n vertices.
(i) implies (ii) Suppose G is a tree. Then G is cycle-free, so we only need to show that G has n−1 edges.
G has a vertex of degree 1. Deleting this vertex and its edge, we obtain a tree T which has n − 1 vertices.
The theorem holds for T , so T has n − 2 edges. Hence G has n − 1 edges. (ii) implies (iii) Suppose G is
cycle-free and has n − 1 edges. We only need show that G is connected. Suppose G is disconnected and
has k components, T1, . . . , Tk , which are trees since each is connected and cycle-free. Say Ti has ni
vertices. Note ni < n. Hence the theorem holds for Ti, so Ti has ni − 1 edges. Thus
n = n1 + n2 +・・・+nk
and
Hence k = 1. But this contradicts the assumption that G is disconnected and has k >1 components.
Hence G is connected.
(iii) implies (i) Suppose G is connected and has n − 1 edges. We only need to show that G is cycle-free.
Suppose G has a cycle containing an edge e. Deleting e we obtain the graph H = G − e which is also
connected. But H has n vertices and n − 2 edges, and this contradicts. Thus G is cycle-free and hence is
a tree.
This theorem also tells us that a finite tree T with n vertices must have n−1 edges. For example, the tree
shown in below Fig.(a)has 9 vertices and 8 edges, and the tree in Fig.(b) has 13 vertices and 12 edges.
A subgraph T of a connected graph G is called a spanning tree of G if T is a tree and T includes all the
vertices of G. Figure shows a connected graph G and spanning trees T1, T2, and T3 of G.
Suppose G is a connected weighted graph. That is, each edge of G is assigned a nonnegative number
called the weight of the edge. Then any spanning tree T of G is assigned a total weight obtained by
adding the weights of the edges in T . A minimal spanning tree (MST) of G is a spanning tree whose
total weight is as small as possible.
NOTE:
The weight of a minimal spanning tree is unique, but the minimal spanning tree itself is not. Different
minimal spanning trees can occur when two or more edges have the same weight. In such a case, the
arrangement of the edges in tree is not unique and hence may result in different minimal spanning trees.
1. Kruskal's Algorithm
2. Prim's Algorithm
It is an algorithm to construct a Minimum Spanning Tree (MST) for a connected weighted graph. It is a
Greedy Algorithm. The Greedy Choice is to put the smallest weight edge that does not because a cycle
in the Minimum Spanning Tree constructed so far.
2. Starting only with the vertices of G and proceeding sequentially add each edge which does not
result in a cycle, until (n - 1) edges are used.
3. EXIT.
1. A ← ∅
8. UNION (u, v)
9. return A
For Example: Find the Minimum Spanning Tree of the following graph using Kruskal's algorithm.
Solution: First we initialize the set A to the empty set and create |v| trees, one containing each vertex
with MAKE-SET procedure. Then sort the edges in E into order by non-decreasing weight.
Now, check for each edge (u, v) whether the endpoints u and v belong to the same tree. If they do then
the edge (u, v) cannot be supplementary. Otherwise, the two vertices belong to different trees, and the
edge (u, v) is added to A, and the vertices in two trees are merged in by union procedure.
Step 3: then (a, b) and (i, g) edges are considered, and the forest becomes
Step 4: Now, edge (h, i). Both h and i vertices are in the same set. Thus it creates a cycle. So this edge
is discarded.
Then edge (c, d), (b, c), (a, h), (d, e), (e, f) are considered, and the forest becomes.
Step 5: In (e, f) edge both endpoints e and f exist in the same tree so discarded this edge. Then (b, h)
edge, it also creates a cycle.
Step 6: After that edge (d, f) and the final spanning tree is shown as in dark lines.
Step 7: This step will be required Minimum Spanning Tree because it contains all the 9 vertices and (9 -
1) = 8 edges
It is also a greedy algorithm. It starts with an empty spanning tree. The idea is to maintain two sets of
vertices:
At every step, it considers all the edges and picks the minimum weight edge. After picking the edge, it
moves the other endpoint of edge to set containing MST.
1. Create MST set that keeps track of vertices already included in MST.
2. Assign key values to all vertices in the input graph. Initialize all key values as INFINITE (∞).
Assign key values like 0 for the first vertex so that it is picked first.
a. Pick vertex u which is not is MST set and has minimum key value. Include 'u'to
MST set.
b. Update the key value of all adjacent vertices of u. To update, iterate through all adjacent
vertices. For every adjacent vertex v, if the weight of edge u.v less than the previous key
value of v, update key value as a weight of u.v.
MST-PRIM (G, w, r)
2. do key [u] ← ∞
3. π [u] ← NIL
4. key [r] ← 0
5. Q ← V [G]
6. While Q ? ∅
Example: Generate minimum cost spanning tree for the following graph using Prim's algorithm.
Solution: In Prim's algorithm, first we initialize the priority Queue Q. to contain all the vertices and the
key of each vertex to ∞ except for the root, whose key is set to 0. Suppose 0 vertex is the root, i.e., r. By
EXTRACT - MIN (Q) procure, now u = r and Adj [u] = {5, 1}.
Removing u from set Q and adds it to set V - Q of vertices in the tree. Now, update the key and π fields
of every vertex v adjacent to u but not in a tree.
2. Root = 0
3. Adj [0] = 5, 1
4. w (5,4) = 25
3. w (4,3) = 22 w (4,6) = 24
1. π[3]= 4 π[6]= 4
2. u = 3 i.e. 22 < 24
2. 4 is already in heap
5. w (3, 2) = 12 w (3, 6) = 18
Now in Q, key [2] = 12, key [6] = 18, key [1] = 28 and parent of 2 and 6 is 3.
1. π [2] = 3 π[6]=3
1. u = EXTRACT_MIN (2, 6)
3. 12 < 18
6. 3 is already in a heap
8. w (2,1) = 16
1. π[1]= 2
4. w [1, 6] = 14
1. Π [6] = 1
Now all the vertices have been spanned, Using above the table we get Minimum Spanning Tree.
1. 0 → 5 → 4 → 3 → 2 → 1 → 6
Total Cost = 10 + 25 + 22 + 12 + 16 + 14 = 99
1. Find a minimal spanning tree T for the weighted graph G in figure below?
4. Use kruskal’s algorithm to obtain minimum spanning tree for following figure?
5. In the given graph, identify the shortest path using Dijkastra’s algorithm having minimum cost
to reach vertex E if A is the source vertex.
6.7SUMMARY
2. When we give weights or label on edeges of any graph , then the graph is known as weighted
graph.
3. Dijkastra’s Algorithm shows the minimum weight path between two nodes.
4. Two minimum spanning tree for the same graph have unique weight but can be of different
structure.
5. Kruskal’s algo and prim’s algo are two algorithms to find minimum spanning tree.
6.8 KEYWORDS
Weighted graph – A graph G is called a weighted graph if its edges and/or vertices are assigned data
of one kind or another.
Minimum Spanning Tree – A minimal spanning tree (MST) of G is a spanning tree whose total weight
is as small as possible.
Q.1 Suppose we run Dijkstra’s single source shortest-path algorithm on the following edge weighted
directed graph with vertex P as the source. In what order do the nodes get included into the set of
vertices for which the shortest path distances are finalized?
Q.2 What is the weight of the minimum spanning tree using the Prim’s algorithm, starting from
vertex a?
Q.3 What is the weight of the minimum spanning tree using the Kruskal’s algorithm?
Ans: 1 Since G has n = 9 vertices, T must have n − 1 = 8 edges. Apply Algorithm, that is, keep deleting
edges with maximum length and without disconnecting the graph until only n−1 = 8 edges remain and
without forming any circle until n − 1 = 8 edges are added. Now we got a minimum spanning tree such
as that shown in Fig.
Ans:2 10
Ans:3 1 + 1 + 1 + 1 + 1 + 2 + 2 + 3 = 12.
Ans:4
Thus the minimal spanning tree of Q which is obtained contains the edges
Ans:5 The minimum cost required to travel from vertex A to E is via vertex C
A to C, cost=3
C to E, cost=2
2. Discrete Mathematics with Graph Theory, 2nd edition, by E.G. Goodaire and M.M. Parmenter,
published by Prentice Hall, 2002.
3. N.Deo, Graph Theory with application and computer science , Pentile H
4. Discrete Mathematics, 5th edition, by K.A. Ross and C.R.B. Wright, published by Prentice Hall,
2003.
STRUCTURE
7.12 Summary
7.13 Keywords
7.1 LEARNINGOBJECTIVE
T HE MAIN OBJECTIVE OF THIS LESSON IS TO ACQUAINT THE STUDENTS WITH THE CONCEPT OF
DIFFERENT FIELDS . M ODELS USED IN OPERATIONS R ESEARCH AND THE METHODS TO SOLVE THESE
The main origin of Operations Research (OR) was during the Second World-War. At that time, the
military management in England called upon a team of scientists to study the strategic and tactical
problems related to air and land defense of the country. Since they were having very limited military
resources, it was necessary to decide upon the most effective utilization of them, e.g. the efficient ocean
transport, effective bombing, etc.
During World-War II, the Military Commands of U.K. and U.S. A. engaged several inter-disciplinary
teams of scientists to undertake scientific research into strategic and tactical military operations. Their
mission was to formulate specific proposals and plans for adding the Military Commands to arrive at the
decisions on optimal utilization of scarce military resources and efforts, and also to implement the
decisions effectively. The OR teams were not actually engaged in military operations and in fighting the
war. But they were only advisors and significantly instrumental in winning the war to the extent that the
scientific and systematic approaches involved in OR provided a good intellectual support to the strategic
initiatives of the military commands. Hence OR can be associated with “an art of winning the war
without actually fighting it”.
As the name implies, ‘Operations Research’ (sometime abbreviated OR) was apparently invented
because the team was dealing with research on (military) operations. The work of this team of scientists
was named as Operational Research in England.
The encouraging result obtained by the British OR teams quickly motivated the United States military
management to start with similar activities. Successful application of the U.S. teams included the
invention of new fight patterns, planning sea mining and effective utilization of electronic equipment.
Following the end of war, the success of military teams attracted the attention of Industrial managers
who were seeking solutions to their complex executive-type problems. The most common problem was:
what methods should be adopted so that the total cost is minimum or total profits maximum? The first
mathematical model in this field (called the Simplex Method of linear programming) was developed in
1947 by American mathematician, George B. Dantzig. Since then, new techniques and applications
have been developed through the efforts and cooperation of interested individuals in academic
institutions and industry both.
‘OR’ HAS BEEN DEFINED SO FAR IN VARIOUS WAYS AND IT IS PERHAPS STILL TOO YOUNG TO BE
FEW OPINIONS ABOUT THE DEFINITION OF OR WHICH HAVE BEEN CHANGED ACCORDING TO THE
4. OR is the art to giving bad answers to problems to which otherwise worse answers are
given. -T.L. Saaty (1958)
5. Operations Research is the art of winning war without actually fighting it.
Most of the definitions of Operations Research have been offered at different times of development of
‘OR’ and hence are bound to emphasis its only one or the other aspect.
OPE 2.
OPERATIONS RESEARCH
Wholistic approach to the system- The most of the problems tackled by OR have the
characteristic that OR tries to find the best (optimum)decisions relative to largest
possible portion of the total organization. The nature of organization is essentially
immaterial.
5. To optimize the total output- OR tries to optimize total return by maximizing the profit
and minimizing the cost or loss.
i. Where to distribute the products for sale so that the total cost of transportation
etc. is minimum,
iv. How to select the best advertizing media with respect to time, cost, etc.
iii. To find out the number of persons to be appointed on full time basis when the
workload is seasonal.
iii. In calculating the optimum product mix; and to select, locate, and design the sites
for the production plants.
A model is defined as a representation of an actual object or situation. It shows the relationships (direct
or indirect) and inter-relationships of action and reaction in terms of cause and effect.
The main objective of a model is to provide means for analyzing the behavior of the system for the
purpose of improving its performance or, if a system is not in existence, then a model defines the ideal
structure of this future system indicating the functional relationships among its elements. The reliability
of the solution obtained from a model depends on the validity of the model in representing the real
systems.
1. Classification by Structure
For example, a toy airplane is an iconic model, of a real one. Other common
examples of it are: photographs, drawings, maps etc. A model of an atom is
scaled up so as to make it visible to the naked eye. In a globe, the diameter of the
earth is scaled down, but the globe has approximately the same shape as the earth,
and the relative sizes of continents, seas, etc., are approximately correct.
ii. Analogue Models- The models, in which one set of properties is used to
represent another set of properties, are called analogue models. After the problem
is solved, the solution is reinterpreted in terms of the original system.
For examples, graphs are very simple analogues because distance is used to
represent the properties such as: time, number, per cent, age, weight, and many
other properties.
2. Classification by Purpose
Models can also be classified by purpose of its utility. The purpose of a model may be
descriptive, predictive or prescriptive.
ii. Predictive Models- Such models can answer ‘what if’ type of questions, i.e. they
can make predictions regarding certain events. For example, based on the survey
results, television networks such models attempt to explain and predict the
election results before all the votes are actually counted.
iii. Prescriptive Models- Finally, when a predictive model has been repeatedly
successful, it can be used to prescribe a source of action. For example, linear
ii. Probabilistic (or Stochastic) Models- These types of models usually handle
such situation in which the consequences or payoff of managerial actions cannot
be predicted with certainty. However, it is possible to forecast a pattern of events,
based on which managerial decisions can be made. For example, insurance
companies are willing to insure against risk of fire, accidents, and sickness and so
on, because the pattern of events have been compiled in the form of probability
distributions.
4. Classification by Behavior
i. Static Models- These models do not consider the impact of changes that take
place during the planning horizon, i.e. they are independent of time.
ii. Dynamic Models- In these models, time is considered as one of the important
variables and admits the impact of changes generated by time.
advantage of being more flexible than mathematical modeling and hence can be
used to represent complex systems which otherwise cannot be formulated
mathematically.
Following principles should be taken care of while building Operations Research models:
5. A model should neither be pressed to do; nor criticized for failing to do that for which it
was never intended
6. Beware of overselling the model in cases where assumption made for the construction of
the model can be challenged.
7. The solution of a model cannot be more accurate than the accuracy of the information
that goes into the construction.
There are six important phases in OR study, but it is not necessary that in all the studies each and every
phase is invariably present. These phases are arranged in following logical order.
Phase I in the process of OR study is observing the problem environment. The activities that
constitute this phase are visits, conferences, observations, research and so on. With the help of
such activities, the OR scientist gets sufficient information and support to proceed and is better
prepared to formulate the problem.
Phase II is analyzing and defining the problem. In this phase not only, the problem is defined,
but also uses, objectives and limitations of the study are stressed in the light of the problem. The
end result of this phase is a clear grasp of need for a solution and understanding its nature.
Phase III is to construct a model. A model is representation of some real or abstract situation.
Operations research models are basically mathematical models representing systems, processes
or environment in the form of equation, relationships or formulae. The activities in this phase
include defining inter-relationships among variables, formulating equations, using known OR
models or searching suitable alternate models. The proposed model may be field tested and
modified in order to work under environmental constraints. The model may also be modified if
the management is not satisfied with the answer that it gives.
No model will work appropriately if data input is not appropriate. Hence, tapping the right kind
of data is a vital phase in OR process. Important activities in this phase are analyzing internal-
external data and facts, collecting opinions using computer data banks.
Phase V in OR process is to get a solution with the help of a model and data input. First, the
solution is used to test the model and to find limitations, if any. If the solution is not reasonable
or if the model is not behaving properly, updating and modification of the model is considered at
this phase.
Finally, the tested results of the model are implemented to work. This phase is primarily
executed with the cooperation of Operations Research experts and those who are responsible for
managing and operating the systems.
1. Distribution (Allocation) Models. Distribution models are concerned with the allotment
of resources so as to minimize cost or maximize profit subject to prescribed restrictions.
4. Markovian Models. These models are applicable in such situations where the state of
the system can be defined by some descriptive measure of numerical value and where the
system moves from one state to another on a probability basis. Brand- switching
problems considered in marketing studies is an example of such models.
5. Competitive Strategy Models (Games Theory). These models are used to determine
the behavior of decision-making under competition or conflict. Methods for solving such
models have not been found suitable for industrial applications, mainly because they are
referred to an idealistic world neglecting many essential features of reality.
6. Network Models. These models are applicable in large projects involving complexities
and inter-dependencies of activities. Project Evaluation and Review Techniques (PERT)
and Critical Path Method are used for planning, scheduling and controlling complex
project which can be characterized as works.
7. Job Sequencing Models. These models involve the selection of such a sequence of
performing a series of jobs to be done on machines that optimize the efficiency
performance of the system.
8. Replacement Models. These models deal with the determination of optimum
replacement policy in situations that arise when some items or machinery need
replacement by a new one. Individual and group replacement policies can be used in the
case of such equipments that fail completely and instantaneously.
9. Simulation Models. Simulation is a very powerful technique for solving much complex
models which cannot be solved otherwise and thus it is being extensively applied to
solve a variety of problems. In fact, such models are solved by simulation techniques
where no other method is available for its solution.
1. Analytic Method. If the OR model is solved by using all the tools of classical
mathematics such as differential calculus and finite differences available for the task,
then such type of solutions are called analytic solutions. Solutions of various inventory
models are obtained by adopting the so called analytic procedure.
2. Iterative Method. If classical methods fail because of complexity of the constraints or
the number of variables, and then we are usually forced to adopt an iterative method.
Such a procedure starts with a trial solution and a set of rules for improving it. The trial
solution is then replaced by the improved solution, and the process is repeated until
Disadvantages:
i. This technique does not give optimal answers to the problems. The good results
are obtained only when the sample size is quite large.
C. Financial operations
4. Operations research is based upon collected information, knowledge and advanced study
of various factors impacting a particular operation. This leads to more informed -----------
-----------------------.
C. Procedures
A. True
B. False
7. Operations Research started just before World War II in Britain with the establishment
of teams of scientists to study the strategic and tactical problems involved in military
operations.
A. True
B. False
8. OR can be applied only to those aspects of libraries where mathematical models can be
prepared.
A. True
B. False
9. The main limitation of operations research is that it often ignores the human element in
the production process.
A. True
B. False
7.12 SUMMARY
FIND SOLUTION WHICH MAY NOT BE PERFECT BUT THE QUALITY OF SOLUTIONS CAN BE IMPROVED BY
APPLYING OR TECHNIQUES . SOLVING A PROBLEM USING OR TECHNIQUES HAS SIX MAIN PHASES .
MODELS USED IN OR CAN BE CLASSIFIED BASED ON STRUCTURE , PURPOSE, NATURE OF
ENVIRONMENT, BEHAVIOUR , METHOD OF SOLUTION ETC . ANALYTIC, ITERATIVE AND MONTE-CARLO
METHODS ARE GENERALLY USED TO SOLVE OR MODELS.
7.13 KEYWORDS
1. Operation Research:-Operations research is a discipline that deals with the application of advanced
analytical methods to help make better decisions.
2. Model:-A model is defined as a representation of an actual object or situation. It shows the
relationships (direct or indirect) and inter-relationships of action and reaction in terms of cause and
effect. The main objective of a model is to provide means for analyzing the behavior of the system
for the purpose of improving its performance.
3. Principles of Modeling:-There are different kind of principle user should remember while using
modeling. Model are made easy to understand. They are not made complicated. They are made up to
Q 5. What is meant by a mathematical model of a real situation? Discuss the importance of models in
the solution of operations research problems.
Q 9. Describe the methodology of OR and enumerate the models used inproduction management.
Q 16. What are the essential characteristics of OR? Explain the role ofcomputers in this field.
Q 17. Write a note on application of various quantitative techniques indifferent fields of business
decision-making
1. B
2. A
3. B
4. B
5. C
6. B
7. A
8. A
9. A
LINEAR PROGRAMMING
STRUCTURE
8.2 Introduction
8.12 Summary
8.13 Keyword
8.1 LEARNINGOBJECTIVE
The main objective of this lesson is to acquaint with the students with the concept of linear
programming. Formulation of real life situations as linear programming problems and graphical
solution of problems are explained through examples. This lesson also introduces the concept of
slack and surplus variables which will be used throughout the book.
8.2 INTRODUCTION
IN 1947, GEORGE DANTZIG AND HIS ASSOCIATES, WHILE WORKING IN THE U.S. DEPARTMENT OF AIR
FORCE, OBSERVED THAT A LARGE NUMBER OF MILITARY PROGRAMMING AND PLANNING PROBLEMS
COULD BE FORMULATED AS MAXIMIZING / MINIMIZING A LINEAR FORM OF PROFIT /COST FUNCTION
The general Linear Programming Problem (LPP) calls for optimizing (maximization/minimization) a
linear function of variables called the ‘Objective Function’ subject to a set of linear equation and /or
inequalities called the ‘Constraints’ or ‘Restrictions’.
THE PROCEDURE FOR MATHEMATICAL FORMULATION OF LPP CONSISTS OF THE FOLLOWING STEPS :
Step 3 Formulate the constraints of the problem such as resource limitations, market conditions,
interrelation between variables and others as linear equation or inequations in terms of
the decision variables.
Step 4 Add the non-negativity constraints so that negative values of the decision variables do
not have any valid physical interpretation.
The objective function, the set of constraint and the non-negative constraint together
form a linear programming problem.
The formulation of the LP problems is explained with the help of these examples.
A firm manufactures two types of products, A and B and sells them at a profit of Rs 2 on type A and Rs
3 on type B. Each product is processed on two machines G and H. Type A requires one minute if
processing time on G and two minutes on H; type B requires one minute on G and one minute on H.
The machine G is available for not more than 6 hours 40 minutes while machine H is available for 10
hours during any working day.
Formulation
Decision Variables. Let 𝑥1 be the number of products of Type A to be produced and let 𝑥2 be the
number of units of type B to be produced.
After carefully understanding the problem, the given information can be systematically arranged in the
form of the following table.
Table 8.1
Time of Production (minutes) Available Time
Machine
Type A(𝑥1 units) Type B (𝑥2 units) (minutes)
G 1 1 400
H 2 1 600
Profit per unit Rs.2 Rs. 3
Objective function. Since the profit on type A is Rs. 2 per product,2𝑥1 will be the profit on selling 𝑥1
unites of type A. Similarly, 3𝑥2 will be profit on selling 𝑥2 units of type B. Therefore, total profit z on
selling 𝑥1 units of A and 𝑥2 units of B is given by𝐳 = 2𝑥1 + 3𝑥2
Constraints. Since machine G takes 1 minute time on type A and 1 minute time on type B, the total
number of minutes required on machine G is given by 𝑥1 + 𝑥2 . But machine G is available for not more
than 6 hours 40 minutes (400 minutes).
Therefore 𝑥1 + 𝑥2 ≤ 400.
Similarly, the total number of minutes required on machine H is given by 2𝑥1 + 𝑥2 , but machine
H is available for 10 hours on a working day.
Hence the allocation problem of the firm can be finally put in the form:
𝒙𝟏 + 𝒙𝟐 ≤ 𝟒𝟎𝟎,
𝟐𝒙𝟏 + 𝒙𝟐 ≤ 𝟔𝟎𝟎,
𝒙𝟏 ≥ 𝟎, 𝒙𝟐 ≥ 𝟎
A Company manufactures two bottling machines X, and Y. X is designed for 5-ounce bottles and Y for
10-ounce bottles. However, each can be used on both types with some loss of efficiency. The following
data are available.
X 80/min 30/min
The machines can be run 8 hours per day, for 5 days a week. Profit on 5-ounce bottles is 20 paise, and
on 10-ounce bottles is, 30 paise. Weekly production of the drink cannot exceed 500,000 ounce; and, the
market can absorb 30,000 (5-ounce) bottles and 8000 (10-ounce) bottles per week. The company wishes
to maximize its profit, subject to all the production and marketing constraints.
Step 1. To determine the number of 5-ounce bottles and 10-ounce bottles to be produced per week let
𝑥1 and𝑥2 represent the number of bottles to be produced per week.
Step 2. The objective is to maximize the profit, that is, maximize z = Rs. (0.20𝑥1 + 0.30𝑥2 ).
Since, a 5-ounce bottle takes 1/80 minutes and, a 10-ounce bottle takes 1/30 minutes on machine
X, and the machine can run for 8 hours per day and 5 days per week, the time constraint on
machine X is.
𝑥1 ≤ 30,000, 𝑥2 ≤ 8000bottles
Subject to
𝑥1 ≤ 30,000, 𝑥2 ≤ 8000
A company manufactures two types of products. A and B and, sells them at a profit of Rs. 4 on type A
and Rs. 5 on type B. Each product is processed on two machines, X and Y. Type A requires 2 minutes
of processing time on X and 3 minutes on Y. Type B requires 2 minutes on X, and, 2 minutes on Y. The
machine, X is available for not more than 5 hours 30 minutes, while Y is available for 8 hours during
any working day. Formulate the problem as a LP problem.
Step 1. Let 𝑥1 be, the number of products of type A, and 𝑥2 be, the number of products of type B.
The profit on type A is Rs.4 per product. Therefore, 4𝑥1 will be the profit on selling 𝑥1 units of
type A. Similarly, 5𝑥2 will be the profit on selling 𝑥2 units of type B. Therefore, total profit on
selling 𝑥1 units of A, and 𝑥2 units of B, is given by.
𝒛 = 4𝑥1 + 5𝑥2.
Step3. To determine the constraints, since, machine X takes 2 minutes on type A and 2 minutes on type
B, and, it is not available for more than 5 hours 30 minutes (i.e. 330 minutes), the constraint
obtained is
Similarly, since the machine Y is available for 8 hours (480 minutes), the constraint obtained is,
𝑥1 ≥ 0 and 𝑥2 ≥ 0.
Subject to
𝑥1 ≥ 0 , 𝑥2 ≥ 0
Example 4. A company produces two types of hats. Each hat of the first type requires twice as much
labour time as the second type. If all hats are of the second type only, the company can produce a total
of 500 hats a day. The market limits daily sales of the first and second type to 150 and 250 hats.
Assuming that the profits per hat are Rs. 8 for type A and Rs. 5 for type B, formulate the problem as a
linear programming model in order to determine the number of hats to be produced of each type so as to
maximize the profit.
Formulation. Let the company produce hats of type A and hats of type B each day. So the profit P
after selling these two products is given by the linear function:
Since the company can produce at the most 500 hats in a day and A type of hats require twice as much
time as that of type B, production restriction is given by 2t𝑥1 + t𝑥2 ≤ 500t where t is the labour time
per unit of second type i.e.
2𝑥1 + 𝑥2 ≤ 500.
But there are limitations on the sale of hats, therefore further restrictions are:
𝑥1 ≤ 150, 𝑥2 ≤ 250.
𝑥1 ≥ 0, and 𝑥2 ≥ 0.
Example 5. The manufacturer of patent medicines is proposed to prepare a production plan for
medicines A and B. There are sufficient ingredients available to make 20,000 bottles- of medicine A
and 40,000 bottles of medicine B, but there are only 45,000 bottles into which either of the medicine
can be filled. Further, it takes three hours to prepare enough material to fill 1000 bottles of medicine A
and one hour to prepare enough material to fill 1000 bottles of medicine B, and there are 66 hours
available for this operation. The profit is Rs. 8 per bottle for medicine A and Rs. 7 per bottle for
medicine B.
Formulation. Suppose the manufacturer produces 𝑥1 and 𝑥2 thousand of bottles of medicines A and B,
respectively, since it takes three hours to prepare 1000 bottles of medicine A, the time required to fill
𝑥1 thousand bottles of medicine A will be 3𝑥1 hours. Similarly, the time required to prepare 𝑥2
thousand bottles of medicine B will be 𝑥2 hours. Therefore, total time required to prepare 𝑥1 thousand
bottles of medicine A and 𝑥2 thousand bottles of medicine B will be 3𝑥1 + 𝑥2 hours.
Now since the total time available for this operation is 66 hours. 3𝑥1 + 𝑥2 ≤ 66.
Since there are only 45 thousand bottles available for filling medicines A and B, 𝑥1 + 𝑥2 ≤ 45.
There are sufficient ingredients available to make 20 thousand bottles of medicine A and 40 thousand
bottles of medicine B, hence 𝑥1 ≤ 20 and 𝑥2 ≤ 40.
At the rate of Rs. 8 per bottle for type A medicine and Rs. 7 per bottle for type B medicine, the total
profit on 𝑥1 thousand bottles of medicine A and 𝑥2 thousand bottles of medicine B will become
Example 6. A and
toy 𝒙company manufactures
𝟏 ≥ 𝟎, 𝒙𝟐 ≥ 𝟎 two types of doll, a basic version- doll A and a deluxe
version—doll B. Each doll of type B takes twice as long to produce as one of type A, and the company
would have time to make a maximum of 2000 per day. The supply of plastic is sufficient to produce
1500 dolls per day (both A and B combined). The deluxe version requires a fancy dress of which there
are available only 600 per day. If the company makes a profit of Rs. 3.00 and Rs. 5.00 per doll,
respectively on doll A and B, then how many of each doll should be produced per day in order to
maximize the total profit. Formulate this problem.
Formulation. Let 𝑥1 and 𝑥2 be the number of dolls produced per day of type A and B, respectively. Let
the doll A requires t hrs so that the doll B requires 2t hrs. So the total time to manufacture 𝑥1 and 𝑥2
dolls should not exceed 2,000t hrs. Therefore 𝑡𝑥1 + 2t𝑥2 ≤ 2000t. Other constraints are simple. Then
the linear programming problem becomes:
SIMPLE LINEAR PROGRAMMING PROBLEMS OF TWO DECISION VARIABLES CAN BE EASILY SOLVED BY
GRAPHICAL METHOD . THE OUTLINES OF GRAPHICAL PROCEDURE ARE AS FOLLOWS:
Step 2. Plot each equation on the graph, as each one will geometrically represent a straight line.
Step 3. Shade the feasible region. Every point on the line will satisfy the equation of the line. If the
inequality- constraint corresponding to that line is ‘≤’, then the region below the line lying in the
first quadrant (due to non-negativity of variables) is shaded. For the inequality-constraint with
‘≥’, sign, the region above the line in the first quadrant is shaded. The points lying in common
region will satisfy all the constraints simultaneously. The common region thus obtained is called
the feasible region.
Step 4. Obtain the solution points (the corner points of the feasible region).
Step 6. For maximization problem, the optimum solution is the solution point which gives the
maximum value of the objective function and for minimization problems the optimum solution
is the solution point that gives the minimum value of the objective function.
Example 7. Find a geometrical interpretation and solution as well for the following LP problem:
Maximize 𝑧 = 3𝑥1 + 5𝑥2 , subject to restrictions:
Graphical Solution.
Step1. (To graph the inequality-constraints).Consider two mutually Perpendicular lines 𝑜𝑥1 and 𝑜𝑥2
as axes of coordinates. Obviously, any point (𝑥1 , 𝑥2 ) in the positive quadrant will certainly satisfy non-
negativity restrictions: 𝑥1 ≥ 0, 𝑥2 ≥ 0 to plot the line 𝑥1 + 2𝑥2 = 2000, put 𝑥2 = 0, 𝑓𝑖𝑛𝑑 𝑥1 = 2000
from this equation.
(Fig. 8.1)
Then mark a point L such that OL=2000. Similarly, again put 𝑥1 = 0 to find 𝑥2 = 1000 and mark
another point M such that OM=1000.
Now join the points L and M. This line will represent the equation 𝑥1 + 2𝑥2 = 2000 as shown in the
above figure.
Clearly any point P lying on or below the line 𝑥1 + 2𝑥2 = 2000 will satisfy the inequality 𝑥1 + 2𝑥2 ≤
2000.
Similar procedure is now adopted to plot the other two lines:𝑥1 + 𝑥2 = 1500, and 𝑥2 = 600 as shown
in the figures.
Any point on or below the lines 𝑥1 + 𝑥2 = 1500, 𝑥2 = 600 will also satisfy other two inequalities 𝑥1 +
𝑥2 ≤ 1500, 𝑥2 ≤ 600 respectively.
Step 2. Find the feasible region or solution space by combining the figs. 8.1, 8.2 and 8.3 together. A
common shaded area OABCD is obtained (see fig. 8.4) which is a set of points satisfying the inequality
constraints:
And non-negativity restrictions as 𝑥1 ≥ 0, 𝑥2 ≥ 0. Hence any point in the shaded area (including its
boundary) is feasible solution to the given LPP.
Step 3. Find the co-ordinates of the corner points of feasible region O, A, B, C and D.
Step 4. Calculate the value of z for each corner point O, A, B, C and D. Maximum value of z is attained
at the corner point B (1000,500), which is the point of intersection of lines
𝑥1 + 2𝑥2 = 2000 and 𝑥1 + 𝑥2 = 1500. Hence, the required solution is 𝑥1 = 1000, 𝑥2 = 500 and max
value z = Rs. 5500.
Max. z =𝑥1 + 𝑥2 ,
𝑥1 + 2𝑥2 ≤ 2000
𝑥1 + 𝑥2 ≤ 1500
𝑥2 ≤ 600
and 𝑥1 , 𝑥2 ≥ 0
Graphical Solution.
This problem is of the same type as discussed earlier except the objective function is slightly changed.
The feasible region will be similar to that of the above problem.
(Fig. 8.4)
It is clear that the values of 𝑥1 𝑎𝑛𝑑 𝑥2 which maximize value of z is always unique, but there will be an
infinite number of feasible solutions which give unique value of z. Thus, two corners A and B as well as
any point on the line AB give optimal solution of this problem.
It should be noted that if a linear programming problem has more than one optimum solution, there
exists alternative optimum solutions. In the above example, one optimum solution is:
Maximum Profit z = Rs. 1500 at 𝑥1 = 1500 𝑎𝑛𝑑 𝑥2 = 0 (at corner point A). Alternative optimum
solution to this problem is Maximum Profit z = Rs. 1500 at 𝑥1 = 1000 𝑎𝑛𝑑 𝑥2 = 500 (at corner point
B).
Example 9. Old hens can be bought at Rs. 2 each and young ones at Rs.5 each. The old hens lay 3 eggs
per week and the young ones lay 5 eggs per week, each egg being worth 30 paisa. A hen (young or old)
costs Rs. 1 per week to feed. I have only Rs. 80 to spend for hens, how many of each kind should I buy
to give a profit of more than Rs. 6 per week, assuming that I cannot house more than 20 hens.
Solution. Formulation, let 𝑥1 be the number of old hens 𝑎𝑛𝑑 𝑥2 the number of young hens to be
bought. Since old hens lay 3 eggs per week and the young ones lay 5 eggs per week, the total number of
eggs obtained per week will be =3𝑥1 + 5𝑥2 .
Consequently the profit on each egg being 30 paisa, the total gain will be = Rs. 0.30 (3𝑥1 +
5𝑥2 ).
Total expenditure for feeding (𝑥1 + 𝑥2 ) hens at the rate of Rs. 1 each will be = Rs. 1 (𝑥1 + 𝑥2 ).
Thus total profit z earned per week will be z = total gain- total expenditure
Since old hens can be bought at Rs. 2 each and young ones at Rs.5 each and there are only Rs.
80 available for purchasing hens, the constraints is :2𝑥1 + 5𝑥2 ≤80.
Also since, is not possible to house more than 20 hens at a time, so 𝑥1 + 𝑥2 ≤ 20.
Also, since the profit is restricted to be more than Rs. 6, this means that the profit function z is
to be maximized. Thus there is no need to add one more constraint, i.e. 0.5𝑥2 -0.1𝑥1 ≥6.
(Fig. 8.5)
The feasible region is OBEC. The coordinates of the extreme points of the feasible region are:
zA = 0
zC = −2,
zB = 8,
zE = 6.
Since the maximum value of z is Rs. 8 which occurs at the point B= (0, 16), the solution to the given
problem is 𝑥1 = 0, 𝑥2 = 16, max. z =Rs.8. Hence only 16 young hens I should buy in order to get the
maximum profit of Rs. 8 (which is >6).
Example 10. (Minimization problem) Consider the problem: Min. z =1.5𝑥1 + 2.5𝑥2 subject to 𝑥1 +
3𝑥2 ≥ 3, 𝑥1 + 𝑥2 ≥ 2,𝑥1 , 𝑥2 ≥ 0.
Graphical Solution. The geometrical interpretation of the problem is given in following figure:
(Fig. 8.6)
The minimum value of z is zA =3.5. This minimum is attained at the point of intersection A of the lines
𝑥1 + 3𝑥2 = 3, 𝑎𝑛𝑑 𝑥1 + 𝑥2 = 2. This is the unique point to give the minimum value of z. Now, solving
3 1
these two equations simultaneously, the optimum solution is :𝑥1 = , 𝑥2 = and min. z=3.5.
2 2
Graphical Solution. The region of feasible solutions is represented by the shaded area in the given
figure:
(Fig. 8.7)
It is clear from this figure that the feasible region is unbounded and the problem has no finite maximum
value of z. Such problems are said to have unbounded solutions.
(Fig. 8.8)
The figure shows that there is no point (𝑥1 , 𝑥2 ) which satisfies both the constraints simultaneously.
Hence the problem has no solution because the constraints are inconsistent.
Example 13. (Constraints can be consistent and yet there may be no solution)
Graphical Solution. Figure for this example as given below shows that there is no region of feasible
solutions in this case. Hence there is no feasible solution.
Example 14. (Problem in which constraints are equations rather than inequalities)
Max. z=5𝑥1 + 3𝑥2 subject to 3𝑥1 + 5𝑥2 = 15, 5𝑥1 + 2𝑥2 = 10, 𝑥1 ≥ 0, 𝑥2 ≥ 0.
Graphical Solution. Figure above shows the graphical solution. Since there is only a single solution
point A(20/19,45/19), there is nothing to be maximized.
THE GENERAL FORMULATION OF THE LINEAR PROGRAMMING PROBLEM CAN BE STATED AS FOLLOWS:
In order to find the values of n decision variables 𝑥1 , 𝑥2,……, 𝑥𝑛 to maximize or minimize the objective
function z = 𝑐1 𝑥1 + 𝑐2 𝑥2 + 𝑐3 𝑥3 +. . . +𝑐n 𝑥𝑛
: : : : :
: : : : :
where constraints may be in the form of any inequality (≤ or ≥) or even in the form of an equation (=),
and finally satisfy the non-negativity restrictions.
𝑥1 ≥ 0, 𝑥2 ≥ 0, … . 𝑥𝑗 ≥ 0, … . 𝑥𝑛 ≥ 0.
However, by convention, the values of right side parameters 𝑏i (i = 1,2,3 … . , m) are restricted to non-
negative values only. It is important to note that any negative 𝑏i can be changed to a positive value on
multiplying both sides of the constraint by -1. This will not only change the sign of all left side
coefficients and right side parameters but will also change the direction of the inequality sign.
𝑥1 + 𝑥2 ≤ 2, 2𝑥1 + 4𝑥2 ≤ 5, 𝑥1 , 𝑥2 ≥ 0
We add the slack variables S1 ≥ 0, 𝑆2 ≥ 0 on the left hand sides of above inequalities
respectively to obtain
𝑥1 + 𝑥2 + 𝑆1 =2
2 𝑥1 + 4𝑥2 + 𝑆2 = 5
𝑥1 , 𝑥2 , 𝑆1 , 𝑆2 ≥ 0.
1. Surplus Variables. If a constraint has ≥ sign, then in order to make it an equality, we have to
subtract something non-negative from its left hand side. Thus the positive variable which is
subtracted from the left hand side of the constraint to convert it into equation is called the surplus
variable.
𝑥1 + 𝑥2 ≥ 2, 2𝑥1 + 4𝑥2 ≥ 5, 𝑥1 , 𝑥2 ≥ 0.
We subtract the surplus variables 𝑆1 ≥ 0, 𝑆2 ≥ 0 from the left hand sides of above
inequalities respectively to obtain.
𝑥1 + 𝑥2 − 𝑆1 =2
2 𝑥1 + 4𝑥2 − 𝑆2 = 5
𝑥1 , 𝑥2 , 𝑆1 , 𝑆2 ≥ 0.
The standard form of the linear programming problem is used to develop the procedure for solving
general linear programming problem. The characteristics of the standard form are explained in the
following steps:
Step1. All the constraints should be converted to equations except for the non-negativity restrictions
which remain as inequalities (≥0). Constraints of the inequality type can be changed to equations
by augmenting (adding or subtracting) the left side of each such constraint by non-negative
variables. These new variables are called Slack Variables and are added if the constraints are (≤)
or subtracted if the constraints are (≥).
These constraints can be changed to equations by introducing surplus and slack variables
𝑥3 and 𝑥4 respectively. Thus, we get.
Step 2. The right side element of each constraint should be made non-negative (if not). The right side
can always be made positive on multiplying both sides of the resulting equation by (−1)
whenever it is necessary.
which can be written in the form of the equation 3 𝑥1 − 4𝑥2 − 𝑥3 = −4 by introducing the
surplus variable 𝑥3 ≥ 0.
A variable which is unrestricted in sign (that is, positive, negative or zero) is equivalent to the
difference between two non-negative variables. Thus, if 𝑥 is unconstrained in sign, it can be replace by
(𝑥 ′ − 𝑥"), where 𝑥′ and 𝑥" are both non-negative, that is 𝑥′ ≥ 0 and 𝑥" ≥ 0.
Min. z = 𝑐1 𝑥1 + 𝑐2 𝑥2 +. . . +𝑐n 𝑥𝑛
Consequently, in any L.P. problem, the objective function can be put in the maximization form
as given below:
Subject to
: : : : :
Solution Proceeding according to the above rules, the standard LP form becomes:
𝑥1 ≥ 0, 𝑥2 ≥ 0 , 𝑥3 ′ ≥ 0, 𝑥3 " ≥ 0, 𝑥4 ≥ 0, 𝑥5 ≥ 0.
The linear programming problem in standard form can be expressed in matrix form as follows:
X≥ 0.(non-negativity restriction)
𝑎11 𝑎12 … . . 𝑎1 𝑛 1 0 … 0
𝑎21 𝑎22 . … 𝑎2 𝑛 0 1 … 0
A =[ ]
: ∶ ∶ ∶ ∶ …:
𝑎𝑚1 𝑎𝑚2 . … 𝑎𝑚 𝑛 0 0 … 1
or
1 1 1 −1 0
A=[1 2 0 0 0]
5−2 3 0 1
Some important definitions related to solution of linear programming problems are given below:
3. Basis solution A basis solution is a solution obtained by setting any n variables (among
𝑚 + 𝑛 variables) equal to zero and solving for remaining m variables provided the
determinant of the coefficients of these m variables is non-zero. Such m variables (any of
them may be zero) are called basis variables, and the remaining variables which are set
as zero are called non-basic variables.
4. Basic feasible solution A basic solution to a LPP is called as a basic feasible solution if
it satisfies the non-negative restriction. There are two types of basic feasible solutions.
(i) Non-degenerate All m basic variables are positive, and remaining n variables will be
zero.
(ii) Degenerate A basic feasible solution is degenerate, if one or more basic variables
are zero.
determined by using linear programming which in turn reduces the overall cost and improves
productivity.
2. Transportation Problem. The means of transportation of goods and the size and location of
newly established warehouses can be determined by using linear programming.
4. Military Applications. These applications involve the problem of selecting an air weapon
system against gurillas so as to keep them pinned down and simultaneously minimize the
amount of aviation gasoline used, a variation of transportation problem that maximizes the total
tonnage of bomb dropped on a set of targets, and the problem of community defense against
disaster to find the number of defence units that should be used in the attack in order to provide
the required level of protection at the lowest possible cost.
8. Physical Distribution. Linear programming determines the most economic and efficient
manner of locating manufacturing plants and distribution centers for physical distribution.
Besides above, linear programming involves the applications in the area of administration,
education, inventory control, fleet utilization, awarding contract, and capital budgeting etc.
5. Minimize Z = ______________
A. –maximize(Z) B. -maximize(-Z)
8.12 SUMMARY
The process of determining a particular programme or plan of action is called linear programming.
Every linear programming problem has an objective function which is to be optimized (maximized or
minimized) while satisfying the given set of constraints. The linear programming problems having two
decision variables can be solved by graphical method. If the number of decision variables exceeds two,
graphical method fails as the line of equation having more than two variables cannot be drawn on graph.
Constraints are generally represented by inequalities whereas solving a given problem by graphical
method requires the constraints in the form of equations. These inequalities can be converted into
equations by using slack and surplus variables. Linear programming has a number of applications in our
day-to-day life such as in business, agriculture, production, military etc.
8.13 KEYWORD
3. Slack variable: -In an optimization problem, a slack variable is a variable that added to an
inequality constraint to transform it into an equality. Introducing a slack variable replaces an
inequality constraint with an equality constraint and a non-negativity constraint on the slack
variable.
4. Surplus Variable: -A surplus variable refers to the amount by which the values of the solution
exceed the resources utilized. These variables are also known as negative slack variables. ... In
order to obtain the equality constraint, the surplus variable is added to the greater than or equal to
the type constraints.
Q1. A manufacturer of Furniture makes two products: chairs and tables. Processing of these
products is done on two machines A and B. A chair requires 2 hours on machine A and
6 hours on machine B.A table requires 5 hours on machine A and no time on machine B.
There are 16 hours of time per day available on machine A and 30 hours on machine B.
Profit gained by manufacturer from chair and a table is Re. 1 and Rs. 5 respectively.
What should be daily production of each of the two products?
Q2. A farm is engaged in breeding pigs. The pigs are fed on various products grown on the
farm. In view of the need to ensure certain nutrient constituents, it is necessary to buy
products (call them A and B) in addition. The contents of the various products, per unit,
in nutrients are vitamins, proteins etc. is given in the following table:
M1 36 6 108
M2 3 12 36
M3 20 10 100
The last column of the above tables gives the minimum amount of nutrient constituents
M1, M2, M3 which must be given to the pigs. If the products A and B cost Rs. 20 and Rs.
4 per unit respectively, how much each of these two products should be bought so that
the total cost is minimized?
Q 3. A company produces two types of leather belts, say type A and B. Belt A is of superior
quality and belt B is of a lower quality. Profits on the two types of belt are 40 and 30
paise per belt respectively. Each belt of type A requires twice as much time as required
by a belt of type B. If all belts were of type B, the company would produce 1,000 belts
per day. But the supply of leather is sufficient only for 800 per day. Belt A requires a
fancy buckle and 400 fancy buckles are available for this, per day. For bet of type B,
only 700 buckles are available per day. How should the company manufacture the two
types of belt in order to have maximum overall profit?
Q 4. A company sells two different products A and B. The company makes a profit of Rs. 40
and Rs. 30 per unit on products A and B respectively. The two products are produced in
a common production process and sold in two different markets. The production process
has a capacity of 30,000 man-hours. It takes 3 hours to produce one unit of A and one
hour to produce one unit of B. The market has been surveyed and company officials feel
that the maximum number of units of A that can be sold is 8,000 and the maximum
number of B is 12,000 units. Subject to these limitations, the products can be sold in any
convex combinations. Formulate the above problem as a LPP and solve it by graphical
method.
Q 5. A Manufacturer makes two products P1 and P2 using two machines M1 and M2. Product
P1 requires 2 hours on machine M1 and 6 hours on machine M2. Product P2 requires 5
hours on machine. M1 and no time on machine M2. There are 16 hours of time per day
available on machine M1 and 30 hours on M2. Profit margin from P1 and P2 is Rs. 2 and
Rs. 10 per unit respectively. What should be the daily production mix to optimize profit?
b) Max. z=5𝑥1 + 3𝑥2 ;subject to 3𝑥1 + 5𝑥2 ≤ 15, 5𝑥1 + 2𝑥2 ≤ 10; 𝑥1 , 𝑥2 ≥ 0.
c) Max. z=5𝑥1 + 7𝑥2 ; s.t. 𝑥1 + 𝑥2 ≤ 4, 3𝑥1 + 8𝑥2 ≤ 24, 10𝑥1 + 7𝑥2 ≤ 35, 𝑥1 , 𝑥2 ≥
0.
1 C
2 A
3 C
4 D
5 B
6 D
7 C
8 A
9 D
STRUCTURE
9.1 Objective
9.2 Introduction
9.12 Summary
9.13 Keywords
The main objective of this lesson is to make the students learn about how to solve the linear
programming problems having more than two decision variables. Two new iterative method called
simplex method and Two- Phase Simplex Method is introduced in this lesson. The computational
process of simplex method and Two- Phase Simplex Method is explained through suitable example
and flowchart. The problem of degeneracy is also discussed.
9.2 INTRODUCTION
It is not possible to obtain the graphical solution to the LP problems having more than two decision
variables. In such cases, a simple and most widely used simplex method is adopted which was
developed by G. Dantzig in 1947. The Simplex method provides an algorithm (a rule of procedure
usually involving repetitive application of a prescribed operation) which is based on the fundamental
theorem of linear programming.
The Simplex algorithm is an iterative (step-by-step) procedure for solving LP problems. It consists of:-
(iii) Improving the first trial solution by a set of rules, and repeating the process till an optimal
solution is obtained.
2. Introduction to Two-Phase Simplex Method
Linear programming problems, in which constraints may also have ‘≥’ and ‘=’ signs after ensuring that
all 𝑏𝑖 are ≥0, are considered in this section. In such problems, basis matrix is not obtained as an identity
matrix in the starting simplex table, therefore we introduce a new type of variable, called, the artificial
variable. These variables are fictitious and cannot have any physical meaning. The artificial variable
technique is merely a device to get the starting basic feasible solution, so that simplex procedure may be
adopted as usual until the optimal solution is obtained. Artificial variables can be eliminated from the
simplex table as and when they become zero (non-basic). The process of eliminating artificial variables
is performed in Phase I of the solution, and Phase II is used to get an optimal solution. Since the
solution of the LP problem is completed in two phases, it is called ‘Two Phase Simplex Method’.
Remarks:
1. The objective of Phase I is to search for a Basic Feasible Solution (B.F.S.) to the given problem.
It ends up either giving a B.F.S. or indicating that the given L.P.P. has no feasible solution at all.
2. The B.F.S. obtained at the end of Phase I provides a starting B.F.S. for the given L.P.P. Phase II
is then just the application of simplex method to move towards optimality.
3. In Phase II, care must be taken to ensure that an artificial variable is never allowed to become
positive, if were present in the basis. Moreover, whenever some artificial variable happens to
leave the basis, its column must be deleted from the simplex table altogether.
Maximize z = CX
Subject to AX = b
and, X ≥ 0.
Then, the vector Cb= (𝐶b1 , 𝐶b2 , . . . , 𝐶𝑏𝑛 ) where 𝐶bi are components of C associated with the basic
variables, is called the cost vector associated with the basic feasible solution Xb.
Remarks:
3. Let a LPP have a feasible solution. If we drop one of the basic variables and introduce another
variable in the basic set, then the new solution obtained is also a basic feasible solution.
4. If the net evaluation 𝑧j − 𝐶j = 0 for at least one j for which 𝑎ij > 0, 𝑖 = 1,2 … . , m then another
basic feasible solution is obtained which gives an unchanged value of the objective function. If
for at least one j, for which 𝑎ij ≤ 0, i = 1,2 … . , m and 𝑧j − 𝐶j is negative, then there does not
exist any optimum solution.
Lastly, these notations can be summarized in the following Starting Simplex Table 9.1.
𝐶j 𝐶1 𝐶2 … 𝐶n 0 0 … 0
BASIC 𝐶b 𝑋b 𝑋1 = (𝑎1 )𝑋2 .. MIN
VARIA = (𝑎2 ) … 𝑋n (= 𝑎n ) 𝑋n+1 𝑋n+2 … 𝑋n+m
RATIO
BLES
( 𝐵1 ) ( 𝐵2 ) 𝐵m
𝑋n+1 (= 𝑆1 𝐶)b1 (= 0)𝑋b1 ( 𝑋1 1 (= 𝑎11 )𝑋12 (= 𝑎12 )… 𝑋1n (= 𝑎1n ) 1
= 𝑏1 ) 0 … 0
𝑋n+2 (= 𝑆2 )
𝐶b2 (= 0)𝑋b2 ( 𝑋2 1 (= 𝑎21 )𝑋22 (= 𝑎22 )… 𝑋2n (= 𝑎2n ) 0
: = 𝑏2 ) 1 … 0
: : : : :
𝑋n+m (= 𝑆m ) : : : :
:
Simplex method is an iterative procedure for solving the problems. Computational procedure of
Simplex method involves the following steps:
Step 2. We check up all 𝑏𝑖 ′s for no negativity. If some of the are𝑏𝑖 ′s negative multiply the
corresponding constraints through −1 by in order to ensure all 𝑏𝑖 ≥ 0.
Step 3. We change the inequalities to equations by adding slack and surplus variables, if necessary.
Step 4. We add artificial variable to those constraints with (≥) or (=) sign in order to get the identity
basis matrix.
Step 5. We now construct the starting simplex table (Table 9.1). From this table, the initial basic feasible
solution can be read off.
𝑧 = 𝑐𝐵 𝑥𝐵 ∆1 ∆2 ∆3 … … . . . . ∆𝑘 … … … ∆𝑚+𝑛 ∆𝑗
The computational aspect of the simplex procedure is explained by the following simple example.
𝑥1 + 𝑥2 ≤ 4, 𝑥1 − 𝑥2 ≤ 2, and 𝑥1 , 𝑥2 ≥ 0.
Solution:
Step 1. First, observe whether all the right side constants of the constraints are non-negative. If not it,
can be changed into positive value on multiplying both sides of the constraints by -1. In this example,
all the 𝑏1 ′s(right side constants) are already positive.
Step 2. Next convert the inequality constraints to equations by introducing the non-negative. The
coefficient of slack variables are always taken zero in the objective function. In this example, all
inequality constraints being ‘≤’, only slack variable 𝑠1 and 𝑠2 are needed. Therefore, given problem
now becomes:
𝑥1 + 𝑥2 + 𝑠1 = 4
𝑥1 − 𝑥2 + 𝑠2 = 2
𝑥1 , 𝑥2 , 𝑠1 , 𝑠2 ≥ 0.
Step 4. Construct the starting simplex table using the notations already explained in Section 3.2
It should be remembered that the values of non-basic variables are always zero at each iteration. So
𝑥1 = 𝑥2 = 0 here. Column 𝑥𝐵 gives the values of basic variables as indicated in the first column. So
𝑠1 = 4 and 𝑠2 = 2 here. The complete starting basic feasible solution can be immediately read from
Table 9.2 as: 𝑠1 = 4 , 𝑠2 = 2, 𝑥1 = 0, 𝑥2 = 0 , and the value of the objective function is zero.
𝑐𝑗 3 2 0 0
Basic 𝑐𝐵 𝑥𝐵 𝑥1 𝑥2 𝑥3 (𝑠1 ) 𝑥4 (𝑠2 ) MIN RATIO
Variables 𝑥𝐵 / 𝑥𝐾 for 𝑥𝐾
( 𝐵1 ) ( 𝐵2 ) >0
BASIS
𝑠1 0 MATRIX 1 0
4 1 1 To BE COMPUTD
IN NEXT STEP
0 1
𝑠2
1
0 1 -1 1
2
𝑍 = 𝑐𝐵 𝑥𝐵 ∆1 = −3 ∆2 = −2 ∆3 = ∆𝐽 = 𝑧𝐽 − 𝑐𝑗
0 ∆4 = 0 = 𝑐𝐵 𝑥𝑗 − 𝑐𝑗
Step 5. Now, proceed to test the basic feasible solution for optimality by the rules given below. This is
done by computing the ‘net evaluation’ ∆𝐽 for each variable 𝑥𝑗 (column vector 𝑥𝑗 ) by the formula
∆𝐽 = 𝑧𝐽 − 𝑐𝑗 = 𝑐𝐵 𝑥𝑗 − 𝑐𝑗
Thus, we get
∆1 = 𝑐𝐵 𝑥1 – 𝑐𝑗 ∆2 = 𝑐𝐵 𝑥2 − 𝑐2 ∆3 = 𝑐𝐵 𝑥3 − 𝑐3 ∆4 = 0
=– 3 = –2 =0
Optimality Test:
(i) If all Δj (= 𝑧𝐽 − 𝑐𝑗 )≥ 0, the solution under the test will be optimal. Alternative optimal
solution will exist if any non-basic Δj is also zero.
(ii) If at least one Δj is negative, the solution under test is not optimal, then proceed to improve
the solution in the next step.
(iii) If corresponding to any negative Δj, all elements of the column Xj are negative or zero, then
the solution under test will be unbounded.
Applying these rules for testing the optimality of starting basic feasible solution, it is
observed that ∆1 and ∆2 both are negative. Hence, we have to proceed to improve this
solution in Step 6.
Step 6. In order to improve this basic feasible solution, the vector entering the basic matrix and the
vector to be removed from the basic matrix are determined by the following rules. Such vectors are
usually named as ‘incoming vector’ and ‘outgoing vector’ respectively.
‘Incoming vector’. The incoming vector 𝑥𝑘 is always selected corresponding to the most negative
value of Δj (say,∆𝑘 ). Here ∆𝑘 = min[∆1 , ∆2]= min [–3, –2]= –3=∆1. Therefore, k=1 and hence column
vector x1 must enter the basic matrix. The column x1 is marked by an upward arrow ( ).
‘Outgoing Vector’. The outgoing vector βr is selected corresponding to the minimum ration of
elements of 𝑥𝐵 by the corresponding positive elements of predetermined incoming vector 𝑥𝑘 . This rule
is called the Minimum Ration Rule. In mathematical form, this rule can be written as
𝑥𝐵𝑟 𝑥𝐵𝑟
= min i [ ,𝑥 ≥ 0 ]
𝑥𝑟𝑘 𝑥𝑖𝑘 𝑖𝑘
xBr x x 4 2
For k=1, = min [ xB1 , xB2 ] = min [1 , 1]
xr1 11 21
xBr 2 xB2
Or =1= .
xr1 x21
Comparing both sides of this equation, we get r=2. So the vector β2 i.e.,𝑥4 marked with downward
arrow ( ) should be removed from the basic matrix. The Starting Table 9.2 is now modified to Table
9.3 given below.
𝑐𝑗 3 2 0 0
Basic 𝑐𝐵 𝑥𝐵 𝑥1 𝑥2 𝑥3 (𝑠1 ) 𝑥4 (𝑠2 ) MIN.
Variables (β1 ) ( β2 ) RATIO
𝑥𝐵 / 𝑥1
𝑆1 0 1 1 1 4/1
4 0
𝑆2 --------------2/1
0 1 -------------1------------------0----------- MIN. RATIO
2 -------1----
𝑍 = 𝑐𝐵 𝑥𝐵 =0 −3 ∆𝐽 = 𝑧𝐽 − 𝑐𝑗
−2 0 0 = 𝑐𝐵 𝑥𝑗 − 𝑐𝑗
(MIN.∆𝐽 )
0 1
Step 7. In order to bring β2 = [ ] in place of incoming vector x1 = [ ], unity must occupy in the
1 1
marked ‘ ’ position and zero at all other places of x1 . IF the number in the marked ‘ ’ position is
other than unity, divide all elements of that row by ‘key element’. (The element at the intersection of
minimum ratio arrow ( ) and incoming vector arrow ( ) is called the key element of pivot element).
Then, subtract appropriate multiplies of this new row from the other (remaining) rows, so as to obtain
zeros in the remaining positions of the column 𝑥1 . Thus, the process can be fortified by simple matrix
transformation as follows:
𝑋𝐵 𝑋1 𝑋2 𝑋3 𝑋4
𝑅1 4 1 1 1 0
𝑅2 2 1 –1 0 1
𝑅3 𝑧 = 0 –3 –2 0 0
Applying 𝑅2 𝑅2 + 𝑅1 , 𝑅3 𝑅3 + 5𝑅1
1 0 1 ½ −½
3 1 0 ½ ½
𝑍 = 11 0 0 5/2 ½
Table 9.4
𝑐𝑗 3 2 0 0
Basic 𝑐𝐵 𝑥𝐵 𝑥1 𝑥2 𝑥3 (𝑠1 ) 𝑥4 (𝑠2 ) MIN.
Variables ( β2 ) (β1 ) RATIO
𝑥𝐵
/ 𝑥2 , 𝑥2 > 0
𝑆1 0 0 2 1 2/2
2 −1 key row
𝑆2
3 1 −1 0 2/−1 (negative
2 1 ration is not
eounted
𝑍 = 𝑐𝐵 𝑥𝐵 =6 0 − ∆𝐽
5 0 3
Key column
From this tables, the improved basic feasible solution is read as: 𝑥1 = 2, 𝑥2 = 2, 𝑥2 = 0, 𝑠1 = 2, 𝑠2 =
0. The improved value of 𝑧 = 6.
It is of particular interest to note here that Δj’s are also computed while transforming the table by matrix
method. However, the correctness of Δj’s can be verified by computing them independently by using the
formula Δj= 𝑐𝐵 𝑥𝑗 − 𝑐𝑗 .
Step 8. Now repeat Steps 5 through 7 as and when needed until as optimum solution is obtained in
table 3.5
Therefore, k=2 and hence 𝑥2 should be the entering vector (key column). By minimum ratio rule:
𝑥 2
Minimum Ratio( 𝑥𝐵 , 𝑥2 > 0)= Min [2 , −] (since negative ratio is not counted, so the second ratio is not
2
Since first ratio is minimum, remove the first vector β1 from the basis matrix. Hence the key element is
2. Dividing the first row by key element 2, the intermediate coefficient matrix is obtained as:
𝑥𝐵 𝑥1 𝑥2 𝑥3 𝑥4
𝑅1 1 0 1 ½ −½
𝑅2 2 1 −1 0 1
𝑅3 𝑍 =6 0 −5 0 3
Applying 𝑅2 𝑅2 + 𝑅1 , 𝑅3 𝑅3 + 5𝑅1
1 0 1 ½ −½
3 1 0 ½ ½
𝑍 = 11 0 0 5/2 ½
𝑐𝑗 3 2 0 0
𝑥2 2 1 0 1 ½
−½
𝑥1 3 3
1 0 ½
½
𝑍 = 𝑐𝐵 𝑥𝐵 =11 0 0 5/2
½
The solution as read from this is : 𝑥1 = 3, 𝑥2 = 1, 𝑠1 = 0, 𝑠2 = 0, and max. 𝑍 = 11. Also, using the
formula ∆𝑗 = 𝑐𝐵 𝑥𝑗 − 𝑐𝑗 verify that all ∆𝑗 are non − negative. Hence the optimum solution is
𝑥1 = 3, 𝑥2 = 1, max 𝑧 = 11.
1. In the first nitration only, since ∆𝑗 ′s are the same as 𝑐𝑗 ′s, so there is no need of calculating them
separately by using the formula ∆𝑗 = 𝑐𝐵 𝑥𝑗 − 𝑐𝑗 .
2. Mark min (∆𝑗 ) by ‘ ’ which at once indicates the column 𝑥𝑘 needed for computing the
minimum ratio ( 𝑥𝐵 / 𝑥𝑘 ).
3. ‘Key element’ is found at the place where the upward directed arrow ‘ ’ of min ∆𝑗 and the left
directed arrow ( ) of minimum ratio ( 𝑥𝐵 / 𝑥𝑘 ) intersect each other in the siplex table.
4. ‘Key element’ indicates that the current table must be transformed in such a way that the key
element becomes 1 and all other elements in that column become 0.
5. Since ∆𝑗 ′s corresponding to unit column vectors are always zero, there is no need of calculating
them.
6. While transforming the table by row operations, the value of z and corresponding are ∆𝑗′ s also
computed at the same time. Thus a lot of time and labour can be saved in adopting this
technique.
We add the slack variables s1 ≥ 0 on the left hand side of above inequality to obtain the
equation:
2𝑥1 + 3𝑥2 + s1 = 12
Where 𝑠1 ≥ 0.
2. Surplus Variable. For the constraints having sign ≥ while the right hand side of the
constraint is positive, we have to subtract something non-negative from its left hand side.
Thus the non- negative variable which is subtracted from the left hand side of the
constraint to convert it into equation is called the surplus variable.
𝑥1 + 2𝑥2 ≥ 7.
We subtract the surplus variables s2 ≥ 0 from the left hand side of above inequality to obtain the
equation.
𝑥1 + 2𝑥2 − s2 =7
Where 𝑠2 ≥ 0.
3. Artificial Variable. Artificial Variable is used in the constraints having sign either ‘ = ‘
or ‘≥ ′ while keeping the right hand side of the constraint positive. For the constraints
having sign ‘ = ‘ i.e. equations, only artificial variable is added to the left hand side;
whereas for the constraints having sign ‘ ≥ ‘, both the surplus and the artificial variables
are used to make the constraint an equation. Artificial variable is used in Two- Phase
Method (Artificial Variable Method) and Big- M Method (Charne’s Penalty Method)
both of which are variants of Simple Simplex Method. Hence artificial variable is a non-
negative variable which is added to the left hand side of the constraints having sign ‘ = ‘
or ‘≥ ′.
If the right hand side of the constraint is negative, first convert it into positive by multiplying both
sides by -1 and then introduce slack, surplus or artificial variables. For example, in the
constraint 3𝑥1 − 2𝑥2 ≤ −12, the right hand side can be made positive by multiplying both sides by
-1. Thus we get −3𝑥1 + 2𝑥2 ≥ 12, now we can introduce surplus and artificial variables in it.
The two phase simplex method is used to solve a given problem in which some artificial variables are
involved. The solution is obtained in two phases as follows:
Phase 1. In this phase, the simplex method is applied to a specially constructed auxiliary linear
programming problem leading to a final simplex table containing a basic feasible solution to the original
problem.
Step 1. Assign a cost-1 to each artificial variable and a cost 0 to all other variables (in place of
their original cost) in the objective function.
Step 2. Construct the auxiliary linear programming problem in which the new objective
function z* is to be maximized subject to the given set of constraints.
Step 3. Solve the auxiliary problem by simplex method until either of the following three
possibilities do arise:
(i) Max z* < 0 and at least one artificial vector appear in the optimum basis at a
positive level. In this case given problem does not possess any feasible
solution.
(ii) Max z*=0 and at least one artificial vector appears in the optimum basis at zero
level. In this case proceed to Phase-II.
(iii) Max z*=0 and no artificial vector appears in the optimum basis. In this case also
proceed to Phase-II.
Phase II. Now assign the actual costs to the variables in the objective function and a zero cost to every
artificial variable that appears in the basis at the zero level. This new objective function is now
maximized by simplex method subject to the given constraints. That is, simplex method is applied to the
modified simplex table obtained at the end of Phase-I, until an optimum basic feasible solution (if
exists) has been attained. The artificial variables which are non-basic at the end of Phase-I are removed.
Phase- I
Max z* < 0
and artificial
Proceed to vector (s) at Proceed to
Phase- II +ve level Phase- II
No Feasible
Solution
M
Fig. 9.8.1 Flowchart for Phase-I
PHASE -11
PHASE-II
2 𝑥1 + 𝑥2 ≥ 4, 𝑥1 + 7𝑥2 ≥ 7, 𝑎𝑛𝑑 𝑥1 , 𝑥2 ≥ 0.
Solution. First convert the problem of minimization to maximization by writing the objective function
as :
Since all 𝑏𝑖 ′s (4 and 7) are positive , the ‘surplus variables’ 𝑥3 ≥ 0 and 𝑥4 ≥ 0 are introduced,
then constraints become:
2 𝑥1 + 𝑥2 − 𝑥3 =4
𝑥1 + 7𝑥2 −𝑥4 =7
But the basis matrix B would not be an identity matrix due to negative coefficients of 𝑥3 and 𝑥4.
Hence the starting basic feasible solution cannot be obtained.
On the other hand, if so-called ‘artificial variables’ 𝑎1 ≥ 0 and 𝑎2 ≥ 0 are introduced, the constraints
equations can be written as
2 𝑥1 + 𝑥2 − 𝑥3 +𝑎1 =4
It should be noted that 𝑎1 <𝑥3 , 𝑎2 < 𝑥4 , otherwise the constraints of the problem will not hold.
Phase I. Construct the first table (Table 9.8.1) where 𝐴1 and 𝐴2 denote the artificial column-vectors
corresponding to 𝑎1 and 𝑎2 respectively.
Table 9.9.1
BASIC 𝑥𝐵 𝑥1 𝑥2 𝑥3 𝑥4 𝐴1 𝐴2
VARIABLES
𝑎1 4 2 1 −1 0 1 0
𝑎2 7 1 7 0 −1 0 1
× ×
Now remove each artificial column vector 𝐴1 and 𝐴2 from the basis matrix. To remove vector 𝐴2 first,
select the vector either 𝐴1 or 𝐴2 , being careful to choose any one that will yield a non-negative revised
solution. Take the vector 𝑥2 to enter the basis matrix. It can be easily verified that if the vector 𝐴2 is
entered is place of 𝑥1 , the resulting solution will not be feasible. Thus transformed table (Table 9.8.2)
is obtained.
Table 9.9.2
BASIC 𝑥𝐵 𝑥1 𝑥2 𝑥3 𝑥4 𝐴1 𝐴2
VARIABLES
Similarly, remove 𝐴1 from the basis matrix by introducing it in place of 𝑥4 by the same method. Thus
Table 9.8.3 is obtained.
Table 9.9.3
BASIC 𝑥𝐵 𝑥1 𝑥2 𝑥3 𝑥4 𝐴1
VARIABLES
𝑥4 21 13 0 −7 1 7
𝑥2 4 4 1 −1 0 1
This table give the solution: 𝑥1 = 0, 𝑥2 = 4, 𝑥3 = 0, 𝑥4 = 21, 𝑎1 = 0. Since the artificial variable
𝑎1 become zero (non-basic), so drop the corresponding column 𝐴1 from this table. Thus, the solution
( 𝑥1 = 0, 𝑥2 = 4, 𝑥3 = 0, 𝑥4 = 21) is the basic feasible solution and now usual simplex routine can be
started to obtained the required optimal solution.
Phase II. Now in order to test the starting solution for optimality, construct the starting simplex
Table 9.8.4
Table 9.9.4
𝑐𝑗 − 1 −1 0 0
BASIC 𝑐𝐵 𝑥𝐵 𝑥1 𝑥2 𝑥3 𝑥4 MIN.
VARIABL RATIO
ES (𝑥𝐵 / 𝑥1 )
𝑥4 0 13 0 −7 21/13
𝑥2 21 1 4/2
−1 4 2 1 −1
0
z ′ = 𝐶B 𝑋𝐵 −1 0 1 ∆𝑗
= −4 0
Compute ∆1 = −1, ∆3 = 1.
Key element 13 indicated that 𝑥4 should be removed from the basis matrix. Thus, by usual
transformation method Table 9.8.5 is formed.
Table 9.9.5
𝑐𝑗 -1 −1 0 0
BASIC 𝑐𝐵 𝑥𝐵 𝑥1 𝑥2 𝑥3 𝑥4 MIN. RATIO
VARIABLE COLUMN
S
𝑥1 −1 1 0 −7/13
𝑥2 21/13 1/13
−1 0 1 1/13
10/13 −2/13
z ′ = 31/13 0 0 6/13 ∆𝑗 ≥0
1/13
7 1 6
∆𝑗 = 𝐶𝐵 + 𝑋3 − 𝐶3 = (−1, −1) (− , )=
13 13 13
1 1
∆𝑗 = 𝐶𝐵 + 𝑋4 − 𝐶4 = (−1, −1) ( , −2/13) = .
13 13
21 10 31
𝑥1 = , 𝑥2 = and min. z = (because z = z ′ ).
13 13 13
2 1 −1 ×
0
Thus, initial basic feasible solution is : 𝑥1 = 0, 𝑥2 = 4, 𝑥3 = 0, 𝑥4 = 21. Now start to improve this
solution Phase II by usual simplex method.
Note.
1. Remove the artificial vector 𝐴2 and insert it anywhere such that 𝑥𝐵 remains feasible (≥0).
3. Similar process is adopted to remove other artificial vectors one by one from the basis.
4. Purpose of introducing artificial vectors is only to provide an initial basic feasible solution to
start with simplex method in Phase II. So, as soon as the artificial variables become non-basic
(i.e. zero), delete artificial vectors to enter Phase II.
5. Then, start Phase II, which is exactly the same as original simplex method.
2/13
z′ 0 0 6/13 ∆𝑗 ≥0
= −31/13 1/13
21 10
Thus, the desired solution is obtained as : 𝑥1 = 13 , 𝑥2 = 13 , max. z = 31/13.
Example 2. Use two-phase simplex method to solve the problem: Minimize 𝑧 = 𝑥1 − 2𝑥2 − 3𝑥3 ,
subject to the constraints:
Introducing the artificial variables 𝑎1 ≥ 0 and 𝑎2 ≥ 0, the constraints of the given problem become,
−2𝑥1 + 𝑥2 + 3𝑥3 + 𝑎1 =2
𝑥1 , 𝑥2 , 𝑥3 , 𝑎1 , 𝑎2 ≥ 0.
Phase I. Auxiliary L.P. problem is : Max.z ′ ∗= 0𝑥1 + 0𝑥2 + 0𝑥3 − 1𝑎1 − 1𝑎2 subject to above given
constraints.
Table 9.9.8
𝑐𝑗 0 0 0 −1−1
BASIC 𝑐𝐵 𝑥𝐵 𝑥1 𝑥2 𝑥3 𝐴1 𝐴2 MIN. RATIO
VARIABLES 𝑥𝐵 / 𝑥𝑘
𝑎1 −1 −2 1 3 1 2/3
𝑎2 2 0 1/4
−1
1 2 3 4 0
1
z ′ ∗= 3 0 −4 −7* 0 ∆𝑗
0
𝑎1 −1 − 7/2 − 5/4 0 1
𝑥3 5/4 − 3/4
0
1/4 1/2 3/4 1 0
1/4
z ′ ∗= −5/4 7/4 5/4 0 0 ∆𝑗 ≥0
3/4
Since all ∆𝑗 ≥0, an optimum basic feasible solution to the auxiliary L.P.P. has been attained. But at the
same time max. z ′ ∗ is negative and the artificial variable 𝑎1 appears in the basic solution at a positve
level. Hence the original problem does not possess any feasible solution. Here there is no need to enter
Phase II.
3 𝑥1 − 𝑥2 − 𝑥3 ≥ 3, 𝑥1 − 𝑥2 + 𝑥3 ≥ 2, , and 𝑥1 , 𝑥2 , 𝑥3 ≥ 0.
15
Solution. Converty the objective function into the maximization form: maximize. 𝑧′ = − 𝑥1 +
2
3𝑥2 .
3 𝑥1 − 𝑥2 − 𝑥3 − 𝑥4 + 𝑎1 =3
𝑥1 − 𝑥2 + 𝑥3 − 𝑥5 + 𝑎5 = 2
𝑥1 , 𝑥2 , 𝑥3 , 𝑥4 , 𝑎1 , 𝑎2 ≥ 0.
Phase I. Assigning a cost −1 to artificial varibales 𝑎1 and 𝑎2 and cost 0 to all other variables, the new
objective function for auxiliary probelem becomes:
𝑀𝑎𝑥. 𝑧 ′ ∗= 0 𝑥1 + 0𝑥2 + 0𝑥3 + 0𝑥4 + 0𝑥5 − 1𝑎1 − 1𝑎2 , Subject to the above given constraints.
𝑐𝑗 0 0 0 0 0−1 −1
BASIC 𝑐𝐵 𝑥𝐵 𝑥1 𝑥2 𝑥3 𝑥4 𝑥5 𝐴1 𝐴2 MIN. RATIO
VARIABLE 𝑥𝐵 / 𝑥𝑘
S
𝑎1 −1 3 −1 −1 −1 1 0 3/3
𝑎2 3 0 0 2/1
−1 1
2 1 −1 1 0
−1
z ′ ∗= −5 −4* 2 0 1 0 ∆𝑗
1 0
𝑥1 0 1 1 − 1/3 − 1/3 − 1/3 1/3 0 ----
𝑎2 −1 0 1/3 1 ¾
1
0 − 2/3 4/ 3 1/3
−1
′ − 4/3 *
z ∗= −1 0 2/3 1/3 2/3 0 ∆𝑗
−1
𝑥1 0 5/4 1 − 1/2 0 − 1/4 ¼ ¼
𝑥3 0 −¼ ¼ ¾
3/4 0 − 1/2 1 1/4
− 3/4
z ′ ∗= 0 0 0 0 0 1 1 ∆𝑗 ≥0
0
Since all ∆𝑗 ≥0 and no artificial variable appears in the basis, an optimum solution to the auxiliary
problem has been atained.
Phase 2. In theis phase, now consider the actual costs associate with the original variables, the
objective function thus becomes: 𝑀𝑎𝑥. 𝑧 ′ = −15/2 𝑥1 + 3𝑥2 + 0𝑥3 + 0𝑥4 + 0𝑥5
𝑐𝑗 − 15/2 3 0 0 0
BASIC 𝑐𝐵 𝑥𝐵 𝑥1 𝑥2 𝑥3 𝑥4 𝑥5 MIN. RATIO
VARIABLE 𝑥𝐵 / 𝑥𝑘
S
𝑥1 −15/2 1 −1/2 0 −1/4−1/4
𝑥3 5/4
0 0 −1/2 1 1/4
3/4 −3/4
. z ′ = −75/8 0 3/4 0 15/8 ∆𝑗
15/8
Since all ∆𝑗 ≥ 0, an optimum basic feasibe solution has been attained.
5 3
Hence optimum solution is : 𝑥1 = , 𝑥2 = 0, 𝑥3 = , min z = 75/8.
4 4
Solution. Introducing artificial variables 𝑎1 and 𝑎2 in the first and second constraint equations,
respectively, and the original variable 𝑥4 can be treated to work as an artificial variable for third
constraint equation to obtain:
𝑥1 + 2𝑥2 + 3𝑥3 + 𝑎1 = 15
2𝑥1 + 𝑥2 + 5𝑥3 + 𝑎2 = 20
𝑥1 + 2𝑥2 + 𝑥3 + 𝑥4 = 10
1
1 2 1 1 0
0
By the same arguments as given in the previous examples of two-phase method insert 𝑥4 in place of 𝑥1 .
The transformed table (Table 9.9.12) is obtained by applying row transformation
𝑅1 𝑅1 − 𝑅3 , 𝑅2 𝑅2 − 2𝑅3 .
Table 9.9.12
BASIC 𝑥𝐵 𝑥1 𝑥2 𝑥3 𝑥4 𝐴1 𝐴2
VARIABLES
𝑎1 5 0 0 2 −1 1
𝑎2 0 0
𝑥1 10 0 −3 3 −2 0
1
1 2 1 1 0
0
In spite of the fact that the artificial variable 𝑥4 has served its puropse, the coloumn 𝑥4 cannot be
deleted from Table 4.12 because 𝑥4 is the original variable also. Although the value of the artificial
variable 𝑎2 also becomes zero at this stage, the coloumn 𝐴2 cannot be deleted unless it is inserted at one
of the places 𝑥2 or 𝑥3 or 𝑥4 . Now it is observed that 𝐴2 can be inserted in place of 𝑥3 . Hence
1
transformation Table 9.9.13 is obtained by applying the row transformations:𝑅2 3 𝑅2 , 𝑅1 𝑅1 −
2 1
𝑅2 , 𝑅3 𝑅3 − 3 𝑅2 .
3
Table 9.9.13
BASIC 𝑥𝐵 𝑥1 𝑥2 𝑥3 𝑥4 𝐴1 𝐴2
VARIABLES
𝑎1 5 0 2 0 1/3 1
−2/3
𝑥3 0
10 0 −1 1 −2/3 0
𝑥1
1/3
1 3 0 5/3 0
−4/3
Now removing 𝐴1 and inserting it in the suitable position of 𝑥2 , the next transformed Table 9.8.14 is
obtained by row transformations:
1 1 3
𝑅1 2 𝑅1 , 𝑅2 𝑅2 + 2 𝑅1 , 𝑅3 𝑅3 − 2 𝑅1.
Table 9.9.14
BASIC 𝑥𝐵 𝑥1 𝑥2 𝑥3 𝑥4 𝐴1
VARIABLES
𝑥2 5/2 0 1 0 1/6
1/2
𝑥3 5/2
0 0 1 −1/2
𝑥1 5/2
1/2
1 0 0 7/6
−3/2
5
Delete column 𝐴1 (𝑎1 = 0). The starting basic feasible solutin is obtianed:𝑥1 = 𝑥2 = 𝑥3 = 2 , 𝑥4 = 0.
Further, proceed to test this solution for optimality in Phase II. For this, compute
1 1 7
∆4 = 𝑐𝐵 𝑥4 − 𝑐4 = (2, 3, 1) ( , − , ) − 0 = 0.
6 2 6
5/2 7/6
𝑧 = 𝑐𝐵 𝑥𝐵 0 0 0 ∆𝑗
= 15 0*
5
Since all ∆𝑗 ′s are zero, the solution: 𝑥1 = 𝑥2 = 𝑥3 = 2 , 𝑥4 = 0 , is optimal to give us z ∗= 15. Further,
being zero indicates that alternative optimal solutions are also possible.
Note. Here ∆𝑗 corresponding to non basic vector 𝑥4 also become zero. This indicates that alternative
optimum solutions are possible. However, the other optimal solutions can be obtained as: 𝑥1 = 0, 𝑥2 =
15 25
, 𝑥3 = , 𝑥4 = 0, max. z = 15.
7 7
An infinite number of non-basic solutions can be obtained and by realizing them any weighted average
of these two basic solutions is also an alternative optimum solution.
5/2 +15/7
𝑥2 = = 65/28
2
5/2+25/7
𝑥3 = = 85/28
2
0+0
𝑥4 = =0
2
and max. z = 15
At the stage of improving the solution, during simplex procedure, minimum ratio 𝑥𝐵 /𝑥𝑘 (𝑥𝑘 > 0) is
determined in the last column of simplex table to find the key row (i.e.a row containing the key
element). But sometimes this ratio may not be unique, i.e., the key element (here the variable to leave
the basis) is not uniquely determined or at the very first iteration, the value of one or more basic
variables in the 𝑥𝐵 column become equal to zero, this causes the problem of degeneracy.
However, if the minimum ratio is zero for two or more basic variables, degeneracy may result the
simple routine to cycle indefinitely. That is, the solution which we have obtained in one iteration may
repeat again after few iterations and therefore no optimum solution may be obtained under such
circumstances. Fortunately, such phenomenon very rately occurs in practical problems.
The following systematic procedure can be utilized to avoid cycling due to degeneracy in L.P.
problems.
Step 1. First pick up the rows for which the min. non-negative ratio is same. To be definite,
suppose such rows are first, third, etc., for example.
Step 2. Now rearrange the columns of the usual simplex table so that the column forming the
original unit matrix come first in proper order.
Only if the rows for which min. ratio was not unique. That is, for the rows first, third, etc. as
picked up in step1 (key column is the one for which ∆𝑗 is minimum.)
(i) If this minimum is attained for third row (say), then this row will determine the
key element by intersecting the key column.
Only for the rows for which min. ratio was not unique in Step 3.
(i) If this min. ratio in unique for the first row (say), then this row will determine the key
element by intersecting the key column.
Onlyfor the rows for which min. ratio was not unique in Step 4.
(i) If this min. ratio is unique for the third row (say), then this row will determine the key
element by intersecting the key column.
(ii) If this min. is still not unique, then go on repearting the above outlined procedure till the
unique min. ratio is obtianed to resolve the degeneracy. After the resolution of this tie,
simplex method is applied to obtain the optimum solution. Following example will
make the procedure clear.
𝑥1 + 4𝑥2 + 𝑠1 =8
𝑥1 + 2𝑥2 + 𝑠2 = 4
𝑥1 , 𝑥2 , 𝑠1 , 𝑠2 ≥ 0.
Table 9.10.1
𝑐𝑗 3 9 0 0
BASIC 𝑐𝐵 𝑥𝐵 𝑥1 𝑥2 𝑠1 𝑠2 MIN. RATIO
VARIABLE (𝑥𝐵 / 𝑥𝑘 )
S
𝑠1 0 8 1 4 1 8
=2
𝑠2 0 0 {44 }Tie
4 = 2
2
1 2 0
1
z=0 −3 − 9 0 ∆𝑗
0
Since min. ration 2 in the last column of above table is not unique, both the slack variables 𝑠1 and 𝑠2
may leave the basis. This is an indication for the existence of degeneracy in the given L.P. problem. So
we apply the above outlined procedure to resolve degeneracy (tie).
First arrange the column 𝑥1 , 𝑥2 , 𝑠1 and𝑠2 in such a way that the initial identity (basis) matrix appears
first. Thus the initial simplex table becomes:
Table 9.10.2
𝑐𝑗 0 0 3 9
𝑠1 0 8 1 0 1 ¼
4
𝑠2 0 0/2
4
0 1 1
2
z=0 0 0 −3 ∆𝑗 ≥0
− 9
Now using the step 3 of the procedure for resolving degeneracy, we find
which occurs for the second row. Hence 𝑠2 must leave the basis, and the key element is 2 as shown
above.
Table 9.10.l3
𝑐𝑗 0 0 3 9
BASIC 𝑐𝐵 𝑥𝐵 𝑠1 𝑠2 𝑥1 𝑥2 MIN. RATIO
VARIABLE
S
𝑠1 0 0 1 −2 −1
𝑥2 9 0
2
0 ½ ½
1
z = 18 0 9/2 3/2 ∆𝑗 ≥0
0
Since all ∆𝑗 ≥ 0, an optimum solution has been reached. Hence the optimum basic feasible solution is:
𝑥1 = 0, 𝑥2 = 2, max. z = 18.
Maximize Z=3X1+5X2+4X3
2X1+3X2 ≤ 8
2X2+5X3 ≤ 10
3X1+2X2 +4X3≤ 15
Maximize Z=4X1+3X2
2X1+X2 ≤ 1000
X1+X2 ≤ 800
X1≤ 400
X2≤ 700
And X1, X2 ≥ 0
Maximize Z=6X1+4X2
2X1+3X2 ≤ 30
3X1+2X2 ≤ 24
X1+X2 ≥ 3
And X1, X2 ≥ 0
Minimize Z=X1+X2
2X1+4X2 ≥ 4
X1+7X2 ≥ 7
And X1, X2 ≥ 0
Minimize Z=3X1+5X2
2X1+8X2 ≥ 40
3X1+4X2 ≥ 50
And X1, X2 ≥ 0
Minimize Z=5X1+8X2
3X1+2X2 ≥ 3
X1+4X2 ≥ 4
X1+X2 ≤ 5
And X1, X2 ≥ 0
9.12 SUMMARY
Simplex Method:-The LPPs involving more than two decision variables cannot be solved using
graphical method because solving the problem using graphical method involves drawing graph in
the plane and a graph in two dimensional plane can be drawn for the equations/ inequa lities
having only upto two variables. The LPPs having more than two decision variables can be solved
using Simplex Method. The Simplex algorithm is an iterative (step-by-step) procedure for solving LP
problems. It consists of:-
(iii) improving the first trial solution by a set of rules, and repeating the process till an optimal
solution is obtained.
Simplex Method is also called Simple Simplex Method. Like Graphical Method, Simplex Method
can also be used for solving LPPs having two decision variables but it can solve only the LPPs
having all inequalities of type ( ≤ ) and RHS of constraints all positive.
Two Phase Simplex Method:-The LPPs, in which constraints have the sign ‘ =’ or ‘≥’ while
keeping the right hand side constants positive, cannot be solved using Simple Simplex Method. To
solve such problems, a variant of Simplex Method called the Two- Phase Method or the Artificial
Method is used. Like Simple Simplex Method, Two- Phase Simplex Method can be used to solve LPPs
having any number of decision variables. First of all objective function is converted into
maximization form, if any. The right hand side of the constraints should be positive. If the rig ht
hand side of the constraint is not positive, it can be converted to positive value by multiplying
both sides by −1. The sign ‘≤’ becomes ‘≥’ and the sign ‘≥’ becomes ‘≤’ . The sign ‘ = ’ does not
change in this process. Slack, surplus and artificial variables are used accordingly. Now Two- Phase
Simplex method can be applied on this standard form. In Phase-I, an auxiliary LPP is constructed by
assigning a cost −1 to artificial variables and zero cost to every other variables in the objective
function. Now this auxiliary LPP is solved using Simple Simplex Method until one of the three
possibilities arise- i) if Max z* < 0 and at least one artificial vector appear in the optimum basis at a
positive level. In this case given problem does not possess any feasible solution; ii) if Max z*=0 and
at least one artificial vector appears in the optimum basis at zero level. In this case proceed to Phase-II;
and also iii) if Max z*=0 and no artificial vector appears in the optimum basis. In this case also proceed
to Phase-II.
In Phase- II, we assign the actual costs to the variables in the objective function and a zero cost to every
artificial variable that appears in the basis at the zero level. This new objective function is now
maximized by simplex method subject to the given constraints. That is, simplex method is applied to the
modified simplex table obtained at the end of Phase-I, until an optimum basic feasible solution (if
exists) has been attained. The artificial variables which are non-basic at the end of Phase-I are removed.
9.13 KEYWORDS
optimal solution to the linear programming problem. In other words, the S IMP LE X A LGOR I TH M is an
iterative procedure carried systematically to determine the optimal solution from the set of feasible
solutions.A standard method of maximizing a linear function of several variables under several
constraints on other linear functions.
1. Bring the constraints into equality form. For each constraint in which the slack variable and the right-
hand side have opposite signs, or in which there is no slack variable, add a new artificial variable that
has the same sign as the right-hand side.
2. Phase I: minimize the sum of the artificial variables, starting from the BFS where the absolute value
of the artificial variable for each constraint, or of the slack variable in case there is no artificial variable,
is equal to that of the right-hand side.
3. If some artificial variable has a positive value in the optimal solution, the original problem is
infeasible; stop.
4. Phase II: solve the original problem, starting from the BFS found in phase I.
4𝑥1 + 𝑥2 ≤ 8,
4𝑥1 − 𝑥2 ≤ 8
and 𝑥1 , 𝑥2 ≥ 0.
and 𝑥1 , 𝑥2 ≥ 0.
and 𝑥1 , 𝑥2 ≥ 0.
𝑥1 + 𝑥2 ≤ 4,
10𝑥1 + 7𝑥2 ≤ 35
and 𝑥1 , 𝑥2 ≥ 0.
2𝑥1 + 𝑥2 ≤ 40,
𝑥1 + 𝑥2 ≤ 24,
2𝑥1 + 3𝑥2 ≤ 60
and 𝑥1 , 𝑥2 ≥ 0.
𝑥1 + 𝑥2 ≥ 3
and 𝑥1 , 𝑥2 ≥ 0.
𝑥1 + 2𝑥2 + 𝑥3 + 𝑥4 = 10,
and 𝑥1 , 𝑥2 , 𝑥3 , 𝑥4 ≥ 0.
𝑥1 − 𝑥2 ≤ 10,
2𝑥1 − 𝑥2 ≤ 40
and 𝑥1 ≥ 0, 𝑥2 ≥ 0.
1
16𝑥1 + 𝑥2 − 6𝑥3 ≤ 5,
2
3𝑥1 − 𝑥2 − 𝑥3 ≤ 0,
and 𝑥1 , 𝑥2 , 𝑥3 ≥ 0.
2𝑥1 − 𝑥2 ≤ 2,
𝑥1 ≤ 4,
and 𝑥1 , 𝑥2 ≥ 0.
2𝑥1 + 𝑥2 ≤ 2,
and 𝑥1 , 𝑥2 ≥ 0.
3𝑥1 − 4𝑥2 ≤ 3,
𝑥2 + 3𝑥3 ≤ 5
and 𝑥1 , 𝑥2 , 𝑥3 ≥ 0.
Max Z=18.6585
2. X1=200, X2=600
Max Z=2600
3. X1=8, X2=0
Max Z=48
4. X1=1.6154, X2=0.7692
Min Z=2.3846
5. X1=15, X2=1.25
Min Z=51.25
6. X1=0, X2=5
10. Operations Research- An Introduction (Eighth Edition); Hamdy A. Taha; Pearson Education,
Prentice Hall, Delhi, (2008).
11. Operations Research; A.M. Natarajan, P. Salasubramani, A. Tamilarasi; Pearson Education
(Singapore) Pvt. Ltd., Delhi, (2005).
12. Operations Research (Second Edition), Schaum’s Outlines; Richard Bronson,
GovindasamiNaadimuthu; Tata McGraw Hill Education Private Limited; New Delhi (2010)
NOTES
___________________________________________________________
___________________________________________________________
___________________________________________________________
___________________________________________________________
___________________________________________________________
___________________________________________________________
___________________________________________________________
___________________________________________________________
___________________________________________________________
___________________________________________________________
___________________________________________________________
___________________________________________________________
___________________________________________________________
___________________________________________________________
___________________________________________________________
___________________________________________________________
___________________________________________________________
NOTES
___________________________________________________________
___________________________________________________________
___________________________________________________________
___________________________________________________________
___________________________________________________________
___________________________________________________________
___________________________________________________________
___________________________________________________________
___________________________________________________________
___________________________________________________________
___________________________________________________________
___________________________________________________________
___________________________________________________________
___________________________________________________________
___________________________________________________________
___________________________________________________________
___________________________________________________________
NOTES
___________________________________________________________
___________________________________________________________
___________________________________________________________
___________________________________________________________
___________________________________________________________
___________________________________________________________
___________________________________________________________
___________________________________________________________
___________________________________________________________
___________________________________________________________
___________________________________________________________
___________________________________________________________
___________________________________________________________
___________________________________________________________
___________________________________________________________
___________________________________________________________
___________________________________________________________
NOTES
___________________________________________________________
___________________________________________________________
___________________________________________________________
___________________________________________________________
___________________________________________________________
___________________________________________________________
___________________________________________________________
___________________________________________________________
___________________________________________________________
___________________________________________________________
___________________________________________________________
___________________________________________________________
___________________________________________________________
___________________________________________________________
___________________________________________________________
___________________________________________________________
___________________________________________________________