You are on page 1of 45

IE210

Int. to Systems and Mathematical


Modeling for Ind. Eng.

Department of Industrial Engineering

1
Example: The Galaxy Industries Production Problem –
A Prototype Example

• 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.

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.

• The current production plan consists of:


Space Rays = 450 dozen 8(450) + 5(100)
Zapper = 100 dozen
Profit = $4100 per week
4
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

5
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)

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.

Table – Requirements for Post Office

Day Number of Full-time Employees Required

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:

Table – Summary Table


Day Full-Time Employee Minimum Number of
Limitations
Starts Shift Workers For Day
Work: Mon-Fri
1 = Monday 17
Off-Work: Sat-Sun
Work: Tue-Sat
2 = Tuesday 13
Off-Work: Sun-Mon
Work: Wed-Sun
3 = Wednesday 15
Off-Work: Mon-Tue
Work: Thu-Mon
4 = Thursday 19
Off-Work: Tue-Wed
Work: Fri-Tue
5 = Friday 14
Off-Work: Wed-Thu
Work: Sat-Wed
6 = Saturday 16
Off-Work: Thu-Fri
Work: Sun-Thu
7 = Sunday 11
Off-Work: Fri-Sat

9
Post Office Problem
Decision Variables

Table – Decision Variables


Decision Variable Description
X1 Number of employees starting on Monday
X2 Number of employees starting on Tuesday
X3 Number of employees starting on Wednesday
X4 Number of employees starting on Thursday
X5 Number of employees starting on Friday
X6 Number of employees starting on Saturday
X7 Number of employees starting on Sunday

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

Start Wed X3 X3 X3 X3X3


Start Thu X4 X4 X4 X4X4
Start Fri X5 X5 X5 X5X5
Start Sat X6 X6 X6 X6X6
Start Sun X7 X7 X7 X7 X7
X1 + X4 X1 + X2 X1 + X2 X1 + X2 X1 + X2 X2 + X3 X3 + X4
Sum of
+ X5 + + X5 + + X3 + + X3 + + X3 + + X4 + + X5 +
Employees
X6 + X7 X6 + X7 X6 + X7 X4 + X7 X4 + X5 X5 + X6 X6 + X7
Min Work
Force Size 17 13 15 19 14 16 11
Per Day

12
Post Office Problem

Complete LP Model

13
Example 2: Shift Assignment

Doctors work 8 consecutive hours. The demand for doctors is as follows:

Hospital Hours 00-4am 4am-8am 8am-Noon 12-4pm 4pm-8pm 8pm-midnight

Demand for doctors 15 10 60 35 60 50

Formulate an LP model to minimize the number of doctors employed by the hospital

14
Answer

xi = # of doctors to do their duty in 6 period (8 hours consecutive) respectively


Where i = {1, 2, 3…..8}

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

• Situations in which various inputs must be blended in some desired


proportion to produce goods for sale are often amenable to linear
programming analysis. Such problems are called 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.

• At present, you have in stock 100 oz of sugar, 20 oz of nuts, and 30 oz of 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

• Decision Variables (in ounces)


Ing. 1 = Sugar, Ing. 2 = Nuts, Ing. 3 = Chocolate
Candy 1 = Slugger and Candy 2 = Easy Out

• xij = Ounces of Ing. i used to make candy j.


Ex:
x12 = ounces of sugar used to make easy out candy,
x31 = ounces of chocolate used to make slugger candy

22
Example : Blending Problem 1

max z = 20(x11 + x21 + x31) + 25(x12 + x22 + x32)


s.t.
x11 + x12100 (Sugar Const.)

x21 + x2220 (Nuts Constraint)


(Chocolate Const.)
x31 + x3230

Note: Ounces of Slugger Candy produced = x11 + x21 + x31


Ounces of Easy Out Candy produced = x12 + x22 + x32

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-.2x320
• x21.1(x11+x21+x31) or .9x21-.1x11-.1x310
• x31.1(x11+x21+x31) or .9x31-.1x11-.1x210

xij  0 for i=1,2,3 j=1,2


24
Blending Problem 1

max z = 20(x11 + x21 + x31) + 25(x12 + x22 + x32)


s.t.
x11 + x12100 (Sugar Const.)
x21 + x2220 (Nuts Constraint)
x31 +x3230 (Chocolate Const.)
• x22.2(x12+x22+x32)
• x21.1(x11+x21+x31) Blending constraints

• x31.1(x11+x21+x31)

xij  0 for i=1,2,3 j=1,2 25


Integer Programming

• An integer programming problem (IP) is an LP in


which some or all of the variables are required to be
integers.
• Many real-life situations may be formulated as IPs.
• Unfortunately, IPs are usually much harder to solve
than LPs.

26
Introduction to IP
• An IP in which all variables are required to be integers
is called a pure integer programming problem.

• An IP in which only some of the variables are required


to be integers is called a mixed 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 )

• 0–1 IPs occur in many situations.

28
Example: Facility Location

• A company is thinking about building new facilities in Los


Angeles (LA) and San Francisco (SF).
• Relevant data:
capital needed expected profit
1. factory in LA $6M $9M
2. factory in SF $3M $5M
3. warehouse in LA $5M $6M
4. warehouse in SF $2M $4M

Total capital available for investment: $10M


• Question: Which facilities should be built
to maximize the total profit?
Example: Facility Location

• Define decision variables (i = 1, 2, 3, 4):


1 if facility i is built
xi = 
0 if not
• Then the total expected benefit: 9x1+5x2+6x3+4x4
the total capital needed: 6x1+3x2+5x3+2x4
➢ Summarizing, the IP model is:
max 9x1+5x2+6x3+4x4
s.t. 6x1+3x2+5x3+2x4  10
x1, x2, x3, x4 binary ( i.e., xi {0,1} )
The Facility Location Problem: adding new requirements

• 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

Back to the facility location problem.


• Requirement: Can’t build a warehouse unless there is a factory
in the city.
The corresponding constraints are:
x3  x1 (LA) x4  x2 (SF)
• Requirement: Can’t select option 3 unless
at least one of options 1 and 2 is selected.
The constraint: x3  x1 + x2
• Requirement: Can’t select option 4 unless
at least two of options 1, 2 and 3 are selected.
The constraint: 2x4  x1 + x2 + x3
Modeling Technique:
Restrictions on the number of options

• Suppose in a certain problem, n different


options are considered. For i=1,…,n
1 if option i is chosen
xi = 
0 if not
• Restrictions: At least p and at most q of
the options can be chosen.
• The corresponding constraints are:
n n

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

• Stockco has $14,000 and is considering four investments:


– Investment 1 will yield a net present value (NPV) of $16,000;
– Investment 2, an NPV of $22,000;
– Investment 3, an NPV of $12,000;
– Investment 4, an NPV of $8,000.
• Each investment requires a certain cash outflow at the present
time:
– Investment 1, $5,000;
– Investment 2, $7,000;
– Investment 3, $4,000;
– Investment 4, $3,000.
• Formulate an IP whose solution will tell Stockco how to maximize
the NPV obtained from investments 1–4.
37
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

Stockco can invest in at most two investments.

If Stockco invests in investment 2, they must also invest in investment 1.

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

You might also like