You are on page 1of 13

Natural Resources Research, Vol. 31, No.

3, June 2022 (Ó 2022)


https://doi.org/10.1007/s11053-022-10035-w

Original Paper

An Open-Source Program for Efficiently Computing


Ultimate Pit Limits: MineFlow

Matthew Deutsch ,1,2 Kadri Dağdelen,1 and Thys Johnson1

Received 5 November 2021; accepted 16 February 2022


Published online: 17 March 2022

Solving the ultimate pit problem remains an important and relevant task in open pit mine
planning as a subroutine in sophisticated decision processes, parametric analysis, quantifying
the impact of geologic uncertainty, approaching more complicated problems such as pro-
duction scheduling, or as a subproblem in decomposition. Ultimate pit models often contain
dozens of millions of blocks and hundreds of millions of precedence constraints, and they
may need to be solved hundreds or even thousands of times. These requirements can quickly
overwhelm existing ultimate pit solvers. This paper introduces MineFlow: an open-source
C++ library providing efficient and flexible precedence schemes and a stripped down
pseudoflow-based solver. In a computational comparison with five modern commercial
packages, we show that MineFlow computes consistently identical results in a fraction of the
time; for example, with MineFlow a block model containing 16 million blocks is processed in
nine seconds, whereas the fastest commercial alternative takes two and a half minutes. These
improvements are realized by using implicit precedence schemes and by modifying slightly
the conventional pseudoflow algorithm. Additionally, we present a compact notation for the
pseudoflow algorithm to assist educators in presenting the latest in ultimate pit optimization.
KEY WORDS: Open pit mining, Ultimate pit problem, Long-term planning, Pseudoflow, Optimiza-
tion.

INTRODUCTION and optimization. One of the most foundational


problems for which operations research has been
Open pit mines are complicated to plan and used in mining is the ultimate pit problem.
execute in a manner that uses the earth’s mineral The ultimate pit problem is, at first look, con-
resources in a sustainable manner. Mining engineers, cerned with determining the final pit contour such
and other technologists in the mining industry, are that the subset of material providing the maximum
required to call on a diverse toolkit from a wide profit is extracted, and all unnecessary waste is left in
variety of disciplines to make the best decisions on a place (Fig. 1). This problem has borne the brunt of
day-to-day basis. Operations research has histori- legitimate criticism in recent years. The ultimate pit
cally been an important discipline in this toolkit ignores many of the complexities and realities of
because it uses concrete, justifiable, techniques mining including the time value of money, mine and
based on mathematical modeling, statistical analysis, mill capacities, stockpiling, selectivity, and more. It
has a very narrow focus and the ultimate pit as
1
identified at the beginning of a project will almost
Mining Engineering Department, Colorado School of Mines,
certainly not be the final extraction limits in part
Golden, CO, USA.
2
To whom correspondence should be addressed; e-mail: because certain realities cannot be captured in the
mvdeutsch@mines.edu

1175
1520-7439/22/0600-1175/0 Ó 2022 International Association for Mathematical Geosciences
1176 Deutsch et al.

contributions from researchers and users. The


underlying solver is a stripped-down reimplementa-
tion of the Pseudoflow algorithm (Hochbaum, 2008).
However, our implementation has been designed to
focus solely on the ultimate pit problem and places
heavy emphasis on speed and low memory use.
MineFlow is suitable for block models with hun-
dreds of millions of blocks and billions of implicit
precedence constraints.
In the next section, we give a thorough over-
Figure 1. An ultimate pit calculated with MineFlow. view of the ultimate pit problem and revisit the re-
quired theory and necessary background. We then
describe the pseudoflow algorithm along with our
initial model and because inputs will continue to modifications in detail and go through a small
change over time. example which introduces our shorthand notation.
Despite this, the narrow focus of the ultimate We believe that this compact notation is approach-
pit problem makes it useful as a subroutine in more able and will help educators to clearly communicate
complicated pursuits such as scheduling (Dı́az et al., the principles behind the pseudoflow algorithm. The
2021), sensitivity analysis, infrastructure placement penultimate section describes our open-source
(Deutsch et al., 2015), and the broader circular implementation and compares it with available
nature of long-range open pit mine design (Darling, commercial implementations.
2011). For example, the ultimate pit depends in part
on operating costs, which depend on what equip-
ment is used, and the best equipment to use depends BACKGROUND
on many factors including the total volume to be
extracted, the production rate, and lifetime of the Block Precedence
mine, which is dependent on its ultimate size. Open
pit planners then use iterative procedures through- Conventional open pit mine design is simplified
out the design process, within which the ultimate pit by dividing the operational area of interest into a
problem remains relevant. regular 3D block model. Each block within the
The straightforward nature of the ultimate pit model contains numeric and categorical attributes,
problem allows for sophisticated decision processes which are estimated or simulated through geosta-
to be built on top of it and carries with it a mathe- tistical processes. These local attributes and other
matical structure that enables efficient algorithms. global parameters are then used to calculate an
Historically, implementations of these algorithms economic block value for each block, which roughly
have been locked within expensive commercial indicates the profit, often negative, if that block was
packages or restricted behind non-permissive soft- mined. This is not a simple calculation, and there are
ware licenses. This software landscape serves to limit many considerations; for our purposes, we consid-
productivity and research output. This holds the ered the appropriate discretization and valuation of
mining industry back by limiting innovation and the deposit as known inputs.
making creative applications of the ultimate pit The remaining parameter of interest is the
problem difficult. precedence constraints, which dictate the shape of
This paper introduces MineFlow, an open- the ultimate pit. Unlike underground mines, which
source software package for defining precedence use a variety of techniques to support the material
graphs and solving the ultimate pit problem. Mine- above the deposit, open pit mines proceed down-
Flow is provided by the Colorado School of Mines wards removing successive layers of material in a
and Newmont Corporation under the permissive roughly cone shape. The slope of the cone is based
MIT license, which ensures that it is free to use in on the strength of the material being mined, its
both academic and commercial settings. The code is geotechnical properties, and other structural geo-
available at https://github.com/MineFlowCSM/Mine logic factors. This slope will generally vary with
Flow. It is open-source to invite improvements and location and direction throughout the mining area.
An Open-Source Program for Efficiently Computing Ultimate Pit Limits 1177

