You are on page 1of 7

Introduction

Development of linear programming was among the


most important scientific advances of mid-20th cent.
Most common type of applications: allocate limited
resources to competing activities in an optimal way.
Very large and wide range of applications from local
to very global ones.
Linear programming uses a mathematical model.
 Linear because it requires linear functions.
 Programming as synonymous of planning.

LINEAR PROGRAMMING

Joo Miguel da Costa Sousa / Alexandra Moutinho

Introduction

31

Prototype example

Besides allocate resources to activities, any problem


described by a mathematical model can be solved.
Very efficient solution procedure: simplex method.
This method will be described next as well as the
interior-point algorithm for larger problems.
Besides these algorithms, we will also discuss
sensitivity analysis.

Wyndor Glass Co. produces glass products, including


windows and glass doors.
Plant 1 produces aluminum frames, Plant 2 produces
wood frames and Plant 3 produces glass and
assembles.
Two new products:
 Glass door with aluminum framing (Plant 1 and 3).
 New wood-framed glass window (Plant 2 and 3).

As the products compete for Plant 3, the most


profitable mix of the two products is needed.
Joo Miguel da Costa Sousa / Alexandra Moutinho

32

Data for Wyndor Glass Co.

Plant 1
Plant 2
Plant 3

Doors
$3.000

 x1 = number of batches of product 1 produced per week


 x2 = number of batches of product 2 produced per week
 Z = total profit per week (in thousands)

Windows
$5.000

Hours Used Per Batch Produced


1
0
0
2
3
2

Hours available
per week
4
12
18

maximize
subject to:

Profit Per Batch


(Batches of 20)

34

Doors
$3.000

3 x 1 + 2 x 2 18

Windows
$5.000

Hours Used Per Batch Produced


1
0
0
2
3
2

Z = 3 x1 + 5 x2
x1 4
2 x 2 12

Wyndor Glass Co. Product-Mix Problem

Plant 1
Plant 2
Plant 3

Joo Miguel da Costa Sousa / Alexandra Moutinho

33

Formulation of the LP problem

Wyndor Glass Co. Product-Mix Problem


Profit Per Batch
(Batches of 20)

Joo Miguel da Costa Sousa / Alexandra Moutinho

and x 1 0, x2 0.
Hours available
per week
4
12
18

Joo Miguel da Costa Sousa / Alexandra Moutinho

35

Graphical solution

Graphical solution (2)


Including all constraints: feasible region.

Constraints x1 0, x2 0, and x1 4.

Joo Miguel da Costa Sousa / Alexandra Moutinho

36

Graphical solution (3)

Joo Miguel da Costa Sousa / Alexandra Moutinho

37

Excel Solution
Wyndor Glass Co. Product-Mix Problem

Z = 3x 1 + 5 x2
3
1
x2 = x1 + Z
5
5

(y = mx + b)

 Slope of the line is 3/5


 Trial-and-error: Z = 10, 20, 36

Doors
$3.000

Profit Per Batch

Plant 1
Plant 2
Plant 3

Hours Used Per Batch Produced


1
0
0
2
3
2

Batches Produced

Joo Miguel da Costa Sousa / Alexandra Moutinho

38

Matlab solution

Doors
2

Hours
Used
2
<=
12
<=
18
<=

Windows
6

Hours
Available
4
12
18

Range Name
BatchesProduced
HoursAvailable
HoursUsed
HoursUsedPerBatchProduced
ProfitPerBatch
TotalProfit

Cells
C12:D12
G7:G9
E7:E9
C7:D9
C4:D4
G12

Total Profit
$36.000

Joo Miguel da Costa Sousa / Alexandra Moutinho

39

Generalizing the example

All solvers are


designed to
minimize the
objective function in
the optimization
toolbox. To maximize
f(x), minimize f(x).

solution

Joo Miguel da Costa Sousa /


Alexandra Moutinho

Windows
$5.000

Prototype example

General problem

Production capacities of plants

Resources

3 plants

m resources

Production of products

Activities

2 products

n activities

Production rate of product j, xj

Level of activity j, xj

Profit Z

