LP Problem1
LP Problem1
Example 1
Suppose an industry is manufacturing tow types of products P1 and P2. The profits
per Kg of the two products are Ksh.30 and Ksh.40 respectively. These two products
require processing in three types of machines. The following table shows the
1
available machine hours per day and the time required on each machine to produce
one Kg of P1 and P2. Formulate the problem in the form of linear programming
model.
Profit/Kg P1 P2 Total available Machine
Ksh.30 Ksh.40 hours/day
Machine 1 3 2 600
Machine 2 3 5 800
Machine 3 5 6 1100
30x1 + 40x2
x1 ≥ 0 ; x2 ≥ 0
Thus, the product mix problem in the linear programming model is as follows:
Maximize
Z = 30x1 + 40x2
Subject to:
3x1 + 2x2 ≤ 600
3x1 + 5x2 ≤ 800
5x1 + 6x2 ≤ 1100
x1≥ 0, x2 ≥ 0
Example 2:
A company owns two flour mills viz. A and B, which have different production
capacities for high, medium and low quality flour. The company has entered a
2
contract to supply flour to a firm every month with at least 8, 12 and 24 quintals of
high, medium and low quality respectively. It costs the company Ksh.2000 and
Ksh.1500 per day to run mill A and B respectively. On a day, Mill A produces 6, 2
and 4 quintals of high, medium and low quality flour, Mill B produces 2, 4 and 12
quintals of high, medium and low quality flour respectively. How many days per
month should each mill be operated in order to meet the contract order most
economically.
Solution:
Here the objective is to minimize the cost of the machine runs and to satisfy the
contract order.
Minimize
Z = 2000x1 + 1500x2
Subject to:
6x1 + 2x2 ≥ 8
2x1 + 4x2 ≥ 12
4x1 + 12x2 ≥ 24
x1 ≥ 0, x2 ≥ 0
Example 3:
Niki holds two part-time jobs, Job I and Job II. She never wants to work more than
a total of 12 hours a week. She has determined that for every hour she works at Job
I, she needs 2 hours of preparation time, and for every hour she works at Job II,
she needs one hour of preparation time, and she cannot spend more than 16 hours
for preparation.
If Nikki makes sh40 an hour at Job I, and sh30 an hour at Job II, how many hours
should she work per week at each job to maximize her income?
Solution
• Let x = The number of hours per week Niki will work at Job I.
• Let y = The number of hours per week Niki will work at Job II.
Now we write the objective function. Since Niki gets paid sh40 an hour at Job I, and
sh30 an hour at Job II, her total income I is given by the following equation.
3
I=40x+30y …. objective function
Our next task is to find the constraints. The second sentence in the problem states,
"She never wants to work more than a total of 12 hours a week." This translates into
the following constraint:
x+y≤12
The third sentence states, "For every hour she works at Job I, she needs 2 hours of
preparation time, and for every hour she works at Job II, she needs one hour of
preparation time, and she cannot spend more than 16 hours for preparation." The
translation follows.
2x+y≤16
The fact that x and y can never be negative is represented by the following two
constraints:
2x+y≤16 ….line 2
we graph the constraints and shade the region that satisfies all the inequality
constraints.
Any appropriate method can be used to graph the lines for the constraints. However
often the easiest method is to graph the line by plotting the x-intercept and y-
intercept.
4
The line for a constraint will divide the plane into two region, one of which satisfies
the inequality part of the constraint. A test point is used to determine which portion
of the plane to shade to satisfy the inequality. Any point on the plane that is not on
the line can be used as a test point.
• If the test point satisfies the inequality, then the region of the plane that
satisfies the inequality is the region that contains the test point.
• If the test point does not satisfy the inequality, then the region that satisfies
the inequality lies on the opposite side of the line from the test point.
In the graph below, after the lines representing the constraints were graphed using
an appropriate method, the point (0,0) was used as a test point to determine that
Therefore, in this example, we shade the region that is below and to the left
of both constraint lines, but also above the x axis and to the right of the y axis, in
order to further satisfy the constraints x≥0x≥0 and y≥0y≥0.
The shaded region where all conditions are satisfied is called the feasibility
region or the feasibility polygon.
Therefore, we will identify all the vertices (corner points) of the feasibility region. We
call these points critical points. They are listed as (0, 0), (0, 12), (4, 8), (8, 0). To
maximize Niki's income, we will substitute these points in the objective function to
see which point gives us the highest income per week. We list the results below.
5
Critical Points Income (I=40x+30y)
Therefore, we conclude that Niki should work 4 hours at Job I, and 8 hours at Job II.
Example 4
A factory manufactures two types of gadgets, regular and premium. Each gadget
requires the use of two operations, assembly and finishing, and there are at most 12
hours available for each operation. A regular gadget requires 1 hour of assembly and
2 hours of finishing, while a premium gadget needs 2 hours of assembly and 1 hour
of finishing. Due to other restrictions, the company can make at most 7 gadgets a
day. If a profit of sh20 is realized for each regular gadget and sh30 for a premium
gadget, how many of each should be manufactured to maximize profit?
Solution
P=20x+30y
We now write the constraints. The fourth sentence states that the company can
make at most 7 gadgets a day. This translates as
x+y≤7
Since the regular gadget requires one hour of assembly and the premium gadget
requires two hours of assembly, and there are at most 12 hours available for this
operation, we get
6
x+2y≤12
Similarly, the regular gadget requires two hours of finishing and the premium gadget
one hour. Again, there are at most 12 hours available for finishing. This gives us the
following constraint.
2x+y≤12
The fact that x and y can never be negative is represented by the following two
constraints:
In order to solve the problem, we next graph the constraints and feasibility region.
Again, we have shaded the feasibility region, where all constraints are satisfied.
Since the extreme value of the objective function always takes place at the vertices
of the feasibility region, we identify all the critical points. They are listed as (0, 0),
(0, 6), (2, 5), (5, 2), and (6, 0). To maximize profit, we will substitute these points in
the objective function to see which point gives us the maximum profit each day. The
results are listed below.
7
Critical Point Profit (P=20x+30y)
(6,0)
20(6) + 30(0) = sh120
The point (2, 5) gives the most profit, and that profit is sh190.
Therefore, we conclude that we should manufacture 2 regular gadgets and 5
premium gadgets daily to obtain the maximum profit of sh190.
Example 5
Solve the following maximization problem graphically.
Solution
8
The five critical points are listed in the above figure. The first constraint x+y≥1
requires that the feasibility region must be bounded below by the line x+y=1; the test
point (0,0) does not satisfy x+y≥1, so we shade the region on the opposite side of
the line from test point (0,0).
Clearly, the point (2, 2) maximizes the objective function to a maximum value of 50.