Figure 2. Left: the ÔOne-fiveÕ precedence pattern extended 30 blocks vertically. Right: the 29 block min search
precedence pattern extended 30 blocks vertically.

Lerchs and Grossmann (1965) proposed the the set of target blocks B cb varies for each base
ÔOne-fiveÕ precedence pattern where each block is block. The final set of constraints ensure the pro-
connected to the five blocks immediately above it in portion of each block mined is between zero and
a cross-pattern. This scheme is locally precise but one. It is not necessary to restrict the values of Xb to
globally inaccurate as seen on the left in Figure 2. be integer as they will only assume integer values
Better precedence schemes are described in Cac- due to the structure of the model; a property called
cetta and Giannini (1988), who introduced a tech- total unimodularity.
nique for generating efficient Ôminimum search P
patternsÕ wherein the pit slopes can vary by direction maximize vb X b
b2B
and the pattern consists of a bare minimum of ^2Bcb
subject to Xb  Xb^  0 8b 2 B; b
precedence constraints. The 45-degree minimum
0  Xb  1 8b 2 B
search pattern for nine benches is shown on the right
in Figure 2, and when this pattern is extended ver- This formulation is useful for describing the
tically it closely resembles a cone. Further prece- ultimate pit problem; however, Lerchs and Gross-
dence schemes are described in Chen (1976), mann (1965) described originally the problem as a
Khalokakaie et al. (2000), and Gilani and Sattarvand network problem and not with linear programming.
(2015). This is a common topic in the literature, but They developed an algorithm for solving the ulti-
we sidestepped much of this discussion and take the mate pit problem that introduced necessary prece-
precedence constraints as given inputs. dence constraints iteratively, and this was the
algorithm of choice for many years after being
popularized by a commercial implementation from
Ultimate Pit Problem Whittle in 1985.
There have been many different techniques
The ultimate pit problem is formulated natu- developed to solve the ultimate pit problem. The
rally as a linear programming problem. A single floating cone algorithm from Pana (1965) is a
variable Xb 2 B represents the proportion of each heuristic method that does not guarantee an optimal
block that is mined where B is the set of all blocks. A solution but still finds use. Korobov (1974) improved
single parameter, vb 2 B, is the economic block va- on some of the floating cone algorithmÕs shortcom-
lue described above. The objective is to maximize ings; however, it also does not guarantee the optimal
the product of vb and Xb ; the final mined value. The solution. Zhao (1992) developed a variant of the
first set of constraints are the precedence con- Lerchs and Grossmann (1965) algorithm that guar-
straints. These define for each block, b, what other anteed optimal results and was found to be faster;
blocks, b^2B cb , must be mined before b. Note that however, ZhaoÕs method was not widely adopted in
1178 Deutsch et al.

