You are on page 1of 29

Operational Research

Autonomous work:
Exercises about
linear programming
Patrick Meyer
& Mehrdad Mohammadi
IMT Atlantique
Part 1 : Linear Programming
A few formulation and resolution exercises

OR: Exercises & LP


P. Meyer & M. Mohammadi
LP-Exercises 3
Exercise 1 : Blueberry

Blueberry makes quarterly decisions about their product mix. We consider that they
produce notebook computers and desktop computers.
There are a number of limits on what Blueberry can produce. The major constraints
are as follows :
- Each computer (either notebook or desktop) requires a Processing Chip. Due to
tightness in the market, the supplier has allocated 10,000 such chips to
Blueberry ;
- Each computer requires memory. Memory comes in 4 GB chip sets. A notebook
computer has 4 GB memory installed (so needs 1 chip set) while a desktop
computer has 8 GB (so requires 2 chip sets). Blueberry has a stock of 15,000
chip sets to use over the next quarter ;
- Each computer requires assembly time. Due to tight tolerances, a notebook
computer takes more time to assemble : 4 minutes versus 3 minutes for a
desktop. There are 25,000 minutes of assembly time available in the next quarter.

OR: Exercises & LP


P. Meyer & M. Mohammadi
LP-Exercises 4
Exercise 1

Given the current market conditions, material cost, and the production
system, each notebook computer produced generates 750 USD profit,
and each desktop produces 1000 USD profit.
How many of each type computer should Blueberry produce in the
next quarter in order to maximize its profit ?

- Formulate this problem as a linear program ;


- Solve it graphically ;

OR: Exercises & LP


P. Meyer & M. Mohammadi
LP-Exercises 5
Exercise 1
Solution :
- Decision variables :
- x1 : number of 1000 notebooks to produce ;
- x2 : number of 1000 desktops to produce.

- Objective :
- max 750x1 + 1000x2

OR: Exercises & LP


P. Meyer & M. Mohammadi
LP-Exercises 6
Exercise 1
Solution :
- Constraints :
- Processing chips : x1 + x2 ≤ 10 ;
- Memory chips : x1 + 2x2 ≤ 15 ;
- Assembling : 4x1 + 3x2 ≤ 25 ;
- Non-negativity : x1 , x2 ≥ 0.

- Summary of the LP :

OR: Exercises & LP


P. Meyer & M. Mohammadi
LP-Exercises 7
Exercise 1
Solution :
- Graphical resolution :

Observation : the
processing chips constraint
is useless !

The constraints and the feasible region

OR: Exercises & LP


P. Meyer & M. Mohammadi
LP-Exercises 8
Exercise 1
Solution :
- Graphical resolution :

- Optimal solution in
x1 = 1 and x2 = 7 ;

- Produce 1000 laptops


and 7000 desktops for a
profit of 7,750,000 USD.

Finding the optimal profit

OR: Exercises & LP


P. Meyer & M. Mohammadi
LP-Exercises 9
Exercise 2 (Dantzig 1963)

- Suppose that the two canneries of a distributor are located in


Seattle and San Diego. The canneries can fill 350 and 650 cases
of tins per day, respectively.

- The distributor operates three warehouses around the country, in


New York, Chicago and Kansas City. Each of the warehouses can
sell 300 cases per day.

- The distributor wishes to determine the number of cases to be


shipped from the two canneries to the three warehouses so that
each warehouse should obtain as many cases as it can sell daily
at the minimum total transportation cost.

OR: Exercises & LP


P. Meyer & M. Mohammadi
LP-Exercises 10
Exercise 2 (Dantzig 1963)

- The problem is characterized by the following distance matrix (in


thousands of miles) :

- The freight per case per thousand miles is 90 USD.

- Formulate this problem as a linear program.

OR: Exercises & LP


P. Meyer & M. Mohammadi
LP-Exercises 11
Exercise 2 : solution

- Decision variables :
- x11 ≥ 0 number of cases to be shipped from I to A
- x12 ≥ 0 number of cases to be shipped from I to B
- x13 ≥ 0 number of cases to be shipped from I to C
- x21 ≥ 0 number of cases to be shipped from II to A
- x22 ≥ 0 number of cases to be shipped from II to B
- x23 ≥ 0 number of cases to be shipped from II to C

OR: Exercises & LP


P. Meyer & M. Mohammadi
LP-Exercises 12
Exercise 2 : solution

- Parameters : transport costs in thousands of USD / case


- c11 = 90 ∗ 2.5 = 225 (between I and A)
- c12 = 153 (between I and B)
- c13 = 162 (between I and C)
- c21 = 225 (between II and A)
- c22 = 162 (between II and B)
- c23 = 126 (between II and C)
- Objective function :

min 225·x11+153·x12+162·x13+225·x21+162·x22+126·x23

OR: Exercises & LP


P. Meyer & M. Mohammadi
LP-Exercises 13
Exercise 2 : solution
- Constraints :
- (supply limit at each plant) :

x11 + x12 + x13 ≤ 350

x21 + x22 + x23 ≤ 650


- (demand at each market) :

x11 + x21 ≥ 300

x12 + x22 ≥ 300

x13 + x23 ≥ 300

OR: Exercises & LP


P. Meyer & M. Mohammadi
LP-Exercises 14
Exercise 3 : diet