Overall measure of performance Z

The most common type of application of LP involves


allocating resources to activities.
40

Joo Miguel da Costa Sousa / Alexandra Moutinho

41

Linear programming model

Hillier standard form of the model

Z = value of overall performance measure.


xj = level of activity j, for j = 1, 2, , n. Decision variables
cj = parameters of Z related to xj.
bj = amount of resource i that is available for
allocation of activities, for i = 1, 2, , m. Parameters
aij = amount of resource i consumed by each
unity of activity j.

Joo Miguel da Costa Sousa / Alexandra Moutinho

42

Allocation of resources to activities

Select the values for x1, x2, , xn to

maximize:
subject to:

Z = c1 x 1 + c2 x2 + + cn x n
a11 x 1 + a12 x2 + + a1 n x n b1

a21 x 1 + a22 x2 + + a2n x n b2

am1 x 1 + am2 x2 + + amn x n bm


and
x 1 0, x2 0, , x n 0.

Joo Miguel da Costa Sousa / Alexandra Moutinho

43

Other legitimate forms


Minimizing rather than maximizing:
minimize Z = c1 x 1 + c2 x 2 + + cn x n

Resource Usage per Unit of Activity


Activity

Amount of
Resource available

Resource

a11

a12

a1n

b1

a21

a22

a2n

b2

am1

am2

amn

bm

Contribution
to Z per unit of
activity

c1

c2

cn

Some functional constraints with greater-than-orequal to inequality:


ai 1 x 1 + ai 2 x 2 + + ain x n bi , for some values of i

Some functional constraints in equation form:


ai 1 x 1 + ai 2 x 2 + + ain x n = bi , for some values of i

Deleting the non-negativity constraints for some


variables:
x j unrestricted in sign for some values of j

Joo Miguel da Costa Sousa / Alexandra Moutinho

44

Terminology for solutions

45

Example: no feasible solution

Solution: any specification of values for the decision


variables (x1, x2,, xn).
Feasible solution: solution for which all the
constraints are satisfied.
Infeasible solution: solution for which at least one
constraint is violated.
Feasible region: collection of all feasible solutions.
No feasible solution: see next slide.

Joo Miguel da Costa Sousa / Alexandra Moutinho

Joo Miguel da Costa Sousa / Alexandra Moutinho

46

 If in the Wyndor Glass Co. problem the profit should be above


$50000 per week:

Joo Miguel da Costa Sousa / Alexandra Moutinho

47

Terminology for solutions

Examples of solutions

Optimal solution: feasible solution with the most


favorable value of the objective function.
Most favorable value: largest value if maximizing or
smallest value if minimizing.
No optimal solutions: (1) no feasible solutions or,
(2) unbounded Z (see next slide).
More than one solution: see next slide.

 More than one solution

Joo Miguel da Costa Sousa / Alexandra Moutinho

Joo Miguel da Costa Sousa / Alexandra Moutinho

48

Corner-point feasible solution

 Unbounded cost function

49

Assumptions of linear programming

 Lies at a corner of feasible region. Corners must have at least


one optimal solution.

Proportionality: the contribution of each activity to


the value of the objective function Z and left-hand
side of each functional constraint is proportional to
the level of activity xj.
Violations:
1) Setup costs.

Joo Miguel da Costa Sousa / Alexandra Moutinho

50

Violations of proportionality

51

Violations of proportionality

2) Increase of marginal return due to economy of scale (longer


production runs, quantity discounts, learning-curve effect,
etc.).

Joo Miguel da Costa Sousa / Alexandra Moutinho

Joo Miguel da Costa Sousa / Alexandra Moutinho

3) Decrease of marginal return due to e.g. marketing costs: to sell


more the advertisement grows exponentially.

52

Joo Miguel da Costa Sousa / Alexandra Moutinho

53

Assumptions of linear programming


Additivity: every function in a linear programming
model is the sum of the individual contributions.
Example (Wyndor Glass Co.):

Case 1: Z = 3x1 + 5x2 + x1x2.


 Happens when two products are complementary, increasing
profit (e.g. same advertising campaign for both products).