industry. Mwangi et al. (2020) presented a review of In the ultimate pit problem, blocks are repre-
several approaches to the ultimate pit problem. sented as nodes and precedence constraints as di-
Johnson (1968) showed in detail how to express rected arcs. This is a special kind of network called a
the ultimate pit problem as a network flow problem. directed acyclic graph. Acyclic means that the net-
By taking the dual of the above linear programming work does not contain any directed cycles. A closure
formulation, and performing some appropriate of a directed network is a set of nodes such that
manipulations, an efficient construction that allows there are no arcs with their tails inside the closure
the ultimate pit problem to be solved with well- and their heads outside. In the ultimate pit problem,
known max flow/min cut algorithms is revealed. all closures of the network are valid pits because the
Solving the ultimate pit problem as a network flow restriction on directed arcs ensures there are no
problem is advantageous because network flow ap- precedence violations. An example closure is shown
proaches have benefitted from decades of dedicated on the right in Figure 3. The ultimate pit, therefore,
research. Ford and Fulkerson (1962) developed is the smallest maximum valued closure of the
much of the initial theory surrounding network flow precedence graph.
models and provided an initial algorithm for solving
them. In recent years, the Push–Relabel algorithm
of Goldberg and Tarjan (1988) and the Pseudoflow Network Flows and Cuts
algorithm of Hochbaum (2001) were preferred be-
cause they are faster. These modern network flow Networks are used to model many different
algorithms compute precisely the same results as the real-world problems, one of special interest to us is
venerable Lerchs and Grossmann (1965) algorithm network flow problems. In a network flow, each arc
but do not take near as long. has a maximum allowed capacity and an assigned
flow. Two special nodes are identified as the source,
denoted with an S, and the sink with a T. Flow
Network Terminology originates at S and terminates at T. Usually, every
other node must satisfy a flow-balance constraint
A network, or graph, is a mathematical struc- that requires that the amount of flow into the node
ture that models pairwise relationships between be equal to the amount leaving. Network models can
objects. Networks are used to represent things that be used to model fluids in pipes, power in an elec-
are both abstract and concrete. Many problems be- trical grid, traffic on roads, and other similar things
come simpler when thought of through the lens of (Ahuja et al., 1988). A small example network flow
networks because turning a real-world problem into model is shown in Figure 4. Flow is only permitted
a network requires one to think cogently about along the directed arcs, up to the capacity of the arc,
which of the components of the problem can be from their tail to their head.
combined and represented as nodes and then how In Figure 4, the current flow from S to T is four
best to model the relationships between those units; however, it is possible to route additional flow
components with directed or undirected arcs (Ahuja through this network. The bolded arcs through the
et al., 1988). middle of the network can carry one additional unit
A directed arc between two nodes indicates that of flow, and the path along the top could take an
it has a specific orientation. The beginning and additional two units. If both paths were saturated,
ending points of a directed arc are called the tail and the flow for this network would be seven, which is
head, respectively. An undirected arc between two the maximum flow.
nodes does not have an order and only indicates that In a network, there are many ways to cut the
a relationship exists between the nodes. network into two pieces. If the partitions are orga-
A sequence of arcs traversed in any direction nized such that one side contains the S and the other
between two different nodes is a path. Paths are de- side contains the T, then these two sets are called an
fined such that they only go through nodes and arcs at s-t cut. In an arbitrary cut, the arcs that cross from
most once. If a network is constructed such that any one partition to the other are said to be a part of the
two nodes are connected by exactly one path, it is cut-set. However, in s-t cuts, only arcs going from
called a tree; an example is on the left in Figure 3. the S side to the T side are included.
Often, trees have a special node designated as the root For the small network in Figure 4, there are
from which there could be many sub-trees or branches. four different possible s-t cuts (Fig. 5). Note that the
An Open-Source Program for Efficiently Computing Ultimate Pit Limits 1179

Figure 3. Left: a network that is a tree with associated terminology. Right: a network that is a directed acyclic graph.

tradiction. A very early discussion of this theorem


appears in Ford and Fulkerson (1962).

Source Sink Form

Johnson (1968) showed that it is possible to for-


