1. Linear programming, first examples - filled
1. Linear programming, first examples - filled
Ladislav Stacho
SFU Burnaby
1 / 10
Linear Programming
What is it? What is it for?
What programming?. . .
LP—introduced in 1950’s
surprisingly not directly related to computer programming
‘programming’ was a military term for strategic planning
‘linear’—feasible plans are restricted by linear constraints (inequalities) and also
quality of the plan is measured by a linear function
solving problems in industry (minimizing cost, maximizing production), in theory
(network-flows)
programming in sense of LP—development of e↵ective algorithms for solving
problems
So what is it?
modelling the problem—choosing variables, determining constraints, choosing
function to optimize
solving the linear program
interpreting the solution
2 / 10
Informal definition
Linear Programming is a collection of procedures for maximizing or minimizing linear - .
FIIKEE
(1) x > 0
(2) y > 0 y
(3) y x 6 1
(4) x + 6y 6 15
(5) 4x y 6 10
(3)y -
x 1
=
(4) x+
6y
15
6y
x+
10 [(c)
=
I
ll
10,17
(15,0)
( 1,0)
-
10
(5) 4x -
y
=
(0, 10)
-
x
(E,0) I
3 / 10
objective function f(x) = x +
y
=
- set to
any
number and plot
x +
y
y
EvEEEr
(9/7, 16/7)
(3, 2)
(0, 1)
A
(0, 0) (5/2, 0) x
4 / 10
Real world example (TB, Example 1, p. 5)
An appliance company manufactures heaters and air conditioners. The production of one
heater requires 2 hours in the parts division and 1 hour in the assembly division; the
production of one air conditioner requires 1 hour in the parts division and 2 hours in the
assembly division. The parts division is operated for at most 8 hours per day and the
assembly division is operated for at most 10 hours per day. Sale profits are $30 per
heater and $50 per air conditioner. How many heaters and air conditioners should the
company manufacture per day so as to maximize the profits?
# of aircond
FEEFFOe-was
x2 x...
# of heaters X...
x,, Xc
>
O (integers)
maximized at
30x, + 50xc
(4,0)
x1
Rint:HoOT woodwood
for a
profit of $260, 5 / 10
3D example
Maximize function f (x, y , z) = x 2y z subject to constraints
(1) 3x + 4y + 12 5
z 6 12
(2) 2y + 4z 6 8 2y + 4z 8
=
(3) x, y , z > 0
(0,0,2)
extHOtE
R
(0,4,0)
For
t
·
Fall i
6 / 10
:
P X0
=
z0
=
7 / 10
objective f. x
-2y-z>
max.
k
· a
plane x-2y-z =
want
·sliding the plane, we
while
to maximizek
insides with
staying
(x,y,z).
we must maximize X
S
·
n and minimize
y, z
H
⑱
(4,0,0) r
⑧
⑤
⑬
will be attained
Maximum
at (4,0,0)
8 / 10
Geometric example
Given four points A = (0, 0), B = (4, 0), C = (2, 3), and D = (0, 2) in the plane. Find
the largest circular disk that fits in the quadrangle ABCD.
its centre
variables:Disk determined by
x2 radius ty
T =
(t, tc) and
maximize
objectivef: ft., tct) =ts ->
(2, 3)
line ` : ax1 + bx2 + c = 0
point T = (t1 , t2 )
point-line distance formula:
(0, 2)
-...
|at1 + bt2 + c|
d(T , `) = p x t3
a2 + b 2
(0, 0)
↑
we first
t
constraint
(4, 0)
x1
T. Then we use
↑ to constraint the
x2
3
x 1 22 x. /2
33
=
2Xz 4 0 2X,+4
=
X, 0
X,
-
+ =
-
=
X2
2 5X i
+
2 x,/2
+
es/
= =
(4, 0)
(0, 0) t1 x1
l,:Xz 0 =
(1)
-
radius cannot
be negative
constraints:tg> 0
I be inside
t,,t,30(2)(3) point must
t, -
2tz 44,0(9)
+
the
of
quadrangle
3t, 2tc +
-
12 0(5) -
the circle
cannot
radius of
d(5,e.),d(T.D), d(T,3),d(T,2,)
10 / 10
linear constraint
|at, st c)>Vbts not
-
+
+
#
r+5 ty
j
at, btn cs to two linear
equivalent
+
is
+
cs(5'ts constraints
-
at, -
btc -
subject to
·t,,tz,ty>0
4 =0
t 2tz
-
-
+
= 0
·
It, 2tc +
- 12
11.