Graphical Solution

Linear Programming (LP)
線性規劃
- George Dantzig, 1947
1
[1] LP Formulation
(a) Decision Variables : x1 , x2 ,, xn
All the decision variables are non-negative.
(b) Objective Function : Min or Max
(c) Constraints
Minimize
s.t.
2x1  3x2
3x1  4 x2  3
4 x1  1x2  4
s.t. : subject to
x1  0, x2  0
2
[2] Example
A company has three plants, Plant 1, Plant 2, Plant
3. Because of declining earnings, top management
has decided to revamp the company’s product line.
Product 1: It requires some of production capacity
in Plants 1 and 3.
Product 2: It needs Plants 2 and 3.
3
The marketing division has concluded that the
company could sell as much as could be
produced by these plants.
However, because both products would be
competing for the same production capacity in
Plant 3, it is not clear which mix of the two
products would be most profitable.
4
The data needed to be gathered:
1. Number of hours of production time available
per week in each plant for these new products.
(The available capacity for the new products is
quite limited.)
2. Production time used in each plant for each
batch to yield each new product.
3. There is a profit per batch from a new
product.
5
Production Time
per Batch, Hours
Plant
1
1
1
2
0
Production Time
Available
per Week, Hours
4
2
0
2
12
2
18
Product
3
3
Profit
$3,000
per batch
$5,000
6
x1 : # of batches of product 1 produced per week
x2: # of batches of product 2 produced per week
Z : the total profit per week
Maximize
subject to
Z  3 x1  5 x2
1x1  0 x2  4
0 x1  2 x2  12
3 x1  2 x2  18
x1  0, x2  0
7
[3] Graphical Solution (only for 2-variable cases)
x1  0, x2  0
x2
10
8
6
4
Feasible
region
2
0
2
4
6
8
x1
8
x1  0, x2  0
x2
10
8
x1  4
6
4
Feasible
region
2
0
2
4
6
8
x1
9
x1  0, x2  0
x2
10
8
x1  4
6
2x2  12
4
Feasible
region
2
0
2
4
6
8
x1
10
x1  0, x2  0
x2
10
8
3x1  2 x2  18
x1  4
6
2x2  12
4
Feasible
region
2
0
2
4
6
8
x1
11
Maximize: Z  3x1  5x2
Slope-intercept form:  x   3 x  1 Z 
2
1
5
5 

The largest value x
2
The optimal solution
Z  36  3x  5x 8
1
2
( 2,6)
6
Z  20  3x1  5x2
Z  10  3x1  5x2
4
2
0
2
4
6
8
12
10
x1
[4] Standard Form of LP Model
Max
s.t.
Z  c1 x1  c2 x2 
 cn xn
a11 x1  a12 x2    a1n xn  b1
a21 x1  a22 x2    a2 n xn  b2



am1 x1  am 2 x2    amn xn  bm
x1  0, x2  0, , xn  0
13
[5] Other Forms
The other LP forms are the following:
1. Minimizing the objective function:
Minimize
Z  c1 x1  c2 x2    cn xn .
2. Greater-than-or-equal-to constraints:
ai1 x1  ai 2 x2 
 ain xn  bi
14
3. Some functional constraints in equation form:
ai1 x1  ai 2 x2    ain xn  bi
4. Deleting the nonnegativity constraints for
some decision variables:
x j : unrestricted in sign
x
j

j

j

j

j
 x  x where x  0, x  0