- An ideal diet would meet or exceed basic nutritional requirements,


be inexpensive, have variety and be pleasing to the palate ;

- Suppose the available foods are the following :

OR: Exercises & LP


P. Meyer & M. Mohammadi
LP-Exercises 15
Exercise 3 : diet

- A satisfactory diet has at least 2000kcal of energy, 55g of protein


and 800mg of calcium (vitamins and iron are supplied by pills) ;

- Each food can only be served a certain number of times per day ;
- What is the least cost satisfactory diet ?
- Give only the formulation as a LP.

OR: Exercises & LP


P. Meyer & M. Mohammadi
LP-Exercises 16
Exercise 3
Solution :
- Decision variables :
- The foods are labelled from 1 to 6 ;
- xi , i = 1, . . . 6 represents the number of servings of food i in the diet ;

- Objective :
- minimize cost ;
- min 3x1 + 24x2 + 13x3 + 9x4 + 20x5 + 19x6 .

OR: Exercises & LP


P. Meyer & M. Mohammadi
LP-Exercises 17
Exercise 3
Solution :
- Constraints :
- Energy, protein, calcium, serving / day limit.
- Formulation of the LP :

OR: Exercises & LP


P. Meyer & M. Mohammadi
LP-Exercises 18
Exercise 4 : restaurant

- A restaurant is open seven days a week ;

- Based on past experience, the number of workers needed on a


particular day is given as follows :

OR: Exercises & LP


P. Meyer & M. Mohammadi
LP-Exercises 19
Exercise 4 : restaurant

- Every worker works five consecutive days, and then takes two
days off, repeating this pattern indefinitely ;

- How can the number of workers be minimized ?

OR: Exercises & LP


P. Meyer & M. Mohammadi
LP-Exercises 20
Exercise 4
Solution :
- Decision variables (bad idea) :
- xi is the number of workers working on day i ;
- Typical solution : 15 workers on Monday, 13 on Tuesday, . . . ;
- Does not tell us how many workers are needed !

- Decision variables (good idea) :


- Let the days be numbered from 1 to 7 ;
- Let xi be the number of workers who begin their five day shift on day
i.

OR: Exercises & LP


P. Meyer & M. Mohammadi
LP-Exercises 21
Exercise 4
Solution :
- Objective :
- min x1 + x2 + . . . + x7

- Constraints :
- Who works on Monday ? Those who start their shift on Monday,
Thursday, Friday, Saturday, Sunday ;
- x1 + x4 + x5 + x6 + x7 ≥ 14
- ...

OR: Exercises & LP


P. Meyer & M. Mohammadi
LP-Exercises 22
Exercise 4
Solution :
- Formulation of the LP :

- Possibility to add different types of shifts if different costs.

OR: Exercises & LP


P. Meyer & M. Mohammadi
LP-Exercises 23
Exercise 5 : financial portfolio

- A mortgage team has 100,000,000 USD to finance various


investments ;
- Five categories of loans with various returns and risks (1-10, 1
best) :

OR: Exercises & LP


P. Meyer & M. Mohammadi
LP-Exercises 24
Exercise 5 : financial portfolio

- Uninvested money goes into a savings account with no risk and


3% return ;
- Allocate the money to the categories so as to :
- Maximize the average return per dollar ;
- Have an average risk of no more than 5 (averages and fractions on
the invested money, not the savings) ;
- Invest at least 20% of the loans in commercial loans ;
- The amount of second mortgages and personal loans combined
should be no higher than the amount in first mortgages.

OR: Exercises & LP


P. Meyer & M. Mohammadi
LP-Exercises 25
Exercise 5
Solution :
- Decision variables :
- Let the investments be numbered 1 to 5 ;
- Let xi be the amount invested in investment i, and xs be the amount
in the savings account.

- Objective :
- max 9x1 + 12x2 + 15x3 + 8x4 + 6x5 + 3xs

OR: Exercises & LP


P. Meyer & M. Mohammadi
LP-Exercises 26
Exercise 5
Solution :
- Constraints :
- Average risk :
3x1 + 6x2 + 8x3 + 2x4 + x5
≤5
x1 + x2 + x3 + x4 + x5

Equivalent linear constraint :


−2x1 + x2 + 3x3 − 3x4 − 4x5 ≤ 0

- Commercial loans :
x4 ≥ 0.2(x1 + x2 + x3 + x4 + x5 )

Equivalent linear constraint :


−0.2x1 − 0.2x2 − 0.2x3 + 0.8x4 − 0.2x5 ≥ 0

OR: Exercises & LP


P. Meyer & M. Mohammadi
LP-Exercises 27
Exercise 5
Solution :
- Constraints :
- Mortgages :
x2 + x3 − x1 ≤ 0
- Total amount :

x1 + x2 + x3 + x4 + x5 + xs ≤ 10.000.000

- Nonnegativity constraints.

OR: Exercises & LP


P. Meyer & M. Mohammadi
Part 2 : What now ?

OR: Exercises & LP


P. Meyer & M. Mohammadi
What now ? 29
Autonomous work

X Exercises
X Model decision problems as linear programs
X Solve certain of them graphically

- Case study
Read about the two topics
Watch videos
Decide which of the two topics you would like to study

OR: Exercises & LP


P. Meyer & M. Mohammadi

You might also like