A Healthy Diet Decision Maths in the Workplace

advertisement
Decision Maths in the Workplace –
some examples
A Healthy Diet
(H.P.Williams; Model Building in Mathematical Programming; John Wiley)
There are two parts to this problem, one concerned with producing a production plan
for a margarine manufacturer for a month, and one for a quarter.
The Monthly Production Problem
A margarine is made by refining and blending raw oils. There are 3 different
vegetable oils (V1, V2 and V3) and 2 non-vegetable oils (N1 and N2). In any month
it is not possible to refine more than 250 tonnes of vegetable oil and 200 tonnes of
non-vegetable oil.
The final product must have a hardness which is between 3 and 6 on the scale on
which hardness is measured. Hardness blends linearly, ie. the hardness of a blend of
v1h1 + v2h2
v1 tonnes of V1 and v2 tonnes of V2 is
v1 + v2 , where h1 is the hardness of
V1 and h2 is the hardness of V2.
The hardness and costs per tonne of the raw oils are shown in the table.
Hardness
Cost per tonne (£)
V1
V2
V3
N1
N2
8
6
5
2
4
200
220
240
250
210
The final product sells for £300 per tonne.
The inequality corresponding to the lower bound on hardness may be simplified to:
– 5v1 –3v2 – 2v3 + n1 – n2 ≤ 0.
See if you can see why this is, and produce the inequality corresponding to the upper
constraint.
Look at "MONTH". See if you can follow the rest of the formulation, including the
objective function. Run it and interpret and report on the results.
PTO
The Quarterly Production Problem
The problem described above is one that the manufacturing company needs to solve
each month. In addition the company has the use of a store in which up to 500 tonnes
of each oil may be stored, subject to a cost of £10 per tonne per month for the cost of
refrigeration.
Prices now (June), and in the futures market, are shown in the table (in £/tonne).
June
July
August
V1
200
230
235
V2
220
215
225
V3
240
250
230
N1
250
240
235
N2
210
200
220
A purchasing and production plan is required for the 3 months shown. There are
currently 250 tonnes of each oil in storage, and it is required that there should be 250
tonnes of each in storage at the end of August.
Let v1b1 be the number of tonnes of V1 bought in June.
Let v1u1 be the number of tonnes of V1 used in June.
Let v1s1 be the number of tonnes of V1 stored in June.
Similarly for July and August (except that storage variables are not needed for
August, because of the 250 tonnes requirement).
To build an LP to model the quarter you'll need several "blocks" of constraints:
A block which ensures that the hardness constraints are satisfied.
A block which ensures that the production constraints are satisfied.
Constraints which link the amounts bought, used and stored for each oil in each
month.
The objective function will have to take account of the costs of purchase and of
storage.
Build a program, interpret the results, and report. In particular, is your solution
unique?
MONTH
MAX 100 V1 + 80 V2 + 60 V3 + 50 N1 + 90 N2
SUBJECT TO
2) –5 V1 – 3V2 – 2V3 + N1 – N2 <= 0
3) 2V1 – V3 – 4N1 – 2N2
<= 0
4)
V1 + V2 + V3
<= 250
5)
N1 + N2
<= 200
END
Cutting-stock problems. (Notes provided by A J Haggett, University of Brighton)
In many industrial applications, large items are cut down to more useable sizes.
Typically this can occur with large rolls of steel being cut down to give narrower rolls
of steel of required widths, or industrially produced rolls of paper being cut to
narrower widths. Plastics, cling-film, and rolls of silk are cut down in a similar way.
Surplus steel rolls may be melted down to use again, but excess paper or silk may go
to waste.
The rolls are cut by adjusting the position and number of large circular saws, which
slice through the original rolls of material. In the paper industry, the process of
deciding how to cut enormous drums of paper into smaller reels is known as
“deckling”. The equivalent problem in other industries is known as the cutting stock
problem.
These industrial processes lead to mathematical problems which may require
hundreds or even thousands of variables. (We ignore the time required to change the
arrangements of the circular saws, but this might be introduced in a more
sophisticated analysis of the problem). Mathematical approaches to these types of
problems involve linear programming, dynamic programming, tabu search, genetic
algorithms and ant-colony algorithms
This has given rise to a classical problem in Operational Research, known as “cutting
stock”, “stock-cutting”, “stock slitting” or “trim loss”. The initial part of the problem
requires us to calculate efficient cutting plans, a mathematical procedure known as
“column generation”. We then formulate a linear programming problem to find out
how many rolls are cut using each efficient cutting plan. We shall consider problems
which have been devised to require only a few variables.
There is an obvious extension of the problem to two dimensions, where patterns are
cut out of a flat surface (of card or material), on an industrial scale. Flat-pack furniture
may have components cut from a single piece of wood, and this is done many times
over. Determining the efficient cutting plans may be very difficult. In three
dimensions, the techniques are used for bin-packing problems, where a number of
differently shaped items are to be loaded on a pallet or in a container.
Ref: Syam Menon and Linus Schrage, Operations Research INFORMS, volume 50, no. 2, MarchApril 2002, page 324 – 332. www.extenza-eps.com/extenza/loadPDF?objectIDValue=427
See also D1 text book, page 146, exercise 5 (3rd edition)
Cutting-stock (Trim –Loss) problems.
1.
A certain paper machine produces paper in reels of a standard width, 180
inches. These are cut down to smaller widths as required by customers. A set of
customer orders is summarized below:
Width (inches)
Number of reels ordered
80
45
27
200
120
130
These narrower reels are cut from the standard with reels. Determine the
efficient cutting plans and solve this as a linear programming problem with the
objective of minimizing the waste. Compare the solution if the objective is to
minimize the overproduction.
2.
Find the efficient cutting plans for slitting standard rolls of paper of width 20",
when orders are required for rolls of width 6", 8", and 11".
Formulate linear programming models for the following orders for the problem:
Width
No. of rolls
3.
6
245
8
140
11
225
Find the efficient cutting plans for slitting standard rolls of paper of width 20",
when orders are required for rolls of width 5", 6", 7", 8", 9" and 11".
Formulate linear programming models for the following orders for the problem:
Width
No. of rolls
5
100
6
250
9
150
11
175
4.
Solve the problems in questions 2 and 3 and interpret the solution in each case.
Calculate the waste involved in the solution.
5.
The company now decides to use two standard rolls of width 20" and 30".
Reformulate the problems in questions 3 and 4, and find the new solution in
each case.
6.
Determine the feasible cutting plans for the deckling problem where 15-foot
boards are cut to meet the following requirements: 80 4-foot boards, 50 6-foot
boards, and 100 7-foot boards. Formulate this as a linear programming
problem and solve it using LINDO.
Observe the number of iterations that LINDO takes to solve these integer
programming problems, as the number of cutting plans increases. Investigate solving
these problems with alternative objective function which do or do not take into
account the waste.
Close to home!
Suppose that an A level candidate in a particular specification has marks in 15 units
and presents them for cashing in for two A levels. Consider the problem of awarding
the best possible pair of grades, forgetting, in the best tradition of mathematical
modelling, all of the constraints on AS and A2 units, etc. We can easily choose the
best 6 units and thus decide what will be the candidate's best grade. But we must then
start again and choose 6 units to give that best grade whilst ensuring that the
remaining units give the best possible second grade. The complete enumeration
involves an impractical 420420 possibilities – 15 C 6 × 9 C 6 . But the problem can be
specified as an integer linear programming problem, and we show a formulation
below.
Let m1, m2, m3, …, m15 be the marks on the 15 units.
Let M be the minimum mark which achieves the grade determined by the best 6 of the
marks.
Let x1, x2, x3, …, x15 be indicator variables, with xi = 1 if unit number i is chosen for
the first A level, and 0 otherwise.
Let y1, y2, y3, …, y15 be indicator variables, with yi = 1 if unit number i is chosen for
the second A level, and 0 otherwise.
Then the grading problem can be formulated (in LINDO syntax) as:
MAX
ST
15
∑y m
i
∑x m
i
i
∑x
i
=6
ensures that the first A level has 6 units
∑y
i
=6
ensures that the second A level has 6 units
i =1
15
i =1
15
i =1
15
i =1
i
chooses the best for the second A level
≥M
ensures that the first A level has the required grade
xi + yi ≤ 1 for each of i=1, i=2, …, i=15
fifteen constraints, ensuring that a unit can be used
at most once
END
INT 30
defines the variables to be 0/1 indicator variables
LINDO will solve this problem efficiently using branch and bound.
application solved the problem almost instantly in 40 steps.
A trial
More (outline) examples
The following LPs are intended to give some idea of the ubiquity of LP. The
problems which they tackle are tiny, and are used only to illustrate the approach.
Explanations are not furnished, the reader being invited to interpret the objective and
the constraints.
A shortest
path
problem:
B
4
2
A
1
D
2
4
C
A network
flow
problem:
B
4
2
S
1
T
2
4
C
A matching
problem:
A
B
C
D
1
x
x
2
3
x
x
x
x
4
x
MIN 2AB+4BD+4AC+2CD+BC+CB
ST AB+AC=1
AB+CB-BC-BD=0
AC+BC-CB-CD=0
BD+CD=1
END
MAX SB+SC
ST SB+CB-BC-BT=0
SC+BC-CB-CT=0
SB<=2
BT<=4
SC<=4
CT<=2
BC<=1
CB<=1
END
MAX A1+A4+B1+B3+C2+C3+D3
ST A1+A4<=1
B1+B3<=1
C2+C3<=1
D3<=1
A1+B1<=1
C2<=1
B3+C3+D3<=1
A4<=1
END
An
allocation
problem:
A
B
C
D
A
transportation 3
problem:
6
9
2
An
envelope
problem:
cost
A
B
C
D
1
5
1
5
4
2
2
7
8
4
5
1
5
1
5
4
3
3
2
3
2
5
2
2
7
8
4
MIN 5A1+2A2+3A3+6A4+B1+7B2
+2B3+4B4+5C1+8C2+3C3+C4
+4D1+4D2+2D3+6D4
ST A1+A2+A3+A4=1
B1+B2+B3+B4=1
C1+C2+C3+C4=1
D1+D2+D3+D4=1
A1+B1+C1+D1=1
A2+B2+C2+D2=1
A3+B3+C3+D3=1
A4+B4+C4+D4=1
END
4
6
4
1
6
5
3
3
2
3
2
5
4
6
4
1
6
MIN 5A1+2A2+3A3+6A4+B1+7B2
+2B3+4B4+5C1+8C2+3C3+C4
+4D1+4D2+2D3+6D4
ST A1+A2+A3+A4=3
B1+B2+B3+B4=6
C1+C2+C3+C4=9
D1+D2+D3+D4=2
A1+B1+C1+D1=5
A2+B2+C2+D2=5
A3+B3+C3+D3=5
A4+B4+C4+D4=5
END
MIN 8λ1+3λ2+6λ3+2λ4+4λ5
ST λ1+2λ2+3λ3+4λ4+5λ5–
X=0
λ1<=1
λ2<=1
λ3<=1
λ4<=1
λ5<=1
capacity
λ1+λ2+λ3+λ4+λ5>=1
X = 3.8
END
The final problem is too opaque to leave without any explanation. It occurred as the
solution to a practical problem involving the minimisation of pumping costs. The
pumps have capacities of 1, 2, 3, 4 and 5 units per day. Their costs are 8, 3, 6, 2 and 4
per day respectively. Pumps can be employed for part of a day (the λs) and at least
one pump must be in operation at all times. The amount that is required is set to 3.8
in the example. The solution to the LP gives the cheapest combination of pumps to
deliver the required amount.
Download