Professional Documents
Culture Documents
1
Example: The Galaxy Industries Production Problem –
A Prototype Example
2
The Galaxy Industries Production Problem –
A Prototype Example
• 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.
3
The Galaxy Industries Production Problem –
A Prototype Example
• 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.
• Decisions variables:
5
The Galaxy Linear Programming Model
6
A Work-Scheduling Problems
7
Example 1: Post Office Problem
A post office requires different numbers of full-time employees on different days of the week.
The number of full-time employees required on each day is given in Table. Union rules state
that each full-time employee must work five consecutive days and then receive two days off.
For example, an employee who works Monday to Friday must be off Saturday and Sunday. The
post office wants to meet its daily requirements using only full-time employees. Formulate an
LP that the post office can use to minimize the number of full-time employees who must be
hired.
1 = Monday 17
2 = Tuesday 13
3 = Wednesday 15
4 = Thursday 19
5 = Friday 14
6 = Saturday 16
7 = Sunday 11
8
Post Office Problem
The following summary table has been derived from the information in the problem statement:
9
Post Office Problem
Decision Variables
The results from each of these decision variables specifically show the number of
workers beginning their 5-day shift on that particular day. For instance, the result for
X1 represents the number of employees starting their 5-day long shift on Monday; the
result for X2 represents the number of employees starting their 5-day long shift on
Tuesday.
10
Post Office Problem
Objective Function
The goal of this problem is to minimize the number of employees to fulfill the Post
Office’s daily workforce size demand. Since the decision variables quantify the
number of employees starting on each day, there is no error of duplicity. Therefore,
the following objective function has been made:
11
Post Office Problem
Constraints
ay
ay
ay
y
ay
sd
y
da
da
sd
rd
a
nd
ne
id
on
es
ur
tu
Fr
Su
ed
Tu
M
Th
Sa
W
Start Mon X1 X1 X1 X1 X1
Start Tue X2 X2 X2 X2 X2
General Employee Schedule
12
Post Office Problem
Complete LP Model
13
Example 2: Shift Assignment
14
Answer
Min. Z = x1 + x2 + x3 + x4 + x5 + x6
Subject to: x1 + x2 ≥ 10 x4 + x5 ≥ 60
x2 + x3 ≥ 60 x5 + x6 ≥ 50
x3 + x4 ≥ 35 x6 + x1 ≥ 15
xi ≥ 0 & integer.
15
Blending Problems
16
Blending Problems
17
Blending Problems
The following list gives some situations in which linear programming has
been used to solve blending problems.
• Blending various types of crude oils to produce different types of gasoline
and other outputs (such as heating oil)
• Blending various chemicals to produce other chemicals
• Blending various types of metal alloys to produce various types of steels
• Blending various livestock feeds in an attempt to produce a minimum-cost
feed mixture for cattle
• Mixing various ores to obtain ore of a specified quality
• Mixing various types of papers to produce recycled paper of varying
quality
18
Example : Blending Problem 1
You have decided to enter the candy business. You are considering producing
two types of candies. Slugger Candy and Easy Out Candy, both of which
consist of solely of sugar, nuts and chocolate. At present, you have in stock
100 oz of sugar, 20 oz of nuts, and 30 oz of chocolate. The mixture used to
make Easy Out Candy must contain at least 20 % nuts. The mixture used to
make Slugger Candy must contain at least 10% nuts and 10% chocolate. Each
ounce of Easy Out Candy can be sold for 25 cents, and each ounce of Slugger
Candy for 20 cents. Formulate and LP that will enable you to maximize your
revenue from candy sales.
19
Example : Blending Problem 1
• You are considering producing two types of candies: Slugger Candy and Easy Out
Candy
• Both of the products consist solely of sugar, nuts, and chocolate.
20
Example : Blending Problem 1
• The mixture used to make Easy Out Candy must contain at least 20% nuts.
• The mixture used to make Slugger Candy must contain at least 10% nuts and 10%
chocolate.
• Each ounce of Easy Out Candy can be sold for 25¢, and each ounce of Slugger
Candy for 20¢.
Formulate an LP that will enable you to maximize your revenue from candy sales
21
Example : Blending Problem 1
22
Example : Blending Problem 1
23
Example : Blending Problem 1
Easy Out Candy must
contain at least 20 %
nuts
• x22/(x12 + x22 +x32).20
• x21/(x11 + x21 +x31).10 Blending constraints
• x31/(x11 + x21 +x31).10 Slugger Candy
must contain at
least 10% nuts
Corresponding LP constraints and 10%
chocolate
• x22.2(x12+x22+x32) or .8x22-.2x12-.2x320
• x21.1(x11+x21+x31) or .9x21-.1x11-.1x310
• x31.1(x11+x21+x31) or .9x31-.1x11-.1x210
• x31.1(x11+x21+x31)
26
Introduction to IP
• An IP in which all variables are required to be integers
is called a pure integer programming problem.
27
Introduction to IP
• An integer programming problem in which all the
variables must equal 0 or 1 is called a 0–1 IP, or a
binary programming problem.
( 0 xj 1 and xj integer )
28
Example: Facility Location
• Extra requirement:
build at most one of the two warehouses.
The corresponding constraint is:
x3 +x4 1
• Extra requirement:
build at least one of the two factories.
The corresponding constraint is:
x1 +x2 ≥ 1
1. factory in LA x1
2. factory in SF x2
3. warehouse in LA x3
4. warehouse in SF x4
Modeling Technique: Contingent Decisions
x
i =1
i p x
i =1
i q
Formulating IPs
• There are six cities (cities 1–6) in Kilroy County. The county must determine where to
build fire stations.
• The county wants to build the minimum number of fire stations needed to ensure that
at least one fire station is within 15 minutes (driving time) of each city.
• Formulate an IP that will tell Kilroy how many fire stations should be built and where
they should be located.
34
Formulating IPs
35
Formulating IPs
36
Formulating IPs
A knapsack
problem
38
Knapsack Problem
Josie Camper is going on an overnight hike. There are four
items Josie is considering taking along on the trip. Josie can
maximize the total benefit by solving:
39
Formulating IPs
LOGICAL CONSTRAINTS
Modify the Stockco formulation to account for each of
the following requirements:
1. Stockco can invest in at most two investments.
2. If Stockco invests in investment 2, they must also invest
in investment 1.
3. If Stockco invests in investment 2, they cannot invest in
investment 4, and the other way around.
40
Formulating IPs
If Stockco invests in inv. 2, they cannot invest in inv. 4 and vice versa.
41
Some other Logical Constraints
• Exactly 3 stocks are selected.
x1+ x2+ x3+ x4=3
• One of stock 2 or stock 3 should be selected,
but not both.
x2 + x 3 = 1
42
Investment Alternatives
• CALIFORNIA MANUFACTURING Co. is considering to build a
new factory in Los Angeles or San Francisco, or both.
• It is also considering to build at most one warehouse in the
same city as the factory.
• Objective: Find a combination of alternatives with the given
budget that maximizes the total net present value.
43
Investment Alternatives
• The company wants at most one warehouse → x3 and x4 are
mutually exclusive alternatives. (Only one can be yes)
• The company will have a warehouse where a factory is
present → x3 and x4 are contingent decisions. (Their answer
will depend on other variable’s values)
44
• All variables are binary:
45