0% found this document useful (0 votes)
90 views

2a.modeling Linear and Integer Programs

The document describes a linear programming problem faced by a farmer. The farmer must determine how many acres to allocate to corn and wheat to maximize total revenue, given constraints on available land, labor hours, and a minimum production requirement for corn. Key parameters, decision variables, the objective function, and constraints of the farmer's linear programming problem are defined. The document also provides a simple Python-Gurobi implementation of this problem and introduces another example linear programming problem faced by a toy manufacturing company called Giapetto's Inc.

Uploaded by

Esra Tanyıldız
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
90 views

2a.modeling Linear and Integer Programs

The document describes a linear programming problem faced by a farmer. The farmer must determine how many acres to allocate to corn and wheat to maximize total revenue, given constraints on available land, labor hours, and a minimum production requirement for corn. Key parameters, decision variables, the objective function, and constraints of the farmer's linear programming problem are defined. The document also provides a simple Python-Gurobi implementation of this problem and introduces another example linear programming problem faced by a toy manufacturing company called Giapetto's Inc.

Uploaded by

Esra Tanyıldız
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 49

IE 311 – Operations Research I

Part 2: Modeling Linear and Integer Programs


2a. Linear Programs

Spring 2021
Modeling Linear and Integer Programs

• An extremely important aspect of Operations Research is to


formulate the optimization problem correctly.
• Another extremely important aspect of Operations Research is
to implement and solve the formulated optimization problem.
• We will spend the first 5-6 weeks of the semester solely
focusing on how to formulate Linear and Mixed-Integer Linear
Programming problems and solve them using the Python-
Gurobi interface.

IE 311 2
Recall: Types of Linear Optimization Models

• An optimization problem with linear relations between


continuous variables is called a Linear Program:

• An optimization problem with linear relations between integer


variables is called a (Pure) Integer (Linear) Program:

• An optimization problem with linear relations between


continuous and integer variables is called a Mixed-Integer
Linear Program:

IE 311 3
A First Example: Farmer LP

• A farmer must determine how many acres of corn and wheat to plant.
• An acre of corn yields 10 bushels of corn and requires 4 hours of
labor per week.
• An acre of wheat yields 25 bushels of wheat and requires 10 hours of
labor per week.
• All corn can be sold at $3 a bushel and all wheat can be sold at $4 a
bushel.
• Seven acres of land and 40 hours per week of labor are available.
• Government regulations require that at least 30 bushels of corn be
produced.
• How can the farmer maximize the total revenue?

IE 311 4
• A farmer must determine how many acres of corn and wheat to plant.
• An acre of corn yields 10 bushels of corn and requires 4 hours of labor per week.
• An acre of wheat yields 25 bushels of wheat and requires 10 hours of labor per week.

Farmer LP: Components (I) •




All corn can be sold at $3 a bushel and all wheat can be sold at $4 a bushel.
Seven acres of land and 40 hours per week of labor are available.
Government regulations require that at least 30 bushels of corn be produced.
• How can the farmer maximize the total revenue?

• Parameters (what are given?)


• Type of grains (corn and wheat)
• Yield of each type (10 bushels/acre for corn, 25 bushels/acre for wheat)
• Revenue of each type ($3/bushel for corn, $4/bushel for wheat)
• Area availability (7 acres in total)
• Labor requirement for each type (4 hrs/acre for corn, 10 hrs/acre for
wheat)
• Labor availability (40 hrs in total)
• Government regulations (at least 30 bushels of corn)

IE 311 5
• A farmer must determine how many acres of corn and wheat to plant.
• An acre of corn yields 10 bushels of corn and requires 4 hours of labor per week.
• An acre of wheat yields 25 bushels of wheat and requires 10 hours of labor per week.

Farmer LP: Components (II) •




All corn can be sold at $3 a bushel and all wheat can be sold at $4 a bushel.
Seven acres of land and 40 hours per week of labor are available.
Government regulations require that at least 30 bushels of corn be produced.
• How can the farmer maximize the total revenue?

• Decision variables (what can be decided/changed?)


• c : amount of acres allocated to corn
• w : amount of acres allocated to wheat

• Objective function (what is the aim?)


• Maximize the total revenue