mulate the ultimate pit problem as a max flow net-
work problem, whereby obtaining the max flow/
minimum cut defines the ultimate pit. In this con-
struction, each node represents a single block of the
original block model. Each node is connected by an
arc from the S to the node if it has a positive economic
Figure 4. An example network flow model. Source ÔSÕ and block value, and from the node to the T if negative.
sink ÔTÕ nodes are labeled. Numbers on arcs indicate ÔflowÕ/
The capacity for these arcs is the absolute value of the
ÔcapacityÕ. The bolded arcs show a possible augmenting
path. block’s economic value. Blocks with zero economic
value are not connected to the S or the T. Finally, for
cut-set corresponding to cut 4 consists only two arcs each precedence constraint there is an arc between
despite appearing to go through three. This is be- the lower and higher block with infinite capacity.
cause the middle arc, from b to a, goes from the T If this special network is solved for the max flow
side to the S side. The capacity of a s-t cut is the sum and minimum cut, then the blocks on the S side of the
of the arc’s capacities in its cut-set. The capacity for minimum cut correspond precisely to the ultimate pit
each possible cut in Figure 5 is given in Table 1. limits as shown on the right in Figure 6. The capacity
It so happens that the maximum possible flow of the minimum cut is nine, which is equal to the
through a network is equal to the capacity of the maximum flow through the network. The difference
minimum cut—this is formalized in the Max-Flow between the sum of the capacities of the S adjacent
Min-Cut theorem. Intuitively, the arcs in the cut-set arcs and the maximum flow is the ultimate pit value.
of the minimum cut correspond to the Ôbottle-neckÕ
of the network flow model. There is no way to fit
more flow through the cut-set without increasing its THE PSEUDOFLOW ALGORITHM
capacity, and if there was some other path around
the bottleneck, then it would not be a valid s-t cut. Preliminaries
Most formal proofs of this theorem confirm the
above intuition by showing that, if the max flow did In this section, we describe the pseudoflow
not equal the minimum cut, there would be a con- algorithm in a manner that is informative for pro-
1180 Deutsch et al.

Figure 5. Four different possible st cuts for the network in Figure 4. Numbers on arcs are the arcÕs capacity. The cut-set arcs are in
bold and the total cut capacity is shown below each cut.

Table 1. The source set, sink set, cut-set and capacity of the four relaxed flow where nodes are not required to satisfy
possible cuts for the graph in Figure 4 the flow balance constraints described in the Net-
st cut X X cut-set Capacity work Flows and Cuts section. Nodes that have more
inflow than outflow are said to have an excess and
1 fSg fa; b; T g fðS; aÞ; ðS; bÞg 9
2 fS; a; bg fT g fða; T Þ; ðb; T Þg 8
nodes with more outflow than inflow have a deficit.
3 fS; bg fa; T g fðS; aÞ; ðb; T Þg 7 On the left in Figure 7, we introduce our notation
4 fS; ag fb; T g fðS; bÞ; ða; T Þg 11 for the pseudoflow. The numbers on the arcs are the
current flow on the arc. If an arc does not have a
number, then the flow is zero. The numbers inside
the nodes are the current excesses (when positive)
fessionals in the mining industry and therefore, we and deficits (when negative). If a number is omitted
take certain theoretical liberties and specialize the inside a node, then it is zero and this means that the
algorithm so that it works only on inputs as de- node satisfies the flow balance constraint.
scribed above. The generic pseudoflow algorithm In our notation, we do not include the capacity
must contend with additional complexities, and it is on any arc. This is because the capacities of all inner
required to compute the final flow values on arcs; for arcs, representing the precedence constraints, are
those details, the reader may review Hochbaum infinity and the flows along the S and T adjacent arcs
(2008). In solving for the ultimate pit, the final flow are always at maximum capacity.
values are of no real interest other than to define the The normalized tree is a tree in which there is
minimum cut. In this minor variation of the generic exactly one unique path between any two nodes. It is
pseudoflow algorithm, we concern ourselves only also a rooted tree, meaning there is a special node,
with computing the ultimate pit as quickly as possi- called the main root, such that every other node is a
ble. descendant of this main root. The normalized part of
The pseudoflow algorithm is very similar to the the name requires that only the nodes that are
Lerchs and Grossmann (1965) algorithm, as ex- immediately adjacent to the main root can carry
plained in Hochbaum (2001). Both algorithms excesses or deficits. The tree remains a tree for the
operate iteratively by selecting a violated prece- entire algorithm, meaning that any changes to the
dence constraint, enforcing it, and then adjusting tree require adding and dropping arcs from the tree
necessary information for the next iteration. Where simultaneously.
the pseudoflow algorithm deviates from the Lerchs In the classical description of the pseudoflow
and Grossmann (1965) algorithm is that it leverages algorithm, the S and T nodes are combined into a
the idea of flow instead of mass, it provides some single node that serves as the main root. However,
machinery for selecting which precedence constraint for our purposes, we continue to draw the S and T
to introduce and maintains different structures that nodes as two distinct circles. This does make it such
are easier to update efficiently. that the normalized tree will appear disconnected,
At each iteration, the pseudoflow algorithm but it makes showing both the initialization and the
maintains a pseudoflow on the network and a special progression of the pseudoflow algorithm much ea-
structure called a normalized tree. A pseudoflow is a sier. It is important to realize that the two S and T
An Open-Source Program for Efficiently Computing Ultimate Pit Limits 1181

Figure 6. Left: an example 2D block model. Right: the associated network flow problem rotated 90° with the
maximum flow and minimum cut. Numbers on arcs are flow/capacity.