15
[6] Key Terminology
(a) A feasible solution is a solution
for which all constraints are satisfied
(b) An infeasible solution is a solution
for which at least one constraint is violated
(c) A feasible region is a collection
of all feasible solutions
16
(d) An optimal solution is a feasible solution
that has the most favorable value of
the objective function
(e) Multiple optimal solutions have an infinite
number of solutions with the same
optimal objective value
17
Multiple optimal solutions:
Example
Maximize
Subject to
and
Z  3x1  2 x2 ,
x1
4
2x2  12
3x1  2 x2  18
x1  0, x2  0
18
x2
Z  18  3x1  2x2
8
Multiple optimal solutions
6
Every point on this red line
segment is optimal,
each with Z=18.
4
Feasible
2 region
0
2
4
6
8 10
x1
19
(f) An unbounded solution occurs when
the constraints do not prevent improving
the value of the objective function.
x2
x1
20
[7] Case Study
The Socorro Agriculture Co. is a group of three
farming communities.
Overall planning for this group is done in its
Coordinating Technical Office.
This office currently is planning agricultural
production for the coming year.
21
The agricultural production is limited by both the
amount of available land and the quantity of
water allocated for irrigation.
These data are given below.
Group
1
2
3
Usable Land Water Allocation
(Acres)
(Acre Feet)
400
600
600
800
300
375
22
The crops suited for this region include sugar
beets, cotton, and sorghum, and these are the three
products being considered for the upcoming
season.
These crops differ primarily in their expected net
return per acre and their consumption of water.
23
In addition, there is a maximum quota for the
total acreage that can be devoted to each of these
crops by Socorro Agriculture Co .
Net Return
Maximum
Water
Quota Consumption ($/Acre)
Crop
(Acres) (Acre Feet/Acre)
Sugar beets 600
3
1,000
Cotton
500
2
750
Sorghum
325
1
250
24
Because of the limited water available for
irrigation, the Socorro Agriculture Co. will be
unable to use all its land for planting crops.
To ensure equity among the three groups, it has
been agreed that it will plant the same proportion
of its available land.
For example, if Group 1 plants 200 of its
available 400 acres, then Group 2 must plant 300
of its 600 acres, while Group 3 plants 150 acres of
its 300 acres.
25
The job facing the Coordinating Technical
Office is to plan how many acres to devote to
each crop while satisfying the given
restrictions.
The objective is to maximize the total net return
as a whole.
26
The quantities to be decided are the number of
acres to devote to each of the three crops at each
of the three groups.
The decision variables x j ( j  1,2,,9) represent
these nine quantities.
Crop
Sugar beets
Cotton
Sorghum
Allocation(Acres)
Group
1
2
3
x1
x4
x7
x2
x5
x8
x3
x6
x9
27
The measure of effectiveness Z is the total net
return and the resulting linear programming model
for this problem is
Maximize Z=
1,000( x1  x2  x3 )  750( x4  x5  x6 )  250( x7  x8  x9 ),
1. Usable land for each group:
x1  x4  x7  400
x2  x5  x8  600
x3  x6  x9  300
28
2. Water allocation for each group:
3x1  2x 4  x 7  600
3x 2  2x 5  x 8  800
3x 3  2x 6  x 9  375
3. Total land use for each crop:
x1  x2  x3  600
x4  x5  x6  500
x7  x8  x9  325
29
4. Equal proportion of land planted:
x1  x 4  x 7 x 2  x 5  x 8

400
600
x 2  x 5  x8 x 3  x 6  x 9

600
300
x 3  x 6  x 9 x1  x 4  x 7

300
400
30
The final form is
3( x1  x4  x7 )  2( x2  x5  x8 )  0
( x2  x5  x8 )  2( x3  x6  x9 )  0
4( x3  x6  x9 )  3( x1  x4  x7 )  0
5. Nonnegativity:
x j  0,
( j =1, 2, …, 9)
31
An optimal solution is
( x1, x 2 , x 3 , x 4 , x 5 , x 6 , x 7 , x 8 , x 9 ) 
1


133 ,100, 25,100, 250,150, 0, 0,0 ,
3


