Linear Programming: Dr.N.Sabu Department of Mathematics Indian Institute of Space Science and Technology
Linear Programming: Dr.N.Sabu Department of Mathematics Indian Institute of Space Science and Technology
Dr.N.Sabu
Department of Mathematics
Indian Institute of Space Science and Technology
10 8 30
A 7 14
B 11 12 6 40
7
5 8 15 9 30
C
Demand 20 25 35 100
20
M in : C t X; sub : AX = b, Xi ≥ 0
A furniture maker has 6 units of wood and 28 hours of free
time in a week. Two models have been sold in past so that he
wishes to restrict himself to these two. According to his
estimate model 1 requires 2 units of wood and 7 hours of time
while model 2 requires 1 unit of wood and 8 hours of time.
Prot from the model 1 and 2 are Rs:120 and Rs:80
resp.Formulate the problem to maximize the prot.
A furniture maker has 6 units of wood and 28 hours of free
time in a week. Two models have been sold in past so that he
wishes to restrict himself to these two. According to his
estimate model 1 requires 2 units of wood and 7 hours of time
while model 2 requires 1 unit of wood and 8 hours of time.
Prot from the model 1 and 2 are Rs:120 and Rs:80
resp.Formulate the problem to maximize the prot.
Let x1 and x2 denote the number of model 1 and 2 resp.
A furniture maker has 6 units of wood and 28 hours of free
time in a week. Two models have been sold in past so that he
wishes to restrict himself to these two. According to his
estimate model 1 requires 2 units of wood and 7 hours of time
while model 2 requires 1 unit of wood and 8 hours of time.
Prot from the model 1 and 2 are Rs:120 and Rs:80
resp.Formulate the problem to maximize the prot.
Let x1 and x2 denote the number of model 1 and 2 resp.
Then the problem is: Maz: z = 120x1 + 80x2
Sub: 2x1 + x2 ≤ 6, 7x1 + 8x2 ≤ 28, xi ≥ 0
A furniture maker has 6 units of wood and 28 hours of free
time in a week. Two models have been sold in past so that he
wishes to restrict himself to these two. According to his
estimate model 1 requires 2 units of wood and 7 hours of time
while model 2 requires 1 unit of wood and 8 hours of time.
Prot from the model 1 and 2 are Rs:120 and Rs:80
resp.Formulate the problem to maximize the prot.
Let x1 and x2 denote the number of model 1 and 2 resp.
Then the problem is: Maz: z = 120x1 + 80x2
Sub: 2x1 + x2 ≤ 6, 7x1 + 8x2 ≤ 28, xi ≥ 0
This is of the form
Min: C t X; sub : AX ≤ b, X i ≥ 0
120 2 1 6
where C = , A= , b=
80 7 8 28
In a hospital meals are served to patients twice a day. Each
gram of rst meal contains 10 units of protein and 20 units of
vitamins whereas each gram of second meal contains 15 units
of protein and 15 units of vitamins. In a day's meal a patient
should get 50 units of vitamin and 60 units of protein.
Determine the amount of meals to minimize the cost when
meal 1 cost RS:0.025 per gram and meal 2 cost Rs: 0.02 per
gram.
In a hospital meals are served to patients twice a day. Each
gram of rst meal contains 10 units of protein and 20 units of
vitamins whereas each gram of second meal contains 15 units
of protein and 15 units of vitamins. In a day's meal a patient
should get 50 units of vitamin and 60 units of protein.
Determine the amount of meals to minimize the cost when
meal 1 cost RS:0.025 per gram and meal 2 cost Rs: 0.02 per
gram.
Let x1 and x2 denote the number of grams of meal 1 and 2
resp.
In a hospital meals are served to patients twice a day. Each
gram of rst meal contains 10 units of protein and 20 units of
vitamins whereas each gram of second meal contains 15 units
of protein and 15 units of vitamins. In a day's meal a patient
should get 50 units of vitamin and 60 units of protein.
Determine the amount of meals to minimize the cost when
meal 1 cost RS:0.025 per gram and meal 2 cost Rs: 0.02 per
gram.
Let x1 and x2 denote the number of grams of meal 1 and 2
resp.
Then the problem is: Min: z = 0.025x1 + 0.02x2
Sub: 10x1 + 15x2 ≥ 60, 20x1 + 15x2 ≥ 50, xi ≥ 0
In a hospital meals are served to patients twice a day. Each
gram of rst meal contains 10 units of protein and 20 units of
vitamins whereas each gram of second meal contains 15 units
of protein and 15 units of vitamins. In a day's meal a patient
should get 50 units of vitamin and 60 units of protein.
Determine the amount of meals to minimize the cost when
meal 1 cost RS:0.025 per gram and meal 2 cost Rs: 0.02 per
gram.
Let x1 and x2 denote the number of grams of meal 1 and 2
resp.
Then the problem is: Min: z = 0.025x1 + 0.02x2
Sub: 10x1 + 15x2 ≥ 60, 20x1 + 15x2 ≥ 50, xi ≥ 0
This is of the form
Min: C t X; sub : AX ≥ b, Xi ≥ 0
Standard form of LPP:
Standard form of LPP:
Consider the problem
Min: z = C t X = c1 x1 + c2 x2 + ... + cn xn
Sub: AX ≤ b
i.e, a11 x1 + ... + a1n xn ≤ b1
...............................
...............................
am1 x1 + ... + amn xn ≤ bm
This is equivalent to
Min: c1 x1 + ... + cn xn + 0.y1 + 0.y2 + ... + 0.ym
This is equivalent to
Min: c1 x1 + ... + cn xn + 0.y1 + 0.y2 + ... + 0.ym
Sub: a11 x1 + ... + a1n xn + y1 = b1
...............................
...............................
am1 x1 + ... + amn xn + ym = bm
This is equivalent to
Min: c1 x1 + ... + cn xn + 0.y1 + 0.y2 + ... + 0.ym
Sub: a11 x1 + ... + a1n xn + y1 = b1
...............................
...............................
am1 x1 + ... + amn xn + ym = bm
This can be written as
Min: c1 x1 + ... + cn xn + 0.y1 + 0.y2 + ... + 0.ym
This is equivalent to
Min: c1 x1 + ... + cn xn + 0.y1 + 0.y2 + ... + 0.ym
Sub: a11 x1 + ... + a1n xn + y1 = b1
...............................
...............................
am1 x1 + ... + amn xn + ym = bm
This can be written as
Min: c1 x1 + ... + cn xn + 0.y1 + 0.y2 + ... + 0.ym
Sub: a11 x1 + ... + a1n xn + y1 + 0.y2 + ..... + 0.ym = b1
...............................
...............................
am1 x1 + ... + amn xn + 0.y1 + 0.y2 + .... + ym = bm
This is equivalent to
Min: c1 x1 + ... + cn xn + 0.y1 + 0.y2 + ... + 0.ym
Sub: a11 x1 + ... + a1n xn + y1 = b1
...............................
...............................
am1 x1 + ... + amn xn + ym = bm
This can be written as
Min: c1 x1 + ... + cn xn + 0.y1 + 0.y2 + ... + 0.ym
Sub: a11 x1 + ... + a1n xn + y1 + 0.y2 + ..... + 0.ym = b1
...............................
...............................
am1 x1 + ... + amn xn + 0.y1 + 0.y2 + .... + ym = bm
Thus the problem becomes:
Min: (C t , 0)(X, Y ),
Sub: (A, Im )(X, Y ) = b, Xi , Yi ≥ 0
This is equivalent to
Min: c1 x1 + ... + cn xn + 0.y1 + 0.y2 + ... + 0.ym
Sub: a11 x1 + ... + a1n xn + y1 = b1
...............................
...............................
am1 x1 + ... + amn xn + ym = bm
This can be written as
Min: c1 x1 + ... + cn xn + 0.y1 + 0.y2 + ... + 0.ym
Sub: a11 x1 + ... + a1n xn + y1 + 0.y2 + ..... + 0.ym = b1
...............................
...............................
am1 x1 + ... + amn xn + 0.y1 + 0.y2 + .... + ym = bm
Thus the problem becomes:
Min: (C t , 0)(X, Y ),
Sub: (A, Im )(X, Y ) = b, Xi , Yi ≥ 0
This is called the standard form of LPP. The variables yi0 s are
called slack variables.
Standard form of LPP:
Standard form of LPP:
Consider the problem
Min: z = C t X = c1 x1 + c2 x2 + ... + cn xn
Sub: AX ≥ b
i.e, a11 x1 + ... + a1n xn ≤ b1
...............................
...............................
am1 x1 + ... + amn xn ≤ bm
This is equivalent to
Min: c1 x1 + ... + cn xn + 0.y1 + 0.y2 + ... + 0.ym
This is equivalent to
Min: c1 x1 + ... + cn xn + 0.y1 + 0.y2 + ... + 0.ym
Sub: a11 x1 + ... + a1n xn − y1 = b1
...............................
...............................
am1 x1 + ... + amn xn − ym = bm
This is equivalent to
Min: c1 x1 + ... + cn xn + 0.y1 + 0.y2 + ... + 0.ym
Sub: a11 x1 + ... + a1n xn − y1 = b1
...............................
...............................
am1 x1 + ... + amn xn − ym = bm
This can be written as
Min: c1 x1 + ... + cn xn + 0.y1 + 0.y2 + ... + 0.ym
This is equivalent to
Min: c1 x1 + ... + cn xn + 0.y1 + 0.y2 + ... + 0.ym
Sub: a11 x1 + ... + a1n xn − y1 = b1
...............................
...............................
am1 x1 + ... + amn xn − ym = bm
This can be written as
Min: c1 x1 + ... + cn xn + 0.y1 + 0.y2 + ... + 0.ym
Sub: a11 x1 + ... + a1n xn − y1 − 0.y2 − ..... − 0.ym = b1
...............................
...............................
am1 x1 + ... + amn xn − 0.y1 − 0.y2 − .... − ym = bm
This is equivalent to
Min: c1 x1 + ... + cn xn + 0.y1 + 0.y2 + ... + 0.ym
Sub: a11 x1 + ... + a1n xn − y1 = b1
...............................
...............................
am1 x1 + ... + amn xn − ym = bm
This can be written as
Min: c1 x1 + ... + cn xn + 0.y1 + 0.y2 + ... + 0.ym
Sub: a11 x1 + ... + a1n xn − y1 − 0.y2 − ..... − 0.ym = b1
...............................
...............................
am1 x1 + ... + amn xn − 0.y1 − 0.y2 − .... − ym = bm
Thus the problem becomes:
Min: (C t , 0)(X, Y ),
Sub: (A, −Im )(X, Y ) = b, Xi , Yi ≥ 0
This is equivalent to
Min: c1 x1 + ... + cn xn + 0.y1 + 0.y2 + ... + 0.ym
Sub: a11 x1 + ... + a1n xn − y1 = b1
...............................
...............................
am1 x1 + ... + amn xn − ym = bm
This can be written as
Min: c1 x1 + ... + cn xn + 0.y1 + 0.y2 + ... + 0.ym
Sub: a11 x1 + ... + a1n xn − y1 − 0.y2 − ..... − 0.ym = b1
...............................
...............................
am1 x1 + ... + amn xn − 0.y1 − 0.y2 − .... − ym = bm
Thus the problem becomes:
Min: (C t , 0)(X, Y ),
Sub: (A, −Im )(X, Y ) = b, Xi , Yi ≥ 0
This is called the standard form of LPP. The variables yi0 s are
called surplus variables.
Write the following problem in standard form
Max: x2 − x1 , sub : 3x1 = x2 − 5, −2 ≤ x2 ≤ 2
Write the following problem in standard form
Max: x2 − x1 , sub : 3x1 = x2 − 5, −2 ≤ x2 ≤ 2
Solution: Min: x1 − x2
Sub: 3x1 − x2 = −5 ⇒ x2 − 3x1 = 5
−2 ≤ x2 ≤ 2 ⇒ x2 ≤ 2 and − x2 ≤ 2
⇒ x2 + x3 = 2, and − x2 + x4 = 2
Write the following problem in standard form
Max: x2 − x1 , sub : 3x1 = x2 − 5, −2 ≤ x2 ≤ 2
Solution: Min: x1 − x2
Sub: 3x1 − x2 = −5 ⇒ x2 − 3x1 = 5
−2 ≤ x2 ≤ 2 ⇒ x2 ≤ 2 and − x2 ≤ 2
⇒ x2 + x3 = 2, and − x2 + x4 = 2
Note that any real number can be written as the dierence of
two positive numbers.
Hence we take x2 = u − v, u, v > 0
Write the following problem in standard form
Max: x2 − x1 , sub : 3x1 = x2 − 5, −2 ≤ x2 ≤ 2
Solution: Min: x1 − x2
Sub: 3x1 − x2 = −5 ⇒ x2 − 3x1 = 5
−2 ≤ x2 ≤ 2 ⇒ x2 ≤ 2 and − x2 ≤ 2
⇒ x2 + x3 = 2, and − x2 + x4 = 2
Note that any real number can be written as the dierence of
two positive numbers.
Hence we take x2 = u − v, u, v > 0
Since −2 ≤ x2 ≤ 2 and 3x1 = x2 − 5, it follows that x1 ≤ 0
Let w = −x1 ≥ 0
Write the following problem in standard form
Max: x2 − x1 , sub : 3x1 = x2 − 5, −2 ≤ x2 ≤ 2
Solution: Min: x1 − x2
Sub: 3x1 − x2 = −5 ⇒ x2 − 3x1 = 5
−2 ≤ x2 ≤ 2 ⇒ x2 ≤ 2 and − x2 ≤ 2
⇒ x2 + x3 = 2, and − x2 + x4 = 2
Note that any real number can be written as the dierence of
two positive numbers.
Hence we take x2 = u − v, u, v > 0
Since −2 ≤ x2 ≤ 2 and 3x1 = x2 − 5, it follows that x1 ≤ 0
Let w = −x1 ≥ 0
Then the problem becomes
Min −w − (u − v);
Sub : 3w + u − v = 5, u − v + x3 = 2, u − v + x4 =
2, w, u, v, x3 , x4 ≥ 0
Solve the problem graphically:
Max: z = x1 + x2
Sub: 2x1 + 3x2 ≤ 6, x1 − x2 ≤ 1, x1 , x2 ≥ 0
Solve the problem graphically:
Max: z = x1 + x2
Sub: 2x1 + 3x2 ≤ 6, x1 − x2 ≤ 1, x1 , x2 ≥ 0
(0, 2)
(9/5, 4/5)
(0, 0)
(1, 0)
Solve the problem graphically:
Max: z = x1 + x2
Sub: 2x1 + 3x2 ≤ 6, x1 − x2 ≤ 1, x1 , x2 ≥ 0
(0, 2)
(9/5, 4/5)
(0, 0)
(1, 0)
The vertices of the polygonal regions are (0, 0), (1, 0), (9/5,
4/5) and (0, 2).
z(0, 0) = 0, z(1, 0) = 1, z(0, 2) = 2, z(9/5, 4/5) = 2.6.
Hence Max vale=2 is attained at (9/5, 4/5)
Solve the problem graphically:
Max: z = 2x1 + 5x2
Sub: x1 + x2 ≤ 11, 2x1 + 5x2 ≤ 40, x1 ≥ 0, x2 ≥ 4
Solve the problem graphically:
Max: z = 2x1 + 5x2
Sub: x1 + x2 ≤ 11, 2x1 + 5x2 ≤ 40, x1 ≥ 0, x2 ≥ 4
(0, 8)
(5, 6)
(0, 4)
(7,4)
(0, 0)
Solve the problem graphically:
Max: z = 2x1 + 5x2
Sub: x1 + x2 ≤ 11, 2x1 + 5x2 ≤ 40, x1 ≥ 0, x2 ≥ 4
(0, 8)
(5, 6)
(0, 4)
(7,4)
(0, 0)
The vertices of the polygonal regions are (0, 4), (7, 4), (5, 6)
and (0, 8).
z(0, 4) = 20, z(7, 4) = 34, z(5, 6) = 40, z(0, 8) = 40.
Hence Max vale=40 is attained at two points (5, 6) and (0, 8)
Solve the problem graphically:
Max: z = 2x1 + 5x2
Sub: x1 + x2 ≤ 11, 2x1 + 5x2 ≤ 40, x1 ≥ 0, x2 ≥ 4
(0, 8)
(5, 6)
(0, 4)
(7,4)
(0, 0)
The vertices of the polygonal regions are (0, 4), (7, 4), (5, 6)
and (0, 8).
z(0, 4) = 20, z(7, 4) = 34, z(5, 6) = 40, z(0, 8) = 40.
Hence Max vale=40 is attained at two points (5, 6) and (0, 8)
Any point in the line segment joining (5, 6) and (0, 8) is of
the form λ(5, 6) + (1 − λ)(0, 8) = (5λ, 8 − 2λ).
Solve the problem graphically:
Max: z = 2x1 + 5x2
Sub: x1 + x2 ≤ 11, 2x1 + 5x2 ≤ 40, x1 ≥ 0, x2 ≥ 4
(0, 8)
(5, 6)
(0, 4)
(7,4)
(0, 0)
The vertices of the polygonal regions are (0, 4), (7, 4), (5, 6)
and (0, 8).
z(0, 4) = 20, z(7, 4) = 34, z(5, 6) = 40, z(0, 8) = 40.
Hence Max vale=40 is attained at two points (5, 6) and (0, 8)
Any point in the line segment joining (5, 6) and (0, 8) is of
the form λ(5, 6) + (1 − λ)(0, 8) = (5λ, 8 − 2λ).
Show that z(5λ, 8 − 2λ) = 40