Case 2: Z = 3x1 + 5x2 x1x2.

Value of Z
(x1, x2)

Additivity
satisfied

 Happens when two products are competitive, decreasing


profit (e.g. time wasted changing between products).

Additivity violated
(next slide)
Case 1

In both these cases, the proporcionality assumption


still is satisfied since after the value of one variable is
fixed, the increment in Z from the other variable is
proporcional to the value of that variable.

Case 2

(1, 0)

(0, 1)

(1, 1)

Joo Miguel da Costa Sousa / Alexandra Moutinho

54

Additivity violated

Additivity violated (next slide)


Case 3

(0, 3)

(2, 3)

12

15

10.8

 Arises as in Case 2, when two products need same machine


and extra time is needed to switch production processes.

If additivity is not a reasonable assumption, and some


or all functions are nonlinear, then the problem needs
a nonlinear programming model.
56

Assumptions of linear programming


Divisibility: decision variables can have any values.
 If values are limited to integer values, the problem needs
an integer programming model.

Certainty: parameters of the model cj, aij and bi are


assumed to be known constants.
 In real applications parameters have always some degree
of uncertainty.
 Therefore, sensitivity analysis must be conducted (identify
sensitive parameters).
 If degree of uncertainty is too high, random or fuzzy
variables should be considered.
Joo Miguel da Costa Sousa / Alexandra Moutinho

Case 3: constraint on production time


3x1 + 2x2 + 0.5x1x2.

 Arises in job shop when idle periods are used to produce


another product, reducing production time.

Case 4

(2, 0)

Joo Miguel da Costa Sousa / Alexandra Moutinho

55

Case 4: constraint on production time


3x1 + 2x2 0.1x12x2.

Amount of resource used


Additivity
satisfied

Joo Miguel da Costa Sousa / Alexandra Moutinho

Additivity violated

The interaction between activities can also affect the


additivity of constraint functions (3x1+2x212).
Example (Wyndor Glass Co.; constraint):

(x1, x2)

Additivity violated

58

Joo Miguel da Costa Sousa / Alexandra Moutinho

57

The assumptions in perspective


Mathematical model is idealized representation of
real problem.
Approximations and simplifying assumptions
required for the model to be tractable.
Really required is a reasonably high correlation
between prediction of model and reality.
It is common in real applications of LP that almost
none of the 4 assumptions hold completely.
It is important to analyse how large the disparities
are, and maybe use alternative models.
Alexandra Moutinho

59

Example: design of radiation therapy

Decision variables: amount of radiation beams 1 and


2 (real problem would have dozens of variables).

Amount of radiation therapy.


Area

Formulation of the problem

Fraction of entry dose


absorbed by area (average)
Beam 1

Beam 2

Restriction on
total average
dosage (kilorads)

Healthy anatomy

0.4

0.5

Minimize

Critical tissues

0.3

0.1

2.7

Tumor region

0.5

0.5

=6

Center of tumor

0.6

0.4

Joo Miguel da Costa Sousa / Alexandra Moutinho

Minimize: Z = 0.4 x 1 + 0.5 x2


subject to: 0.3 x 1 + 0.1 x2 2.7

and
60

Graphical solution

Joo Miguel da Costa Sousa / Alexandra Moutinho

Minimize:

and

Z = 0.4 x 1 + 0.5 x2

0.6x 1 + 0.4 x2 6
x 1 0, x 2 0.

Radiation Therapy Problem

Healthy Anatomy
Critical Tissues
Tumor Region
Center of Tumor
Entry Dosage (kilorads)

Joo Miguel da Costa Sousa / Alexandra Moutinho

62

Example: personnel scheduling

Joo Miguel da Costa Sousa / Alexandra Moutinho

Cells
G7:G9
C11:D11
C6:D9
E6:E9
E6

4,5

Joo Miguel da Costa Sousa / Alexandra Moutinho

subject to

0
0
0
0
0
0
0
0
1
1

Range Name
DosageRestriction
EntryDosage
FractionAbsorbed
TotalDosage
TotalDosageToHealthyAnatomy