IE 311 6
• A farmer must determine how many acres of corn and wheat to plant.
• An acre of corn yields 10 bushels of corn and requires 4 hours of labor per week.
• An acre of wheat yields 25 bushels of wheat and requires 10 hours of labor per week.

Farmer LP: Components (III) •




All corn can be sold at $3 a bushel and all wheat can be sold at $4 a bushel.
Seven acres of land and 40 hours per week of labor are available.
Government regulations require that at least 30 bushels of corn be produced.
• How can the farmer maximize the total revenue?

• Constraints (what should be obeyed/respected?)


• Land availability

• Labor availability

• Government regulations

• Nonnegativity

IE 311 7
Assumptions in Linear Programming

• Proportionality and additivity (due to linear relation between the variables)


• e.g. Labor used = (Labor per acre for corn)*acres of corn + (Labor per acre for wheat)*acres of wheat
• Nonlinear relation between the variables would have violated this assumption.
• Divisibility (due to continuity of the variables)
• e.g. Planting 3.0 acres of corn and 2.8 acres of wheat is possible.
• Existence of integer variables would have violated this assumption.
• Certainty (due to deterministic nature of parameters)
• e.g. It is certain that 1 acre of corn yields 10 bushels.
• Existence of random/uncertain parameters would have violated this assumption.

IE 311 8
Farmer LP: Simplest (but Dirty) s.t.
Python-Gurobi Implementation
from gurobipy import GRB,Model

m = Model('Farmer')

corn = m.addVar(lb=0, ub=GRB.INFINITY, vtype=GRB.CONTINUOUS) # acres of corn

wheat = m.addVar(lb=0, ub=GRB.INFINITY, vtype=GRB.CONTINUOUS) # acres of wheat

m.setObjective(3*10*corn + 4*25*wheat, GRB.MAXIMIZE) # maximize the total revenue

m.addConstr(corn + wheat <= 7) # Constraint on the total number of acres available

m.addConstr(4*corn + 10*wheat <= 40) # Constraint on the total number of labor hrs available

m.addConstr(10*corn >= 30) # Government regulations requirements

m.optimize() # Optimize the model


IE 311 9
Farmer Example- Generic Form
• A farmer wants to plant 𝑛 different types of grains, and must determine
how many acres of plant should be allocated to each product type.
• An acre of grain type i yields 𝑎𝑖 bushels of grain i and requires 𝑙𝑖 hours of
labor per week for 𝑖 = 1, … , 𝑛.
• Grain type i can be sold for $𝑝𝑖 for each bushel for for 𝑖 = 1, … , 𝑛 .
• 𝐴 acres of land and 𝐿 hours of labor per week are available.
• Government regulations require that at least 𝑏𝑖 bushels of grain type 𝑖
should be produced for 𝑖 = 1, … , 𝑛.
• How can the farmer maximize the total revenue?
• Data for the example:
• 𝑛 = 2 (corn, wheat)
• 𝑎 = (10, 25) , 𝑙 = (4, 10), 𝑝 = (3, 4)
• 𝐴 = 7, 𝐿 = 40, 𝑏 = (30, 0)
Giapetto LP (Winston, page 49)

• Giapetto’s, Inc., manufactures two types of wooden toys: soldiers and trains.
• Each soldier built:
• sells for $27 and uses $10 worth of raw materials.
• increases Giapetto’s variable labor/overhead costs by $14.
• requires 2 hours of finishing labor and 1 hour of carpentry labor.
• Each train built:
• sells for $21 and used $9 worth of raw materials.
• increases Giapetto’s variable labor/overhead costs by $10.
• requires 1 hour of finishing labor and 1 hour of carpentry labor.
• Each week Giapetto has only 100 finishing hours and 80 carpentry hours.
• Demand for trains is unlimited, but at most 40 soldiers are bought each week.
• Giapetto wants to maximize weekly profit (revenues - costs).

IE 311 11
• Giapetto’s, Inc., manufactures two types of wooden toys: soldiers and trains.

• Each soldier built:


• sells for $27 and uses $10 worth of raw materials.
Giapetto LP: Model (I) •

increases Giapetto’s variable labor/overhead costs by $14.
requires 2 hours of finishing labor and 1 hour of carpentry labor.

• Each train built:


• sells for $21 and used $9 worth of raw materials.