Figure 7. Left: the maintained pseudoflow on the flow network is notated with numbers on arcs for the flow, and numbers
within nodes for excesses or deficits. Right: thick arcs are parts of the normalized tree, dotted arcs are not; gray nodes are
strong, white nodes are weak.

circles are the same main root node—just seen in The two types of notation are then superim-
two different places. posed on top of one another during the execution of
In addition to the main root, we call each node the algorithm. There are a few important points to
that is immediately adjacent to the main root, roots. remember; the algorithm starts with a normalized
These secondary roots are classified as strong or tree and maintains that structure throughout, and
weak based on if they have an excess or a deficit in the S and T circles, labeled S and T, correspond to
the current pseudoflow, respectively. Recall that, for the same single main root node. When we discuss a
the tree to be normalized, these secondary roots are path from a node back to the main root, it may go to
the only nodes permitted to have excesses or deficits. either the S or the T circle.
We also say that any node that is a descendant of a
strong root is strong, and similarly any node that is a
descendant of a weak root is weak. Figure 7 intro- Initialization
duces our notation for the normalized tree on the
right. Line weight and style for arcs indicate mem- The first step in the pseudoflow algorithm is to
bership in the normalized tree, secondary roots are construct an initial normalized tree and an initial
in double circles, and the color of the node indicates pseudoflow. It is possible to start the pseudoflow
strength. Gray nodes are the current strong nodes, algorithm from any normalized tree with a valid
and white nodes are weak. pseudoflow, but the simplest starting point is to fully
saturate all S and T adjacent arcs and include all S
1182 Deutsch et al.

root and the weak root. The strong root will, by


definition, have some positive excess. Proceed as
follows to update the normalized tree by:
a. removing the tree arc connected to the
strong root; and
b. adding the merger arc.
2. Set a variable delta to be the excess of the strong
root.
3. ÔPushÕ delta units of flow along the path from the
strong root to the week root. Update the ex-
cesses/deficits/strength as you go, and for each
Figure 8. The initial normalized tree, letters near nodes are arc along the path:
node names and not a part of the notation.
a. If the arc is directed in line with the flow,
increase the flow on the arc by delta.
and T adjacent arcs in the normalized tree as in b. Else, try to decrease the flow on the arc by
Figure 8. delta.
i. If the flow is strictly greater than delta:
Algorithm Steps Set the flow to the current flow less
delta.
At each iteration of the pseudoflow algorithm, ii. Else, split flow on this arc (see below
an arc corresponding to a precedence constraint for details on splitting).
between a strong node and a weak node is chosen as
the merger arc. This merger arc is then introduced The result of the first merge, between b and e, is
into the normalized tree, and the arc between the shown in the middle in Figure 9. For the second
strong root and main root is removed. The pseud- merge, between b and f , the strong root is e and the
oflow is then adjusted so that the tree remains nor- weak root is f . The one unit of excess at e is pushed
malized. This requires adjusting flows along the path along the path but does not exceed the deficit at f , so
from the strong root to the weak root. During this the entire branch is reclassified as weak, with a
re-normalization process, there may be tree arcs that deficit of 3.
must be removed from the normalized tree, which In Figure 10, the left and middle graphs show
results in new branches. When there are no more the result of the third and fourth merges, respec-
precedence arcs between strong and weak nodes, the tively, between a and c and between a and d. For the
algorithm stops and all surviving strong nodes are final merge between a and e, we first updated the
the ultimate pit. tree and began pushing dÕs excess along the path
In practice, choosing which merger arc to use towards the root. Reduce the flow between a and d
has a large impact on the performance of the algo- by 3, increased the flow between a and e by 3, but
rithm. The pseudoflow algorithm uses a specific now we had a problem. We would like to decrease
labeling scheme, described in the following section, the flow between b and e by 3 (our current value for
to guarantee good performance and avoid the sort of delta), but this would lead to a negative flow, which
problems that plague the Lerchs and Grossmann is not allowed. We can, however, reduce the flow to
(1965) algorithm. In this initial treatment of the zero that will leave one unit of excess flow on e.
pseudoflow algorithm, we forego the use of labels Then, we split on this arc as follows:
and follow the sequence of merger arcs as indicated
on the left in Figure 9 beginning with the prece- 1. Update delta to be the flow along the splitting
dence arc between nodes b and e. This sequence is arc, push the new delta units along the splitting
not a good sequence, but we use this sequence be- arc that will reduce the split arc flow to zero and
cause it forces a split. leave positive excess at the head node.
2. Update the normalized tree by:
1. Once the appropriate merger arc is chosen, the
algorithm identifies the corresponding strong a. removing the split arc, and
An Open-Source Program for Efficiently Computing Ultimate Pit Limits 1183

