Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
29
the linear programming problem of Fig1. the same as that considered above. This case
Here, however, the curves of constant z are is illustrated graphically in Fig.3. The optimal
ellipse with centers at the point (3.5, 4). The values of x1, x2, and z are x1* = 2, x2* = 3,
optimal solution is that point at which an and z* = 0.Thus it is not even necessary that
ellipse is tangent to one side of the convex the optimizing point lie on the boundaries.
set. If the optimal values of the variables are Note that in this case, the minimum of the
∗ ∗ objective function in the presence of the
x1 and x2 , and the minimum value of the
constraints and non-negativity restrictions is
objective function is z*, then from Fig 1-2,
∗ ∗
the same as the minimum in the absence of
x1 +x2 =6, and any constraints or non-negativity restrictions.
∗
( ∗
z = 10 x1 − 3.5 + 20 x 2 − 4 . )
2
( ∗
)
2
In such situations we say that the constraints
and non-negativity restrictions are inactive,
Furthermore the slope of the curve
since the same optimum is obtained whether
z = 10(x1 − 3.5) + 20( x2 − 4)
∗ 2 2
evaluated or not the constraints and non-negativity
at (x1
∗
, x2
∗
) must be –1 since this is the restrictions are included. Each of the
examples presented thus far the property that
slope of x1 + x2 = 6. Thus we have the a local optimum was a global optimum and
additional equation x2 − 4 = 0.5 x1 − 3.5 .
∗
( ∗
) was introduced by [5].
We have obtained three equations involving As a final example, I shall examine an integer
∗ ∗ linear programming problem.
x1 , x2 and z*. The unique solution is Let us solve the problem
∗ ∗
x1 = 2.50 , x2 = 3.50 and z*=15. Now the 0.5 x1 + x2 ≤ 1.75
point which yields the optimal value of the x1 + 0.30 x2 ≤ 1.50
objective function lies on the boundary of the
convex set of feasible solutions, but it is not x1 , x2 ≥ 0, x1 , x2 intigers
an extreme point of this set. Consequently, Max z = 0.25 x1 + x2 .
any computational procedure for solving The situation is illustrated geometrically in
problems of this type cannot be one which Fig.3.4.The shaded region would be the
examines only the extreme points of the convex set of feasible solutions in the
convex set of feasible solutions. By a slight absence of the integrality requirements.
modification of the When the xj are required to be integers, there
objective function studied above the only four feasible solutions which are
minimum value of the objective function can represented by circles in Fig.4. If we solve
be made to occur at an interior point of the the problem as a linear programming
convex set of feasible solutions. Suppose, for problem, ignoring the integrality
example, that the objective function is -
z = 10 ( x1 − 2 ) + 20 ( x 2 − 3 )
2 2
C B
O A
and z*= 1.25 . Note that this is not the solution The point which maximizes the value
that would be obtained by the solving the z = 2 x1 + 3 x2 and lies in the convex region
linear programming problem and rounding OABCD have to find. The desired point is
the results to the nearest integers, which obtained by moving parallel to 2 x1 + 3 x2 =k
satisfy the constraints (this would
give x1 = 0, x 2 = 1 ). and z = 0 .However, in for some k, so long as 2 x1 + 3 x2 =k touches
the case of a NLP problem the optimal the extreme boundary point of the convex
solution may or may not occur at one of the region. According to this rule, we see that the
extreme points of the solution space, point C (2, 4) gives the maximum value of Z.
generated by the constraints and the objective Hence we can find the optimal solution at this
function of the given problem. point by [6]
Graphical solution algorithm: The solution z Max = 2.2 + 3.4
NLP problem by graphical method, in = 16 at x1 = 2, x2 = 4.
general, involves the following steps:
Step 1: construct the graph of the given NLP 4.2 Problem with objective function linear
problem.
constraints non-linear+linear
Step 2: Identify the convex region (solution Maximize Z = x1 + 2 x 2
space) generated by the objective function
and constraints of the given problem. slt
x1 + x 2 ≤ 1
2 2
Step 3: Determine the point in the convex
region at which the objective function is 2 x1 + x 2 ≤ 2
optimum maximum or minimum). x1 , x 2 ≥ 0 .
Step 4: Interpret the optimum solution so
obtained. Which has been introduced by [2]. Let us solve the above problem by graphical
method:
4 Solution of Various Kinds of For this we see that our objective function is
Problems by Graphical Solution Method linear and constraints are non-linear
and linear. Constraints one is a circle of
4.1 Problem with objective function linear radius 1 with center (0, 0) and constraints two
constraints non-Linear is a straight line. In this case tracing the graph
Maximize Z = 2 x1 + 3 x 2 of the constraints of the problem in the first
Subject to the constraints quadrant, we get the following shaded region
x1 + x 2
2 2
≤ 20
as opportunity set.
x1 x 2 ≤ 8
x1 ≥ 0 , x2 ≥ 0.
Let us solve the problem by graphical
method:
C
For this, first we are tracing the graph of the B
constraints of the problem considering
inequalities as equations in the first quadrant
(since x1 ≥ 0, x2 ≥ 0 ). We get the following A
x1 , x2 ≥ 0
First I want to solve above problem by
graphical solution method.
B The given problem can be rewriting as:
⎛ 1⎞
Maximize Z = −( x1 − 1) + 3⎜ x2 + ⎟
2
⎝ 3⎠
Subject to the constraints
x1 + 2 x2 ≤ 4
C
x1 , x2 ≥ 0
Fig. 7 Optimal solution by graphical method We observe that our objective function is a
parabola with vertex at (1, -1/3) and
Since x1 + x2 ≥ 4 and 2 x1 + x2 ≥ 5, the constraints are linear. To solve the problem
desire point must be some where in the graphically, first we construct the graph of
unbounded convex region ABC. The desire the constraint in the first quadrant since
point will be that point of the region at which x1 ≥ 0 and x2 ≥ 0 by considering the
a side of the convex region is tangent to the inequation to equation.
circle. Differentiating the equation of the Here we contract the graph of our problem by
circle MATLAB programming [9] According to
2 x 1 dx 1 + 2 x 2 dx 2 = 0 our previous graphical method our desire
dx 2 x point is at
⇒ = − 1 (8 )
dx 1 x2 (1/4, 15/8)
Considering the inequalities to equalities
DAS: EFFECT OF GRAPHICAL METHOD FOR SOLVING MATHEMATICAL PROGRAMMING PROBLEM
34
1 1
If we consider 2 x1 = then x1 = .
2 4
Now putting the value of x1 in (10),
B we get x = 15
2
8
⎛ 1 15 3 ⎞ for this solution
∴ (x 1 , x 2 , λ ) = ⎜ , , ⎟.
⎝4 8 2⎠
A
∂F 1 3 4 −1− 3
≡ 2− 2⋅ − = = 0 satisfied
∂ x1 4 2 2
0
∂F 3
≡ 3 − 2/ ⋅ = 0 satisfied
Fig. 8 Optimum solution by graphical method ∂x2 2/
∂F 1 15 16 − 1 − 15
≡ 4− − 2/ ⋅ = = 0 satisfied
Hence we get the maximum value of the ∂λ 4 8/ 4 4
objective function at this point. Therefore, ∂F ∂F 1 15
x1 + x2 ≡ ×0+ × 0 = 0 satisfied
Zmax = 2 x1 + 3 x2 − x1
2
∂ x1 ∂x2 4 8
97 1 15 ∂F 3
= at x 1 = ,x = . λ ≡ ⋅ 0 = 0 satisfied
16 4
2
8 ∂λ 2
Let us solve the above problem by using [7] Thus all the Kuhn-Tucker necessary
Kuhn-Tucker Conditions. The Lagrangian conditions are satisfied at the point (1/4,
function of the given problem is 15/8)
F ( x 1 , x 2 , λ ) ≡ 2 x 1 + 3 x 2 − x 1 + λ (4 − x 1 − 2 x 2 ).
2 Hence the optimum (maximum) solution to
the given NLP problem is
By Kuhn-Tucker conditions, we obtain
Z max = 2 x1 + 3 x 2 − x1
2
∂F ∂F
(a) ≡ 2 − 2 x1 − λ ≤ 0 , ≡ 3 − 2λ ≤ 0
∂x1 ∂x 2 =
97
at x 1 =
1
, x2 =
15
.
16 4 8
∂F
(b) ≡ 4 − x1 − 2 x 2 ≥ 0 Let us solve the problem by Beale’s method.
∂λ
Maximize f ( x ) = 2 x1 + 3 x2 − x1
2
∂F ∂F
(c ) x1 + x 2 ≡ x1 (2 − 2 x1 − λ ) + x 2 (3 − 2λ ) = 0 Subject to the constraints:
∂x1 ∂x 2
x1 + 2 x2 ≤ 4
(d ) λ ∂F ≡ λ (4 − x1 − 2 x2 ) = 0 with λ ≥ 0.
x1 , x2 ≥ 0
∂λ
Now there arise the following cases: Introducing a slack variables s, the constraint
Case (i) : Let λ = 0 , in this case we get becomes
from x1 + 2 x2 + s = 4
∂F ∂F
≡ 2 − 2 x1 ≤ 0 and ≡ 3− 2⋅0 ≤ 0 x1 , x2 ≥ 0
∂x1 ∂x 2 since there is only one constraint, let s be a
⇒ 3 ≤ 0 which is impossible and this basic variable. Thus we have by [13]
solution is to be discarded and it has been xB = (s ), xNB = (x1,x2 ) with s = 4
introduced by [12].Case (ii): Let λ ≠ 0 . In
Expressing the basic xB and the objective
this case we get function in terms of non-basic xNB, we have
from λ (4 − x1 − 2 x2 ) = 0 s=4-x1-2x2 and f =2x1+3x2-x12. We
4 − x1 − 2x2 = 0 ⇒ x1 + 2x2 = 4 (10) evaluated the partial derivatives of f w.r.to
non-basic
variables at xNB=0, we get
Also from ∂ F ≡ 2 − 2 x1 − λ ≤ 0 ⎛ ∂f ⎞
∂ x1 ⎜⎜ ⎟⎟ = (2 − 2 x1 )x = 2 − 2⋅0 = 2
⎝ ∂ x1 ⎠ x
NB = 0
∂F
≡ 3 − 2 λ ≤ 0 ∴ 2 x1 + λ − 2 ≥ 0 NB = 0
∂x2 ⎛ ∂f ⎞
⎜⎜ ⎟⎟ =3
and 2λ − 3 ≥ 0 ⇒ λ ≥
3 ⎝ ∂ x 2 ⎠ x NB = 0
2 since both the partial derivatives are positive,
3 1 the current solution can be improved. As
If we take λ = , then 2 x1 ≥
2 2
DAFFODIL INTERNATIONAL UNIVERSITY JOURNAL OF SCIENCE AND TECHNOLOGY, VOLUME 5, ISSUE 1, JANUARY 2010
35
∂ f gives the most positive value, x will Expressing the basic xB in terms of non-basic
2
∂x 2 1
xNB , we have, x1 = − u1
enter the basis. Now, to determine the leaving 4
basic variable, we compute the ratios: and x 2 =
1
(4 − x 1 − x 3 ) = 15 + 1 u 1 − 1 s .
⎧⎪ α γ ⎫⎪ ⎧⎪ α γ ⎫⎪ 2 8 2 2
min ⎨ ho , ko ⎬ = min ⎨ 30 , 20 ⎬
⎪⎩ α hk γ kk ⎪⎭ ⎪⎩ α 32 α 22 ⎪⎭
The objective function, expressing in terms
⎧⎪ 4 3 ⎫⎪ of xNB is,
= min ⎨ , ⎬=2
⎪⎩ − 2 0 ⎪⎭
2
α ⎛1 ⎞ ⎛ 15 1 1 ⎞ ⎛1 ⎞
since the minimum occurs for 30 , s will f = 2⎜ − u 1 ⎟ + 3⎜ + u1 − s ⎟ − ⎜ − u1 ⎟
α 30 ⎝4 ⎠ ⎝ 8 2 2 ⎠ ⎝4 ⎠
97 3
= − s − u1 .
2
leave the basis and it was introduced by [8].
16 2
Thus expressing the new basic variable, x2 as
well as the objective function f in terms of the ⎛ ∂F ⎞ 3
Now, ⎜ ⎟ =− ;
new non-basic variables (x1 and s) we have: ⎝ ∂ s ⎠ x NB = 0 2
x1 s u=0
x2 = 2 − −
2 2 ⎛ δf ⎞
⎛ x s⎞ ⎜⎜ ⎟⎟ = −2u1 = 0
and f = 2 x1 + 3⎜ 2 − 1 − ⎟ − x1 ⎝ δu1
2
⎝ 2 2⎠ ⎠ x NB = 0
u =0
x 3
= 6 + 1 − s − x1
2
∂f ∂f
2 2 since ≤ 0 for all xj in xNB and = 0,
we, again, evaluate the partial derivates of f ∂u1 ∂u
w. r. to the non-basic variables:
the current solution is optimal. Hence the
⎛ ∂f ⎞ ⎛ 1 ⎞ 1 optimal basic feasible solution to the given
⎜⎜ ⎟⎟ = ⎜ − 2 x1 ⎟ = problem is:
⎝ ∂ x1 ⎠ x NB =0
⎝ 2 ⎠ x1 = 0 2
⎛ ∂f ⎞ 3 1 15 97
⎜ ⎟ = − . x = , x , Z * =
⎝ ∂s ⎠
1 2
x NB 2 4 8 16
=0
since the partial derivatives are not all Similarly we can find that by Wolfe’s
negative, the current solution is not optimal, algorithm the optimal point is at (1/4, 15/8).
clearly, x1 will enter the basis. For the next which was introduced by [14].
Criterion, we compute the ratios Thus for the optimal solution for the given
⎧⎪ α ⎫⎪ ⎧⎪ ⎫⎪
QP problem is
γ 10 2 1/ 2 3
min ⎨ ⎬ = ⎨ ⎬ =
20
, , .
⎪⎩ α γ 11 ⎪⎭ ⎪⎩ − 1 / 2 − 2 ⎪⎭ 4
21
M a x Z = 2 x1 + 3 x 2 − x12
since the minimum of these ratios correspond 2
1 15 ⎛ 1 ⎞
to γ 10 , non-basic variables can be = 2 ⋅
4
+ 3⋅
8
− ⎜ ⎟
⎝ 4 ⎠
γ 11 ⎛ 1 15 ⎞
removed. Thus we introduce a free variable,
=
97
16
at (x 1
∗
, x2∗ )= ⎜
⎝ 4
, ⎟
8 ⎠
u1 as an additional non-basic variable,
defined by Therefore the solution obtained by graphical
1 ∂f 1 ⎛1 ⎞ 1 solution method, Kuhn-Tucker conditions,
u1 = = ⎜ − 2 x1 ⎟ = − x1
2 ∂ x1 2⎝2 ⎠ 4 Beale’s method and Wolf’s algorithm are
Note that now the basis has two basic same. The computational cost is that by the
variables x2 and x1 (just entered). That is, we graphical solution method using MATLAB
have Programming it will take very short time to
x NB = (s , u 1 ) and x B = ( x 1 , x 2 ) . determine the plan of action and the solution
obtained by graphical method is more
effective than any other methods we
considered.
DAS: EFFECT OF GRAPHICAL METHOD FOR SOLVING MATHEMATICAL PROGRAMMING PROBLEM
36