• Decision variables (what can be decided/changed?) •



increases Giapetto’s variable labor/overhead costs by $10.
requires 1 hour of finishing labor and 1 hour of carpentry labor.

• Each week Giapetto has only 100 finishing hours and 80 carpentry hours.
• s : number of soldiers built • Demand for trains is unlimited, but at most 40 soldiers are bought each week.
• Giapetto wants to maximize weekly profit (revenues - costs).

• t : number of trains built

• Objective function (what is the aim?)


• Maximize the weekly profit

IE 311 12
• Giapetto’s, Inc., manufactures two types of wooden toys: soldiers and trains.

• Each soldier built:

Giapetto LP: Model (II) •



sells for $27 and uses $10 worth of raw materials.
increases Giapetto’s variable labor/overhead costs by $14.
• requires 2 hours of finishing labor and 1 hour of carpentry labor.

• Each train built:

• Constraints (what should be obeyed/respected?) •



sells for $21 and used $9 worth of raw materials.
increases Giapetto’s variable labor/overhead costs by $10.
• requires 1 hour of finishing labor and 1 hour of carpentry labor.

• Finishing hours availability • Each week Giapetto has only 100 finishing hours and 80 carpentry hours.
• Demand for trains is unlimited, but at most 40 soldiers are bought each week.
• Giapetto wants to maximize weekly profit (revenues - costs).

• Carpentry hours availability

• Demand for soldiers

• Nonnegativity

• Is the divisibility assumption satisfied?

IE 311 13
Giapetto LP: Python-Gurobi Implementation

• Two Python-Gurobi Implementations of the Giapetto LP is


already uploaded to the Sucourse.
• Implementation 1: See the function ModelHardcoded.
• In this version, all the parameters are “hard-coded”.
• This is NOT the best coding practice as the implementer would need to go to the details
on this function even if one of the parameters is changed.
• Implementation 2: See the function ModelBetterImplemented.
• In this version, all the parameters are sent as arguments.
• This is a better coding practice as the implementer would only need to change the
arguments sent to the function.
• Both implementations will be accepted when grading your work but it is strongly
suggested to follow Implementation 2 whenever possible.

IE 311 14
Giapetto LP - Generic Form

• Giapetto’s, Inc., manufactures 𝑛 types of wooden toys.


• Each unit of toy type 𝑖 sells for $𝑝𝑖 for 𝑖 = 1, … , 𝑛
• Each unit of toy type 𝑖 uses $𝑐𝑖 worth of raw materials and costs $𝑙𝑖 of labor for 𝑖 =
1, … , 𝑛
• Each unit of toy i requires 𝑟𝑖𝑗 units of labor type j for 𝑖 = 1, … , 𝑛, for 𝑗 = 1, … , 𝑚
• Each week Giapetto has 𝐶𝑗 units of labor type 𝑗 = 1, … , 𝑚
• At most 𝑘𝑖 units of toy type 𝑖 can be bought at each week for 𝑖 = 1, … , 𝑛
• Determine the number of toys that should be built from each type to maximize
weekly profit (revenues - costs) of Giapetto.
• Data:
• n = 2 (soldiers, trains), p = (27, 21), c = (10, 9), l = (14, 10)
• r = [[2, 1], [1,1]], C = (100, 80) , k = (40, ∞)

IE 311 15
Graphical Solution Method

• Notice that both examples considered so far (Farmer and Giapetto) have only
two variables.
• It is possible to solve LPs with two variables by the “Graphical Solution Method”.
• This method gives valuable intuition as to the possible outcomes of LPs:
• LP is infeasible (no feasible solution exists)
• LP is feasible (feasible solution exists)
• LP has unbounded objective (the “optimal value” is unbounded)
• LP has bounded objective (the optimal value is bounded)
• Unique optimal solution
• Multiple optimal solution

• We will see later in the course that the Simplex Method is based on the intuition
obtained from the Graphical Solution Method.
IE 311 16
Graphical Solution Method: Giapetto LP

IE 311 17
Post Office (Winston, page 72)

• 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 as 17, 13,
15, 19, 14, 16, 11.
• 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 on Saturday and Sunday.
• The post office wants to meet its daily requirements using only fulltime
employees.
• Formulate an LP and IP that the post office can use to minimize the number of
full-time employees who must be hired.