Figure 9. Left: the starting network, circled numbers on nodes indicate the order of merging arcs in this example. Middle: the result of the
first merge between nodes b and e. Right: the result of the second merge between nodes b and f.

Figure 10. Left: the result of the third merge between nodes a and c. Middle: the result of the fourth merge between nodes a and d. Right:
the result of the final merge between nodes a and e, which requires splitting on the arc between b and e.

b. adding the arc from the head node to the quences of merger arcs that would require more
root. iterations than necessary. Specifically, the labeling
scheme makes it such that the merger arc between
3. Continue pushing the new delta units of flow
nodes s and w cannot be used again until the labels
along the remaining path to the weak root.
on each s and w have increased by at least one.
All nodes are assigned initially a label of 1.
There may be several of these splitting opera- When selecting a merger arc between a strong node
tions in a single merge operation with a longer path s and a weak node w, the algorithm must select an
between roots. arc such that the label of w is as low as possible.
When there are no longer any precedence arcs Once the merger arc is selected, the label of all
between strong nodes and weak nodes, the algo- strong nodes is set to the maximum of its current
rithm terminates. Any nodes that are still classified label and lw þ 1. These straightforward steps are
as strong at the end of the algorithm are then the enough to improve both the theoretical complexity
ultimate pit, and the sum of their excesses is the of the pseudoflow algorithm and the practical per-
ultimate pit value. formance.
To illustrate the labeling procedure, we ad-
justed the value of block c from -2 to -4 and modified
Labeling the sequence of merging operations. Initially, all
blocks had a label of 1. However, as soon as the first
Hochbaum (2008) introduced a labeling merger arc between a and e was selected, the labels
scheme to improve the performance of the pseud- of a and b were set to 2. The state of the network
oflow algorithm. Intuitively, the labeling after the first three merges is shown on the right of
scheme forces the algorithm to choose carefully the Figure 11. Blocks a; b; d and e all had a label of 2. At
merger arc at each iteration; avoiding certain se- this point, due to the labeling scheme, the only al-
1184 Deutsch et al.

Figure 11. Left: the slightly modified example with a different sequence of merger arcs; as circled numbers on arcs.
Right: the pseudoflow network after the first three merging operations. Labels are given as numbers next to the node
names. a, b, d and e all have label 2. c and f have a label of 1. The only valid merging operation is b to f.

lowed merger arc was between b and f because f MineFlow is a C++ 17 library that exposes a few
had the lowest label. This merge led to the imme- straightforward classes for defining precedence
diate termination of the algorithm as all blocks be- graphs and computing ultimate pit limits with
came weak. If the labeling scheme was not used, pseudoflow. The pseudoflow solver itself requires
then we could choose the next merger arc to be the integral block values, and a class that can be
between b and e (or b and d). Either of these choices queried for the precedence constraints. It is impor-
would require additional iterations. tant that we do not store the entire precedence
The labeling scheme presented here follows graph in memory at any time, instead it is defined
Hochbaum (2008) and specifies a relabeling opera- implicitly by using precedence patterns or lazy
tion to occur across all strong nodes after a merger evaluation when possible. A typical large block
arc is selected. This is not strictly necessary. Chan- model for the ultimate pit problem may have billions
dran and Hochbaum (2009) gave advice on a mod- of precedence constraints, but only a very small
ification to the labeling scheme that delays fraction of them will be used when calculating the
relabeling and improves the computational effi- ultimate pit, we can save a great deal of time by not
ciency. Our implementation used the more perfor- considering them unless strictly necessary.
mant delayed labeling scheme, which is also present Economic block values must be provided to
in HochbaumÕs (2008) implementation. MineFlow as integer values. MineFlow can support
arbitrary fixed sized integers. 256-bit integers have
been tested with a minor decrease in performance.
MINEFLOW In practice, economic block values can be scaled and
rounded as necessary.
Implementation Details To use the library with user specified data and
precedence constraints, it is necessary to define two
HochbaumÕs (2008) implementation of the classes with four virtual methods. A class inheriting
pseudoflow algorithm must contend with complexi- from IBlockValues must be defined with two
ties that are not present in the ultimate pit problem. methods: NumBlocks and BlockValue, which return
An entire class of potential splitting operations is the number of blocks and their integral economic
precluded because all precedence arcs have infinite block values, respectively, when called. Addition-
capacity, and all arcs are oriented from the S node ally, a class inheriting from IPrecedenceConstraints,
toward the T node. Additionally, we do not need to which implements NumBlocks and Antecedents,
store the capacity on arcs nor the information nec- must be defined. The Antecedents function must
essary to recover the maximum flow after identifying return an iterator for each block that specifies which
the minimum cut. We took advantage of these dif- blocks must be mined first. There are examples of
ferences in our implementation of the pseudoflow both of these classes included in the repository.
algorithm.
An Open-Source Program for Efficiently Computing Ultimate Pit Limits 1185