The resulting optimal value of the objective
function is $633,333.33.
32
[8] Case Study - Personal Scheduling
UNION AIRWAYS needs to hire additional
customer service agents.
Management recognizes the need for cost control
while also consistently providing a satisfactory
level of service to customers.
Based on the new schedule of flights, an analysis
has been made of the minimum number of
customer service agents that need to be on duty at
different times of the day to provide a satisfactory
level of service.
33
Time Period Covered Minimum #
of Agents
Shift
Time Period
1 2 3 4 5 needed
48
6:00 am to 8:00 am *
79
8:00 am to10:00 am * *
65
10:00 am to noon
* *
87
Noon to 2:00 pm
* * *
64
2:00 pm to 4:00 pm
* *
73
4:00 pm to 6:00 pm
* *
82
6:00 pm to 8:00 pm
* *
43
8:00 pm to 10:00 pm
*
52
10:00 pm to midnight
* *
15
Midnight to 6:00 am
*
Daily cost per agent 170 160 175 180 195
34
The problem is to determine how many agents
should be assigned to the respective shifts each
day to minimize the total personnel cost for
agents, while meeting (or surpassing) the service
requirements.
Activities correspond to shifts, where the level of
each activity is the number of agents assigned to
that shift.
This problem involves finding the best mix of
shift sizes.
35
x1 : # of agents for shift 1 (6AM - 2PM)
x2 : # of agents for shift 2 (8AM - 4PM)
x3 : # of agents for shift 3 (Noon - 8PM)
x4 : # of agents for shift 4 (4PM - Midnight)
x5 : # of agents for shift 5 (10PM - 6AM)
The objective is to minimize the total cost of
the agents assigned to the five shifts.
36
Min 170 x1  160 x2  175x3  180 x4  195x5
x1
 48
s.t.
all xi  0
x1  x2
 79
x1  x2
 65
x1  x2  x3
 87
x2  x3
 64
(i  1 ~ 5)
x3  x4
 73
x3  x4
 82
x4
 43
x4  x5  52
x5  15
37
x1
 48
x1  x2
 79
x1  x2  x3
 87
x2  x3
 64
x3  x4
 82
x4
 43
x4  x5  52
x5  15

1

2

3

4

5
( x , x , x , x , x )  (48,31,39,43,15)
Total Personal Cost = $30,610
38
Basic assumptions for LP models:
1. Additivity: c1x1+ c2x2; ai1x1+ ai2x2
2. Proportionality: cixi ; aijxj
3. Divisibility: xi can be any real number
4. Certainty: all parameters are known with
certainty
39
Other Examples
• Galaxy manufactures two toy doll models:
– Space Ray.
– Zapper.
• Resources are limited to
– 1000 pounds of special plastic.
– 40 hours of production time per week.
40
• Marketing requirement
– Total production cannot exceed 700 dozens.
– Number of dozens of Space Rays cannot
exceed number of dozens of Zappers by more
than 350.
• Technological input
– Space Rays requires 2 pounds of plastic and
3 minutes of labor per dozen.
– Zappers requires 1 pound of plastic and
4 minutes of labor per dozen.
41
• The current production plan calls for:
– Producing as much as possible of the more
profitable product, Space Ray ($8 profit per
dozen).
– Use resources left over to produce Zappers ($5
profit
per dozen), while remaining within the marketing
guidelines.
• The current production plan consists of:
Space Rays = 450 dozen
Zapper
= 100 dozen
Profit
= $4100 per week
8(450) + 5(100)
42
Management is seeking a
production schedule that will
increase the company’s profit.
43
A linear programming model
can provide an insight and an
intelligent solution to this problem.
44
The Galaxy Linear Programming
Model
• Decisions variables:
– X1 = Weekly production level of Space Rays (in
dozens)
– X2 = Weekly production level of Zappers (in
dozens).
• Objective Function:
– Weekly profit, to be maximized
45
The Galaxy Linear Programming
Model
Max 8X1 + 5X2
(Weekly profit)
subject to
2X1 + 1X2  1000 (Plastic)
3X1 + 4X2  2400 (Production Time)
X1 + X2  700 (Total production)
X1 - X2  350 (Mix)
Xj> = 0, j = 1,2
(Nonnegativity)
46