IE 311 18
• 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 as 17, 13, 15, 19, 14, 16, 11.
• Union rules state that each full-time employee must work five consecutive days and then receive two days
Post Office: Key Observations •
off. For example, an employee who works Monday to Friday must be off on Saturday and Sunday.
The post office wants to meet its daily requirements using only fulltime employees.
• Formulate an LP and IP that the post office can use to minimize the number of full-time employees who
must be hired.

• Decision variables (what can be decided/changed?)


• We need to decide how many employees start working on each day 𝑖, 𝑖 =
1, … , 7.

• Constraints (what should be obeyed/respected?)


• We need to make sure that requirement on each day is satisfied.
• Question: Who is working on Friday?
• Answer: Employees who start on Monday, Tuesday, Wednesday, Thursday, Friday.

IE 311 19
• 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 as 17, 13, 15, 19, 14, 16, 11.

Post Office LP vs. IP •


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 on Saturday and Sunday.
The post office wants to meet its daily requirements using only fulltime employees.
• Formulate an LP and IP that the post office can use to minimize the number of full-time employees who
must be hired.

• Decision variables: Let 𝑥𝑖 be the number of employees starting in day 𝑖, 𝑖 = 1, … , 7.


• LP Model

• IP Model: Declare the variables as integer


IE 311 • Which model is more appropriate? 20
Dorian Auto LP (Winston, page 60)

• Dorian Auto manufactures luxury cars and trucks.


• The company believes that its likely customers are high-income women and men.
• To reach these groups, Dorian Auto has decided to purchase 1-minute commercial spots on
two types of programs: comedy shows and football games.
• Each comedy commercial is seen by 7 million high-income women and 2 million high-income
men.
• Each football commercial is seen by 2 million high-income women and 12 million high-
income men.
• A 1-minute comedy ad costs $50,000, and a 1-minute football ad costs $100,000.
• Dorian would like the commercials to be seen by at least 28 million high-income women and
24 million high-income men.
• How can Dorian Auto meet its advertising requirements at minimum cost?
• Model this problem as an LP, implement and solve in the Python-Gurobi interface.

IE 311 21
Diet LP (Winston, page 69)

• My diet requires that all the food I eat come from one of the four “basic food groups” (chocolate
cake, ice cream, soda, and cheesecake).
• At present, the following four foods are available: brownies, chocolate ice cream, cola, and pineapple
cheesecake.
• Each brownie costs 50¢, each scoop of chocolate ice cream costs 20¢, each bottle of cola costs 30¢,
and each piece of pineapple cheesecake costs 80¢.
• Each day, I must ingest at least 500 calories, 6 oz of chocolate, 10 oz of sugar, and 8 oz of fat.
• The nutritional content per unit of each food is shown in the following table:
Ingredients Brownie Chocolate ice cream Cola Pineapple cheesecake
Calories 400 200 150 500
Chocolate (oz) 3 2 0 0
Sugar (oz) 2 2 4 4
Fat (oz) 2 4 1 5
• Formulate a linear programming model that can be used to satisfy my daily nutritional requirements
at minimum cost. How can you generalize the model with m ingredients and n food types?

IE 311 22
• At present, the following four foods are available: brownies, chocolate ice cream, cola, and
pineapple cheesecake.
• Each brownie costs 50¢, each scoop of chocolate ice cream costs 20¢, each bottle of cola costs 30¢,
Diet LP – Specific Formulation •
and each piece of pineapple cheesecake costs 80¢.
Each day, I must ingest at least 500 calories, 6 oz of chocolate, 10 oz of sugar, and 8 oz of fat.
• Formulate a linear programming model that can be used to satisfy my daily nutritional requirements
at minimum cost. How can you generalize the model with m ingredients and n food types?

• Decision variables (what can be decided/changed?)


• xi: the amount of brownie, chocolate ice cream, cola and pineapple
cheesecake consumed, respectively, 𝑖 = 1, … , 4.

• Objective function (what is the aim?)


• Minimize the daily cost of my diet

Ingredients Brownie Chocolate ice cream Cola Pineapple cheesecake

Calories 400 200 150 500