Table 2. Solution times obtained when solving for the ultimate pit for five different datasets. Times are given in seconds as the average
middle three of five runs

Dataset Solution time (s), average middle 3 of 5 runs

name Blocks Precedence* Package Package Package Package Package HochbaumÕs (2008) MineFlow
(mined/total)* A B C D E pseudo_fifo

Bauxite** 74,412/ 5,349,104 25 22 4 9 9 3 0


374,400
Copper 357,304/ 28,321,632 179 99 14 85 43 15 2
Case 1,827,500
Study
Copper Pipe 198,078/ 43,877,152 399 183 64 290 109 24 3
2,754,000
McLaughlin 345,936/ 44,495,400 243 168 37 34 52 24 3
2,817,920
Gold Vein 602,150/ 264,007,172 721 764 169 752 556 81*** 9
16,244,739

*The precise number of mined blocks and the total pit value varies by less than 1% between packages due to different implementations of
precedence constraints
**This ultimate pit is shown in Figure 1
***This process ran out of available memory during the initialization step, an alternate computer with more available RAM was used to
obtain this time

In addition to the C++ 17 library, MineFlow with HochbaumÕs (2008) original implementation. In
includes a standalone executable that operates on all cases, MineFlow computed the ultimate pits in
flat text files. This executable is naturally much less less time than the other methods.
flexible than the library but covers functionality for For each package and each problem, five runs
large regular block models and smaller explicit da- were completed. The times presented Table 2 are
tasets. Both the library and the executable are re- given as the average of the middle three times,
leased completely open-source with no excluding the fastest and the slowest. All computa-
dependencies on third party libraries. This makes tions were completed on a Windows 10 machine
MineFlow a useful library for both academic and with a 3.70 GHz Intel Xeon XPU E3-1245 v6 pro-
commercial applications. cessor and 32.0 GB of RAM. The times were mea-
The executable has a straightforward command sured as the complete time as reported by the
line interface to define common types of precedence package. This included the time to read the input
constraints, and a basic parameter file to specify and write the output, which can vary between
minimum search precedence patterns that allow packages.
precedence patterns to be defined with a custom The commercial packages were anonymized to
block size and pit slopes that vary by direction. The respect the wishes of some of the software vendors.
executable also supports solving custom problems All five packages use a network flow-based imple-
with each blockÕs value and precedence constraints mentation; however, the precise details are not
defined in two files. Complete up-to-date documen- published or publicly available. One package
tation of the executable and library may be found reportedly uses the Push–Relabel algorithm, and the
alongside the solver in the main repository. other four use some variant of Pseudoflow.
Each commercial package computed near
identical results with the only differences being due
Algorithm Comparison to minor departures in how each package handles
precedence constraints. MineFlow and pseudo_fifo
To verify that our implementation is correct computed identical results for all datasets as
and computationally efficient, we collected five pseudo_fifo is a general utility with no means of
block models and imported them into several dif- generating precedence constraints by itself; Mine-
ferent commercial packages. We also transformed Flow was used to create the necessary input files.
the problem to the pure max flow format to compare Notably package C also computed identical results
1186 Deutsch et al.

to MineFlow for all datasets. Departures due to Dr Ryan Goodfellow, also from Newmont, for use-
precedence constraints were less than 1% in both ful discussions. Additionally, we thank Lee Jornet
overall pit value and the number of blocks mined. Zamalloa Llerena, Graduate Student from the
Mining Department at Colorado School of Mines,
for assisting us in data conversion and running the
CONCLUSIONS commercial packages with the different datasets.