63

minimize Z = 170 x 1 + 160 x 2 + 175 x 3 + 180 x 4 + 195 x 5

8am-4pm Noon-8pm 4pm-midnight 10pm-6am


Shift
Shift
Shift
Shift
$160
$175
$180
$195
Shift Works Time Period? (1=yes, 0=no)
0
0
0
1
0
0
1
0
0
1
1
0
1
1
0
0
1
1
0
1
1
0
0
1
0
0
1
0
0
0

7,5

Total
Restriction on
Dosage
Total Average
5,25
Dosage (Kilorads)
2,7 <=
2,7
6
=
6
6,3 >=
6

 xj = number of agents assigned to shift j, j = 1, 2, 3, 4, 5.

Union Airways Personnel Scheduling Problem

1
1
1
1
0
0
0
0
0
0

Fraction of Entry Dose


Absorbed by Area (Average)
Beam 1
Beam 2
0,4
0,5
0,3
0,1
0,5
0,5
0,6
0,4

Formulation of the problem

 Union Airways is adding more flights and needs additional


service agents. How many?

Time Period
6am-8am
8am-10am
10am- 12pm
12pm-2pm
2pm-4pm
4pm-6pm
6pm-8pm
8pm-10pm
10pm-12am
12am-6am

61

Excel optimal solution

subject to: 0.3 x1 + 0.1 x2 2.7


0.5 x 1 + 0.5 x2 = 6

6am-2pm
Shift
Cost per Shift
$170

0.5 x1 + 0.5 x2 = 6
0.6 x 1 + 0.4 x2 6
x 1 0, x2 0.

Minimum
Needed
48
79
65
87
64
73
82
43
52
15

x 1 48
x 1 + x 2 79
x 1 + x 2 65
x 1 + x 2 + x 3 87
x 2 + x 3 64
x 3 + x 4 73

and x j 0, j = 1,2,3,4,5.

x 3 + x 4 82
x 4 43
x 4 + x 5 52
x 5 15
64

Joo Miguel da Costa Sousa / Alexandra Moutinho

65

Optimal solution

Conclusions
Linear programming models can be solved using:

 Some constraints are redundant.


Union Airways Personnel Scheduling Problem
6am-2pm
Shift
Cost per Shift
$170
Time Period
6am-8am
8am-10am
10am- 12pm
12pm-2pm
2pm-4pm
4pm-6pm
6pm-8pm
8pm-10pm
10pm-12am
12am-6am

Number Working

1
1
1
1
0
0
0
0
0
0
6am-2pm
Shift
48

8am-4pm Noon-8pm 4pm-midnight 10pm-6am


Shift
Shift
Shift
Shift
$160
$175
$180
$195
Shift Works Time Period? (1=yes, 0=no)
0
0
0
1
0
0
1
0
0
1
1
0
1
1
0
0
1
1
0
1
1
0
0
1
0
0
1
0
0
0

0
0
0
0
0
0
0
0
1
1

8am-4pm Noon-8pm 4pm-midnight 10pm-6am


Shift
Shift
Shift
Shift
31
39
43
15

Joo Miguel da Costa Sousa / Alexandra Moutinho

Total
Working
48
79
79
118
70
82
82
43
58
15

>=
>=
>=
>=
>=
>=
>=
>=
>=
>=

Minimum
Needed
48
79
65
87
64
73
82
43
52
15

Range Name
CostPerShift
MinimumNeeded
NumberWorking
ShiftWorksTimePeriod
TotalCost
TotalWorking

Cells
C5:G5
J8:J17
C21:G21
C8:G17
J21
H8:H17

 Spreadsheet as Excel Solver for relatively simple problems


 Problems with thousands (or even millions!) of decision
variables and/or functional constraints must use modeling
languages such as CPLEX/MDL and LINGO/LINDO.
 Matlab Optimization toolbox (GUI or code).

Linear programming solves many problems.


However, when one or more assumptions are
violated seriously, other programming techniques are
needed.

Total Cost
$30.610

66

Joo Miguel da Costa Sousa / Alexandra Moutinho

67

You might also like