Chocolate (oz) 3 2 0 0
IE 311 Sugar (oz) 2 2 4 23 4
Fat (oz) 2 4 1 5
• At present, the following four foods are available: brownies, chocolate ice cream, cola, and
pineapple cheesecake.
• Each brownie costs 50¢, each scoop of chocolate ice cream costs 20¢, each bottle of cola costs 30¢,
Diet LP – Specific Formulation •
and each piece of pineapple cheesecake costs 80¢.
Each day, I must ingest at least 500 calories, 6 oz of chocolate, 10 oz of sugar, and 8 oz of fat.
• Formulate a linear programming model that can be used to satisfy my daily nutritional requirements
at minimum cost. How can you generalize the model with m ingredients and n food types?

• Constraints (what should be obeyed/respected?)


• Calorie requirement

• Chocolate requirement

• Sugar requirement

• Fat requirement

• Nonnegativity Ingredients Brownie Chocolate ice cream Cola Pineapple cheesecake

Calories 400 200 150 500


Chocolate (oz) 3 2 0 0
IE 311 Sugar (oz) 2 2 4 24 4
Fat (oz) 2 4 1 5
Diet LP –Generic Form

• My diet requires that all the food I eat come from one of the n different
types of foods.
• One unit of food type j costs 𝑐𝑗 for 𝑗 = 1, … , 𝑛.
• One unit of food type j has 𝑎𝑖𝑗 units of ingredient type i for 𝑖 = 1, … , 𝑚.
• Each day, I must ingest at least 𝑏𝑖 units of ingredient type i for 𝑖 =
1, … , 𝑚.
• Formulate a linear programming model that can be used to satisfy my
daily nutritional requirements at minimum cost.

IE 311 25
Diet LP – Generic Formulation

IE 311 26
Transportation LP

• A company produces medical diagnostic equipment at two factories.


• Three medical centers have placed orders for this month.
• The table below shows
• the cost of shipping each unit from each factory to each of these customers
• the number of units that will be produced at each factory
• the number of units ordered by each customer.
Customer 1 Customer 2 Customer 3 Output
Factory 1 $600/item $800/item $700/item 400 units
Factory 2 $400/item $900/item $600/item 500 units
Order Size 300 units 200 units 400 units

• A decision now needs to be made about the shipping plan for how many units to
ship from each factory to each customer.
• Formulate this problem as an LP.

IE 311 27
Transportation LP: Key Observations

• Decision variables (what can be decided/changed?)


• We need to know how many items are sent from each factory to each
customer.
C1
F1
C2

F2
C3

IE 311 28
Transportation LP: Key Observations

• Constraints (what should be obeyed/respected?)


• We need to obey the factory capacities and satisfy customer demands.
• Question: What is the total • Question: What is the total
amount sent from Factory 1? amount received by Customer
2?
C1 C1
F1 F1
C2 C2

F2 F2
C3 C3

IE 311 29
Transportation LP

IE 311 30
Transportation LP: General Model

IE 311 31
Blending LP (Winston, page 86)
• Sunco Oil manufactures three types of gasoline. Each type is produced by blending three types of crude oil.
• The sales price of gasoline, the purchase price of crude oil and their octane and sulfur content are given as below:
Gas Price($) Oil Cost($) Octane Sulfur(%)
1 70 1 45 12 0.5
2 60 2 35 6 2.0
3 50 3 25 8 3.0
• Sunco can purchase up to 5,000 barrels of each type of crude oil daily. The three types of gasoline differ in their
octane and sulfur content as follows:
• The crude oil blended to form gas 1 must have an average octane rating of at least 10 and contain at most 1% sulfur.
• The crude oil blended to form gas 2 must have an average octane rating of at least 8 and contain at most 2% sulfur.
• The crude oil blended to form gas 3 must have an average octane rating of at least 6 and contain at most 1% sulfur.
• It costs $4 to transform one barrel of oil into one barrel of gasoline, Sunco’s refinery can produce up to 14,000
barrels of gasoline daily.
• Sunco’s customers require the following amounts of each gasoline daily: gas 1—3,000 barrels; gas 2—2,000
barrels; gas 3—1,000 barrels.
• Sunco also has the option of advertising to stimulate demand for its products. Each dollar spent daily in
advertising a particular type of gas increases the daily demand for that type of gas by 10 barrels.
• Formulate an LP that will enable Sunco to maximize daily profits (revenues - costs).
32
Blending LP: Key Observations

