110 - Yashar - MIP With Excel Solver
110 - Yashar - MIP With Excel Solver
110-1
Abstract
1. Introduction
1
PhD student, School of Mining, University of Alberta
Pourrahimian Y. & Askari-Nasab H. 110-2
minimizes the chance of deviating from the production target. This was done using the
Simulated Annealing Meta-Heuristic method (Godoy et al., 2004).
Ramazan (Ramazan et al., 2004) suggested an MIP model that accommodates grade
uncertainty. In this method, after obtaining simulated orebody models, scheduling patterns
on each model is generated using traditional MIP formulation (with the objective of NPV
maximization). Then the excavation probability of each block in a given time period is
calculated. The block with probability between zero and one, are considered in a new
optimization model.
Caccetta and Hill solved a binary integer programming (BIP) formulation with an efficient
branching scheme and briefly outlined some aspects of a specialized branch-and-cut
algorithm (Caccetta et al., 2003). Golamnejad (Golamnejad et al., 2006) presented a
chance constrained binary integer programming model. The model integrates ore grade
uncertainty explicitly and economic and mining considerations to generate an optimal life
of mine production schedule to meet the required targets with a high level of confidence
and low risk.
Boland (Boland et al., 2006) extend the BIP formulation of Caccetta and Hill to include
more than two ore attributes and develop knapsack cover inequalities that significantly
decrease the computational requirements to obtain the optimal integer solution.
Fricke (Fricke, 2006; Boland et al., 2009) described an MIP formulation, using ideas from
the formulation of Menabde et al., which is a generalisation of the BIP formulation of
Caccetta and Hill and Boland. The computational experiments conducted by Fricke show
that this generalization is particularly effective.
Mixed integer programming (MIP) has become a common approach for optimizing
production schedules of open pit mines. However, MIP has been found to be limited by:
(a) feasibility in generating optimal solutions with practical mining schedules; and (b)
inability to deal with in-situ variability of orebodies. In long-term production scheduling of
open pit mines, MIP models are usually constructed to maximize the overall net present
value (NPV) of the mining project (Ramazan et al., 2004).
A key limitation in past MIP models has been difficulty in solving large problems, as these
require a substantial number of binary variables. The attempted LP-based models often
generate fractional mining of blocks, leading to the design becoming infeasible and/or non-
optimal. Ramazan (Ramazan et al., 2004) proposed a new method based on the
fundamental tree concept, and substantially decreases the number of binary variables in
MIP formulations for long-term production scheduling. Ramazan(Ramazan et al., 2004)
presented alternative methodologies useful in reducing the number of binary variables in
MIP models. Although the above methods significantly decrease the number of binary
variables required and enhance the application of MIP in large mineral deposits, in-situ
orebody variability is not considered and all inputs are considered without uncertainty.
Pourrahimian Y. & Askari-Nasab H. 110-3
A major element of mine planning is the optimization of production scheduling. The aim is
to maximize the overall discounted economic value of a mine within operational
constraints such as mining slope, grade blending, ore production and mining capacity.
Integer programming (IP) and linear programming (LP) mathematical models are
considered to be powerful tools in optimizing mine scheduling, and there have been major
efforts in applying them to mining projects (Ramazan et al., 2004).
Linear programming uses a mathematical model to describe the problem of concern. The
adjective linear means that all the mathematical functions in this model are required to be
linear functions. The word programming does not refer here to computer programming;
rather, it is essentially a synonym for planning. Thus, linear programming involves the
planning of activities to obtain an optimal result, a result that reaches the specified goal
best (according to the mathematical model) among all feasible alternatives (Hillier, 2005).
In many practical problems, the decision variables actually make sense only if they have
integer values. If requiring integer values is the only way in which a problem deviates from
a linear programming formulation, then it is an integer programming (IP) problem. The
mathematical model for integer programming is the linear programming model with one
additional restriction that the variables must have integer values. If only some of the
variables are required to have integer values (so the divisibility assumption holds for the
rest), this model is referred to as mixed integer programming (MIP). With just two choices,
we can represent such decisions by decision variables that are restricted to just two values,
say 0 and 1. Thus, the j th yes-or-no decision would be represented by, say, x j such that
1 If decision j is yes.
xj =
0 If decision j is no.
Such variables are called binary variables (or 0–1 variables). Consequently, IP problems
that contain only binary variables sometimes are called binary integer programming (BIP)
problems (or 0–1 integer programming problems) (Hillier, 2005).
MIP models are generally used to maximize the overall discounted economic value, or net
present value (NPV), of a mining project. For this purpose and production scheduling for a
bench of mine the following objective function can be used.
Pourrahimian Y. & Askari-Nasab H. 110-4
T N
BEVnt
Maximize ∑∑ × X nt (2)
n =1 (1 + i )
t
t =1
Where T is the maximum number of scheduling periods, N is the total number of blocks to
be scheduled, BEVnt is the block economic value of block n in period t, i is interest rate
and X nt is a binary variable, equal to 1 if the block n is to be mined in period t, otherwise 0.
The average grade of material sent to the mill has to be less than or equal to a certain grade
value, Gmax , for each period, t (Ramazan et al., 2004).
N
∑ (g
n =1
n − G max ) × Ot n × X nt ≤ 0 (3)
Where g n is the average grade of block n, and Ot n is the ore tonnage in block n.
The average grade of the material sent to the mill has to be greater than or equal to a
certain grade value, Gmin , for each period, t (Ramazan et al., 2004).
N
∑ (g
n =1
n − Gmin ) × Ot n × X nt ≥ 0 (4)
Reserve constraints are constructed for each of the blocks to state that all the blocks in the
model considered have to be mined once (Ramazan et al., 2004).
T
∑X
t =1
t
n =1 (5)
The total tonnage of ore processed cannot be more than the processing capacity ( PC max ) in
any period, t (Ramazan et al., 2004).
N
∑ (Ot
n =1
n × X nt ) ≤ PC max (6)
The total tonnage of ore processed cannot be less than a certain amount ( PC min ) in any
period, t (Ramazan et al., 2004).
Pourrahimian Y. & Askari-Nasab H. 110-5
∑ (Ot
n =1
n × X nt ) ≥ PC min (7)
The total amount of material (waste and ore) to be mined cannot be more than the total
available equipment capacity ( MC max ) for each period, t (Ramazan et al., 2004).
∑ (Ot
n =1
n + Wn ) × X nt ≤ MC max (8)
∑ (Ot
n =1
n + Wn ) × X nt ≥ MC min (9)
Note: In this formulation mine equipment mobility has not been considered.
4. Illustrative example
A plan view of 24 blocks and average grade of ore in each block are shown in Figures 1
and 2, respectively. In calculating the values per ton(st) of blocks, it is assumed that the
product price is $250/t, ore and waste mining cost are $25/t, processing cost is $40/t, the
recovery factor is 70% and the specific weight of ore and waste are 2.7 and 2.4 t/m3
respectively.
The goal is to schedule the extraction of blocks in three periods. The objective is to
maximize the summation of discounted economic block values, while extracting all the 24
blocks. Table 1, shows each block economic value calculated by Equation (10).
Fig 2. Plan view is showing the average grade (MWT %) of each block.
MWT (magnetic weight recovery)
Where Otn is the total amount of ore in the block n (t), gn is the average grade of nth block
(%), P is the price of product ($/t), R is the proportion of the product recovered by
processing the ore (%), Cp is the cost of the processing ($/t), Wtn is the total amount of
waste in the block n (t), BTn is the block tonnage that is equal to (Otn + Wtn) and Cm is the
cost of the mining for ore and waste ($/t).
To solve this problem, Excel Solver was used. Solver is a free add-in package for Excel. A
more powerful version – Premium Solver – is commercially available for optimization on
an industrial scale. Solver allows us to specify restrictions, or constraints, for cell values.
For example, we can specify that certain cell values must be equal to, higher than, or lower
than a given number. In fact, we can specify up to 500 constraints in a Solver problem,
consisting of up to two constraints with up to 200 changing cells per constraint, plus 100
additional constraints. Actually, when the Solver Options dialog box’s Assume Linear
Model check box is selected, there is theoretically no limit to the number of constraints.
The number of binary variables required for the MIP model is equal to the number of
blocks in the model (in this case=24) multiplied by the total periods (in this case=3) to be
scheduled, as can be seen in the formulations above.
For mining capacity constraints, following boundaries were used:
1st ,2 nd , 3 rd years 65,000 (t ) ≤ Mining capacity ≤ 75,000 (t )
Processing capacity that was used as constraint for all periods was same and it was
between 55,000 (t) and 60,000 (t).
To use Excel to solve LP problems the Solver add-in must be included. Typically this
feature is not installed by default when Excel is first setup on your hard disk. To add this
facility to your Tools menu you need to carry out the following steps:
1. Select the menu option Tools → Add-Ins (this will take few moments to load the
necessary file).
Pourrahimian Y. & Askari-Nasab H. 110-7
2. From the dialogue box presented check the box for Solver Add-In.
Table 1. Economic Block Value (volume of each block is equal to 15×15×15 (m3))
BL
Grade (%) waste (st) Ore(st) Cost ($) Revenue($) EBV×108 ($)
No.
BL 1 87 0 9112.5 592312.5 138,145,500.00 1.38
3. On clicking OK, you will then be able to access the Solver option from the new
menu option Tools → Solver
An optimization model has three parts: the target cell, the changing cells, and the
constraints.
• Target cell: The target cell represents the objective or goal. We want to either
minimize or maximize the target cell. In our example of a mine production
scheduling, we want to maximize the discounted cash flow.
• Changing cells: The changing cells are the spreadsheet cells that we can change or
adjust to optimize the target cell. In the other word, these cells are solution of the
problem.
• Constraints: The constraints are restrictions you place on the changing cells.
Software must adhere to these constraints as it tries to change the adjustable cells
to meet the objective.
• Model: A model is the set of target cell, all changing cells and any constraints for
the current problem that you want to solve.
To solve this problem, first the solution section was setup as illustrated in figure 3. The
cells C3:E26 are changing cells or solution of the problem. In column F, each cell from F3
to F26 is equal to sum of solutions in related row. For instance cell F3=sum (C3:E3) and
cell F25=sum (C25:E25). Sum of solutions for each period is written in row 28 and under
each period in front of total. For instance cell C28=sum (C3:C26).
Figure 4 shows how constraints of grade blending have been set up in Excel. There are two
different parts. Cells H3:J26 for equation (4) and cells K3:M26 for equation (3). In this
problem, according to grades in table 1, Gmin = 0 and Gmax = 0.95 . Value of each cell H3
through to J26 is calculated as follows:
H11=(B11-0)×G11×C11, I11=(B11-0) ×G11×D11 , J11=(B11-0) ×G11×E11
For equation (4), value of each cell K3 through to M26 is calculated as follows:
K18=(B18-0.95) ×G18×C18, L18=(B18-0.95) ×G18×D18, M18=(B18-0.95) ×G18×E18
The cells H28 to M28 are equal to sum of cell values from row 3 to row 26 above each of
them. The cells H28 through to J28 indicate equation (4) in periods 1, 2 and 3 and the cells
K28 through to M28 indicate equation (3) in periods 1, 2 and 3.
Figure 5 shows how constraints of mining capacity and processing capacity have been set
up in Excel. There are two different parts. Cells S3:U26 for equations (8) and (9) and cells
W3:Y26 for equations (6) and (7). Value of each cell S3 through to U26 is calculated as
follows:
S14=R14 ×C14, T14=R14 ×D14, U14=R14×E11
Value of each cell W3 through to Y26 is calculated as follows:
W7=V7×C7, X7=V7 ×D7, Y7=V7×E7
The cells S28 through to Y28 are equal to sum of cell values from row 3 to row 26 above
each of them. The cells S28 through to U28 indicate equations (8) and (9) in periods 1, 2
Pourrahimian Y. & Askari-Nasab H. 110-9
and 3 and the cells W28 through to Y28 indicate equations (6) and (7) in periods 1, 2 and
3.
Fig 3. The part of worksheet that was used for setting up solution of problem
Pourrahimian Y. & Askari-Nasab H. 110-10
Fig 4. The part of worksheet that was used for setting up constraints (3) and (4)
Pourrahimian Y. & Askari-Nasab H. 110-11
Fig 5. The part of worksheet that was used for setting up constraints (6) to (9)
Setting up the objective function has been illustrated in figure 6. Value of cells N3:Q26 are
calculated using equation (11) for each block according to the period of extraction.
BEVnt
× X nt (11)
(1 + i ) t
Where BEVnt is the block economic value of block n in period t, i is interest rate and X nt is
a binary variable, equal to 1 if the block n is to be mined in period t, otherwise 0.
The cells O28 through to Q28 are equal to sum of cell values from row 3 to row 26 above
each of them. The cell P30 is target cell that must be maximized and it is equal to sum of
cells O28 through Q28.
Pourrahimian Y. & Askari-Nasab H. 110-12
Fig 6. The part of worksheet that was used for setting up objective function
To use Excel Solver with the objective of discounted cash flow maximization of a mine
production schedule, the following steps must be followed:
1.Click Tools → Solver
2. Click Reset All, and then click OK to clear Solver’s existing settings.
3. Click the Set Target Cell box, and then click cell P30
4.Click Max
5. Click the By Changing Cells box, and then select cells C3 through E26
6. Click Add
7. Click the Cell Reference box, and then select cells C3 through E26
8. In the operator list between the Cell Reference and constraint boxes, select bin.
9. Click Add.
10. Click the Cell reference box, and then select cell F3
Pourrahimian Y. & Askari-Nasab H. 110-13
47.Click OK
48. Click Option
49. Select the Assume Linear Model and Use Automatic Scaling check boxes, and then
click OK.
50. Click Solve
.
Pourrahimian Y. & Askari-Nasab H. 110-15
Fig 7. Solution of the problem that was obtained using Excel solver
Table 2. Summary of obtained results for each period using Excel Solver
BEVn
f =∑ 7.348×108 4.493×108 4.785×108
(1 + i ) t
3 24
BEVnt
∑∑
t =1 n =1 (1 + i )
t 16.626×108
80
70
60
Tonnage (X10 3)
50
Waste
40
Ore
30
20
10
0
Period 1 Period 2 Period 3
80
75
Mining rate
Tonnage (X10 3)
70 MCmax
MCmin
65
Processing rate
60 PCmax
PCmin
55
50
1 2 3
Period
Fig 10. Relationship between PCmax, PCmin, MCmax, MCmin and obtained solution
6. Conclusions
This paper was a general review of open pit mining scheduling problem definition. Several
optimization methods have appeared in the literature, but among of those optimization
techniques, mixed integer programming is recognized as having significant potential for
optimizing production planning in open pit mines with the objective of maximizing the
discounted cash flow. Review of previous studies about MIP shows in open pit mines with
many numbers of block, modeling and formulation of production planning need too many
binary variables and this makes it very difficult or impossible to solve with the current
state of hardware and software.
A step by step guideline for using the Excel Solver for solving MIP models was
documented in conjunction with an illustrative example. The results show that we can use
the Excel Solver software for a bench by bench short-term production scheduling.
Pourrahimian Y. & Askari-Nasab H. 110-18
7. References
[1] Boland, N., Dumitrescu, I., Froyland, G., and Gleixner, A. M., (2009), "LP-based
disaggregation approaches to solving the open pit mining production scheduling
problem with block processing selectivity", Computers & Operations Research,
Vol. 36, 4, pp. 1064-1089.
[2] Boland, N., Frick, C., and Froyland, G., (2006), "A strengthened formulation for
the open pit mine production scheduling problem", Optimization online: an eprint
site for the optimization community, © Retrieved from: http//:optimization-
online.org/DB_HTML/2007/03/1624.html
[3] Caccetta, L. and Hill, S., (2003), "An application of branch and cut to open pit mine
scheduling", Journal of Global optimization, Vol. 27, pp. 349-365.
[4] Denby, D. B. and Schofield, D., (1995), "Inclusion of risk assessment in open pit
design and scheduling", Trans. Instn Min. Metall.(Sec.A: Min Industry), Vol. 104,
pp. A67-A71.
[5] Dowd, P. A., (1994), "Risk assessment in reserve estimationand open pit planning",
Sec.A: Min. Industry, The Institution of mining and Metallurgy, Vol. 103, pp.
A148-A154.
[6] Fricke, C., (2006), "Application of integer programming in open pit
mining",Thesis, © The university of Melbourne,
[7] Godoy, M. C. and Dimitrakopoulos, R., (2004), "Managing risk and waste mining
in long-term production scheduling of open pit mine", in Proceedings of SME
Transaction, © pp. 43-50.
[8] Golamnejad, J., Osanloo, M., and Karimi, B., (2006), "A chance-constrainted
programming approach for open pit long-term production scheduling in stochastic
enviroments", Journal of the South African institute of Mining and Metallurgy, Vol.
106, pp. 105-114.
[9] Hillier, F. S., (2005), "Introduction to operation research", © McGraw-Hill, Pages
1061.
[10] Ramazan, S. and Dimitrakopoulos, R., (2003), "Production scheduling optimization
in Nickel laterite deposit: MIP and LP application and in the presence of orebody
variability mine", in Proceedings of MPES2003, © pp. 1-5.
[11] Ramazan, S. and Dimitrakopoulos, R., (2004), "Recent applications of operations
research and efficient MIP formulation in open pit mining", Transactions of the
Society for Mining,Metallurgy and Exploration, Vol. 316, pp. 73-78.
[12] Ramazan, S. and Dimitrakopoulos, R., (2004), "Traditional and new MIP models
for production scheduling with in-situ grade variability", International Journal of
Surface Mining, Reclamation and Environment, Vol. 18, pp. 85-98.