The ultimate pit problem remains a relevant Funding This work was funded by Newmont Cor-
subproblem in modern open pit mine planning. Cir- poration.
cular analysis, scheduling, uncertainty management,
and other processes rely on computationally efficient Availability of Data and Materials One of the da-
and available ultimate pit solvers. Additionally, the tasets used during the study is not available due to
Bienstock–Zuckerberg algorithm (Bienstock & confidentiality issues. The remaining data are avail-
Zuckerberg, 2009) uses the ultimate pit problem as a able from the corresponding author.
subroutine that is repeatedly executed to solve the
precedence constrained production scheduling prob- Code Availability All code used to generate prece-
lem. Certain open pit mine planning problems that dence graphs and compute ultimate pits is available
can be formulated as the ultimate pit problem with from the corresponding author and at the following
side constraints can be approached with Lagrangian link: https://github.com/MineFlowCSM/MineFlow
relaxation and repeated applications of MineFlow. It
is common to solve ultimate pit problems thousands DECLARATIONS
of times in these approaches and MineFlow makes
that much faster. Conflicts of Interest The authors have no relevant
Commercial packages have adopted the financial or non-financial conflicts of interests to
pseudoflow algorithm, or similar max flow algo- disclose.
rithms, for solving the ultimate pit problem; how-
ever, implementations vary in terms of availability,
flexibility, and computational efficiency. Our own
need for MineFlow arose when approaching large REFERENCES
open pit mine planning problems that used the
ultimate pit problem as a subroutine. In developing Ahuja, R. K., Magnanti, T. L., & Orlin, J. B. (1988). Network
flows: Theory, algorithms, and applications. Pearson.
MineFlow, we found room for optimizations and Bienstock, D., & Zuckerberg, M. (2009). A new LP algorithm for
modifications that substantially improve the practi- precedence constrained production scheduling. In Opti-
cal performance of the algorithm. Implicit, or lazy, mization Online (pp. 1–33).
Caccetta, L., & Giannini, L. M. (1988). The generation of mini-
precedence constraints, precluding impossible split- mum search patterns in the optimum design of open pit
ting operations, and eschewing the flow recovery mines. In AusIMM Bull Proc (Vol. 293, No. 5, pp. 57–61).
step and associated bookkeeping have led to a Chandran, B. G., & Hochbaum, D. S. (2009). A computational
study of the pseudoflow and push-relabel algorithms for the
computationally efficient ultimate pit solver that maximum flow problem. Operations Research, 57(2), 358–376.
outperforms current commercial implementations. Chen, T. (1976). 3D pit design with variable wall slope capabili-
Additionally, we developed a compact notation ties. In 14th symposium on the application of computers and
operations research in the mineral industries (APCOM).
for the pseudoflow algorithm with the aim of Darling, P. (Ed.). (2011). SME mining engineering handbook. In
allowing future generations of mining engineers and Society for mining, metallurgy, and exploration (Vol. 1).
technologists to learn network flow techniques that Deutsch, M., González, E., & Williams, M. (2015). Using simu-
lation to quantify uncertainty in ultimate-pit limits and in-
are the current best practice in ultimate pit opti- form infrastructure placement. Mining Engineering, 67(12),
mization. 49–55. https://doi.org/10.19150/me.6411.
Dı́az, A. B., Álvarez, I. D., Fernández, C. C., Krzemień, A., &
Rodrı́guez, F. J. I. (2021). Calculating ultimate pit limits and
determining pushbacks in open-pit mining projects. Re-
sources Policy, 72, 102058.
ACKNOWLEDGMENTS Ford, L. R., Jr., & Fulkerson, D. R. (1962). Flows in networks.
Princeton University Press. https://doi.org/10.1515/978140087
5184.
We thank Dr Marcelo Godoy for sponsoring Gilani, S. O., & Sattarvand, J. (2015). A new heuristic non-linear
this project. We also thank Dr Conor Meagher and approach for modeling the variable slope angles in open pit
An Open-Source Program for Efficiently Computing Ultimate Pit Limits 1187

mine planning algorithms. Acta Montanistica Slovaca, 20(4), Khalokakaie, R., Dowd, P. A., & Fowell, R. J. (2000). Lerchs-
251–259. Grossmann algorithm with variable slope angles. Mining
Goldberg, A. V., & Tarjan, R. E. (1988). A new approach to the Technology, 109(2), 77–85.
maximum-flow problem. Journal of the ACM (JACM), 35(4), Korobov, S. (1974). Method for determining optimal open pit
921–940. limits. Ecole Polytechnique de lÕUniversité de Montréal.
Hochbaum, D. S. (2001). A new—Old algorithm for minimum-cut Technical report EP74.
and maximum-flow in closure graphs. Networks: an Interna- Lerchs, H., & Grossmann, I. (1965). Optimum design of open-pit
tional Journal, 37(4), 171–193. mines. Operations Research, 12, B59.
Hochbaum, D. S. (2008). The pseudoflow algorithm: A new Mwangi, A. D., Jianhua, Z., Gang, H., Kasomo, R. M., & Innocent,
algorithm for the maximum-flow problem. Operations Re- M. M. (2020). Ultimate pit limit optimization methods in open
search, 56(4), 992–1009. pit mines: A review. Journal of Mining Science, 56(4), 588–602.
Johnson, T. B. (1968). Optimum open pit mine production Pana, M. T. (1965). The simulation approach to open pit design. In
scheduling (No. ORC-68–11). California Univ Berkeley 5th symposium on the application of computers and operations
Operations Research Center. research in the mineral industries (APCOM) (pp. 127–138).
Zhao, Y. (1992). Algorithms for optimum design and planning of
open-pit mines. The University of Arizona.

You might also like