• Decision variables (what can be decided/changed?)


• We need to know how much oil of each type is used in each gas blend.
O1 G1

O2 G2

O3 G3

• We also need to know the advertisement amount for each gas.

IE 311 33
Blending LP: Key Observations

• Constraints (what should be obeyed/respected?)


• We need to obey the crude oil availability and satisfy gas demands.
• Question: What is the total • Question: What is the total
amount of oil 1 used? amount of gas 3 blended?

O1 G1 O1 G1

O2 G2 O2 G2

O3 G3 O3 G3

IE 311 34
Gas Price($) Oil Cost($) Octane Sulfur(%)
Blending LP: Key Observations 1
2
70 1
60 2
45
35
12
6
0.5
2.0
3 50 3 25 8 3.0

• Constraints (what should be obeyed/respected?)


• We need to have gas blends satisfying the quality requirements.
• Question: What is the average octane rating of gas 3 blended?
12
O1 G1

6
O2 G2

8
O3 G3

12 × (Oil 1 in Gas 3) + 6 × (Oil 2 in Gas 3) + 8 × (Oil 3 in Gas 3)


Answer: 12 × (Oil 1 in Gas 3) + 6 × (Oil 2 in Gas 3) + 8 × (Oil 3 in Gas 3)

IE 311 35
Gas Price($) Oil Cost($) Octane Sulfur(%)
Blending LP: Decision Variables and 1 70 1 45 12 0.5
2 60 2 35 6 2.0
Objective Function 3 50 3 25 8 3.0
• Decision variables:

• Some “intermediary” quantities:

• Objective:
Blending LP: Constraints
• Oil availability:
• Gas demand:

• Total capacity:
• Octane rating:

• Sulfur content:

• Nonnegativity:
Powerco Electric Company

• Powerco has three electric power plants that supply electricity to four cities.
• The table below shows
• the cost of sending 1 kwh of electricity from each plant to each city
• the capacity of each plant
• the exact demand of each city.
City 1 City 2 City 3 City 4 Capacity
Plant 1 $8/kwh $6/kwh $10/kwh $9/kwh ≤ 35 Mwh
Plant 2 $9/kwh $12/kwh $13/kwh $7/kwh ≤ 50 Mwh
Plant 3 $14/kwh $9/kwh $16/kwh $5/kwh ≤ 45 Mwh
Demand = 45 Mwh = 20 Mwh = 30 Mwh = 30 Mwh
• A decision now needs to be made about the dispatch of electricity regarding
how many Mwh to send from each plant to each city.
• Formulate this problem as an LP, implement and solve in the Python-
Gurobi interface.
IE 311 38
Production Process (Winston, page 95)

• Rylon Corporation manufactures Brute and Chanelle perfumes.


• The raw material needed to manufacture each type of perfume can be purchased for $3 per
pound. Processing 1 lb of raw material requires 1 hour of laboratory time.
• Each pound of processed raw material yields 3 oz of Regular Brute Perfume and 4 oz of
Regular Chanelle Perfume. Regular Brute can be sold for $7/oz and Regular Chanelle for
$6/oz.
• Rylon also has the option of further processing Regular Brute and Regular Chanelle to
produce Luxury Brute, sold at $18/oz, and Luxury Chanelle, sold at $14/oz.
• Each ounce of Regular Brute processed further requires an additional 3 hours of laboratory
time and $4 processing cost and yields 1 oz of Luxury Brute.
• Each ounce of Regular Chanelle processed further requires an additional 2 hours of
laboratory time and $4 processing cost and yields 1 oz of Luxury Chanelle.
• Each year, Rylon has 6,000 hours of laboratory time available and can purchase up to 4,000
lb of raw material.
• Formulate an LP that can be used to determine how Rylon can maximize profits (assume that
the cost of the laboratory hours is a fixed cost).

IE 311 39
Production Planning

• A company must plan its production for the next 4 months.


