Professional Documents
Culture Documents
Modeling
Given a practical problem, the very first task is to express it as an mpp. This is called modeling.
To model a problem.
a) Identify the variables.
b) Write the objective function.
c) Write the constraints.
[2.1] Example (A linear model) Doctors advice me to take a minimum of 10mg of vitamin A, 10mg of
vitamin B and 18mg of vitamin C, daily. There are two type of pills available in the market.
pill A content B content C content cost
red 4 2 2 1
blue 2 4 18 2
What amount (real number) of pills do I take to meet the requirements while minimizing the cost?
Answer. To model this, suppose that we take r red pills and b blue pills every day. This costs r + 2b and
gives 4r + 2b mg of vitamin A, 2r + 4b mg of vitamin B, and 2r + 18b mg of vitamin C.
[2.2] Example (A nonlinear model) A gambler has Rs. 2000 to play. There are 3 places for stake. There
are 3 outcomes. Depending on the outcome the return per unit is shown in the table. In what way the gambler
Outcomes Place 1 Place 2 Place 3
1 -5 1 1
should play in order to maximize the minimum return?
2 -7 6 10
3 13 -2 -6
7
Answer. To model it, let xi be the amount (real number) to be invested in place i. Then the problem is
This is a nlpp as the objective function is not linear (how?). This can be converted into an lpp by bringing
the objective function into the constraints.
max z
z ≤ −5x1 + x2 + x3 , z ≤ −7x1 + 6x2 + 10x3 , z ≤ 13x1 − 2x2 − 6x3 ,
s.t.
x1 + x2 + x3 = 24000, x1 , x2 , x3 ≥ 0, z ∈ R.
[2.3] Example We want to find out the maximum area of a rectangle in the closed unit disc. Formulate the
problem.
8
Some exercises
[2.4] Exercise(M) A shop supplies card boards of length 1 meter and of any ordered width between 1cm
and 1m (in multiples of 1cm). It has a machine which produces square card boards of side 1 meter. The
shopkeeper has to cut the card boards to meet the demand. On a particular day the shop receives an order of
30 boards of width 65cm, 50 boards of width 55cm and 70 boards of width 22cm. The shopkeeper is interested
in using minimum possible square boards to reduce the production cost.
[2.6] Exercise(H) (Optimal location) There are m shops in a city (a map in R2 ). Suppose that the roads
in the city are such that any two roads are either parallel or perpendicular. You want to build a supply center
in a place so that the maximum distance of a shop from the center is minimum. Formulate this problem.
This is easy. It is challenging to simplify the problem.
[2.7] Exercise(M) There are 5 jobs and 5 persons. We have to pay a price cij (positive number) to make
the ith person do the jth job.
1. We want to get all our jobs done with minimum price. Model it.
2. We want to get all our jobs done with minimum price such that each person gets only one job. Model
it.
3. Our boss will be happy even if we get 3 jobs done. So we want to get three of our jobs done with
minimum price. Model it.
4. There are 5 jobs and 5 persons. We have to pay a price cij to make the ith person do the jth job. Our
boss will be happy even if we get 3 jobs done. So we want to get three of our jobs done with minimum
price such that no persons gets more than on job. Model it.
[2.8] Exercise(M) Suppose that n machines are available and each machine can do any of the two types
of jobs in unit time. If x machines are used to do the ith (i = 1, 2) job, goods worth gi (x) can be produced.
The machines are subject to attrition so that after doing the ith job only ai (x) machines become useless. The
process gets repeated with the remaining machines and it is required to maximize the total worth of goods
produced in N unit time. Formulate the problem.
9
Graphical method
We can solve some problems that involve only two (or three) variables in this method. (Sometimes, we
can also solve specific problems of higher dimensions.) The method is relatively unimportant, if we want to
develop an algorithm so that the computer can deal with it. However, the method is illustrative in nature
and it adds to understanding of the subject. It is described below.
Argument: For large positive k the line x1 + x2 = k lies out side the circle and as we decrease k the line
comes closer to the circle. So for the maximum value k = k0 , the line x1 + x2 = k will touch the circle. As
the slope of the line is −1, the normal (which is the radius) must have slope 1. That is, the equation of the
normal is x1 = x2 . As x ≥ 0, we see that the point is ( √12 , √12 ).
Alternate argument: If (x1 , x2 ) is any point on the circle, then (|x1 |, |x2 |) is also a point on the circle. So
the maximum
p value of x1 + x2 will occur at a point in the arc of the circle lying in√the first quadrant. There
x2 = 1 − x21 and 1 ≥ x1 ≥ 0. So the problem reduces to maximize g(x) = x h+ 1 − x2 where 0i ≤ x ≤ 1.
√ x √1 x2 √ 1
We have g′ (x) = 1 − 1−x2
, so x = 2
is a critical point. Further g′′ (x) = − (1−x2 )3/2
+ 1−x2
, which is
10
negative at x = √1 .
2
[2.10] Example Use graphical method to maximize x1 +2x2 +3x3 +4x4 on the unit sphere x21 +x22 +x23 +x24 = 1.
Some exercises
[2.11] Exercise(E) Solve min x1 + x2 by graphical method.
s.t. x1 ≤ 1, x2 ≤ 1, xi ≥ 0
(0, 1)
[2.16] Fact Let f : S → R be a function. Then there exists to nonnegative functions g, h : S → R+ := [0, ∞)
such that f = g − h. That is, every real valued function on S is the difference of two nonnegative functions.
11
[2.17] Converting lpp to slpp.
a) Convert a constraint of the form ai1 x1 + · · · + ain xn ≤ bi to ai1 x1 + · · · + ain xn + si = bi with a nonnegative
variable si . Such variables are called slack variables.
b) Convert a constraint of the form ai1 x1 + · · · + ain xn ≥ bi to ai1 x1 + · · · + ain xn − si = bi with a nonnegative
variable si . Such variables are called surplus variables.
c) If bi ≤ 0, then multiply the corresponding constraint by −1.
d) If a variable xi is unrestricted then replace it by xi1 − xi2 , in the whole problem, where xi1 and xi2 are
two new nonnegative variables.
e) If a variable xi is nonpositive replace it with −yi , where yi ≥ 0, in the whole problem.
f) If xi ≥ k replace it with yi + k, where yi ≥ 0, in the whole problem.
g) Maximize f (x) can be converted to minimize −f (x) as max f (x) = − min −f (x).
x∈T x∈T
[2.18] Example Write the slpp for the lpp: max x1 + 2x2
s.t. −x1 + 2x2 ≥ −4, x1 + x2 = 2, x1 ≥ 2, x2 ∈ R.
Answer. First, convert to minimization problem and then replace x2 by x21 − x22 .
12
[2.19] Matrix form When the variables and the constants are nonnegative, the conversion looks like
x
" #
t
t
min c x 7→ min c 0 0 y (1)
z
Am×n x = b1
A 0 0 x b1
" #" # " #
Bk×n x ≤ b2 B Ik 0 y = b2
s.t.
Cr×n x ≥ b3 s.t. C 0 −I z b3
r
x ≥ 0, bi ≥ 0 x, y, z ≥ 0, bi ≥ 0.
We shall refer to the form on the rhs as the matrix form. Notice that one feasible set is in Rn whereas the
other is in Rn+k+r . Does a minimum solution of the rhs give us a minimum solution of the lhs? Yes. Are we
creating a larger set by this conversion? No. Both the sets are in bijection, as shown below.
[2.20] Theorem In (1), let T and T ′ be the feasible sets for the lpp and slpp, respectively. Define f : T → T ′
as f (x) = (x, b2 − A2 x, A3 x − b3 ). It is a bijection. Moreover, the values of the objective functions at x and
f (x) are the same. In particular, the minimum values of the objective functions are the same.!!
13
Some exercises
[2.22] Exercise(E) Write the slpp of max x1 − 2x2 + 3x3 in the matrix form.
s.t. x1 + x2 ≤ 5, 2x2 + 3x3 ≥ 2, x1 ≥ 0, x2 ≤ 0
[2.24] NoPen (Feasible regions under addition of a new constraint) Suppose that α is the min-
imal value of min ct x . Assume that a new constraint is added. What happens to the feasible
s.t. Ax ≤ b, x ≥ 0
region? What can happen to the new optimal value, assuming it exists?
14