• The demand for its product is 40, 70, 30, 50 units in months t = 1, … , 4. The
company must meet its demand exactly every month.
• The cost of production per unit product varies as: $20, $15, $35, $100 in
months t = 1, … , 4.
• The company can carry inventory of the inputs (i.e. the company can produce
more than required and store it as inventory to be used later). The per unit
cost of storing inventory from month 1 to month 2 is $15, month 2 to month 3
is $25, month 3 to month 4 is $10.
• Assume that the company has a starting inventory of 10 units. The company
plans to have no inventory at the end of month 4.
• Write a linear program to find an optimal production and inventory plan.
IE 311 41
Production Planning: Key Observations

• Decision variables (what can be decided/changed?)


• We need to know the production and ending inventory of each month.

• Constraints (what should be obeyed/respected?)


• We need to obey the inventory (or material balance) requirements.

Production Production Production Production


in month 1 in month 2 in month 3 in month 4
End inventory End inventory End inventory End inventory End inventory
Month 1 Month 2 Month 3 Month 4
of month 0 of month 1 of month 2 of month 3 of month 4
Demand Demand Demand Demand
of month 1 of month 2 of month 3 of month 4

IE 311 42
Production Planning

IE 311 43
A Few “Tricks” to Linearize Special Nonlinear Expressions

• Since | ∙ | is not a linear function, a constraint of the form |𝑥| ≤ 1 is


not linear either.
• However, this is an “easy” nonlinearity since 𝑥 ≤ 1  − 𝑥 ≤ 1, 𝑥 ≤ 1.

• More generally, we have max 𝑥1 , 𝑥2 ≤ 𝑦  𝑥1 ≤ 𝑦, 𝑥2 ≤ 𝑦.

• Even more generally, we have


max {σ𝑛𝑗=1 𝑎𝑖𝑗 𝑥𝑗 } ≤ 𝑦  σ𝑛𝑗=1 𝑎𝑖𝑗 𝑥𝑗 ≤ 𝑦 𝑖 = 1, … , 𝑚.
𝑖=1,…,𝑚

IE 311 44
Machine Balancing Example

• A machine shop has a drill press and a milling machine which are used
to produce two parts A and B.
• The required time (in minutes) per unit part on each machine is shown
in the table below.
Part Drill Press Milling Machine
A 3 4
B 5 3
• The shop must produce at least 50 units in total (both A and B) and at
least 30 units of part A, and it can make at most 100 units of part A and
100 units of part B.
• Formulate an LP to minimize the absolute difference between the total
running time of the drill press and that of the milling machine.
IE 311 45
Machine Balancing Example

IE 311 46
Single Facility Rectilinear Distance Location Problem

• We are given the location of 6 plants in 2D space and their raw material demand.
x-Coordinate y-Coordinate Demand
1 1 50
5 12 60
2 8 19
4 4 20
8 6 32
10 7 23

• The raw material will be provided from a warehouse to be located.


• The transportation cost between the warehouse located at (x,y) and a plant located at
(a,b) is equal to demand times the rectilinear distance, that is, 𝑥 − 𝑎 + |𝑦 − 𝑏|.
• Provide a linear program which minimizes the total transportation cost.
• What if our aim is to minimize the largest distance between the warehouse and plants?

IE 311 53
Single Facility Rectilinear Distance Location Problem

IE 311 54
Sailco Inventory (Winston, page 101)

• Sailco must determine how many sailboats should be produced during next four quarters.
• The demand during each of the next four quarters is 40, 60, 75, 25, respectively.
• Sailco must meet demands on time. At the beginning of the first quarter, Sailco has an inventory
of 10 sailboats.
• At the beginning of each quarter, Sailco must decide how many sailboats should be produced
during that quarter. For simplicity, we assume that sailboats manufactured during a quarter can be
used to meet demand for that quarter.
• During each quarter, Sailco can produce up to 40 sailboats with regular-time labor at a total cost
of $400 per sailboat. By having employees work overtime during a quarter, Sailco can produce
additional sailboats with overtime labor at a total cost of $450 per sailboat.
• At the end of each quarter (after production has occurred and the current quarter’s demand has
been satisfied), a carrying or holding cost of $20 per sailboat is incurred.
• Use linear programming to determine a production schedule to minimize the sum of production
and inventory costs during the next four quarters.

IE 311 55
Sailco Inventory (Winston, page 101)

IE 311 56

You might also like