ES
← Back to Portfolio
Mining & Optimization July 2026

PitForge — Exact Ultimate Pit Limit & Nested Whittle Pit-Shell Workbench

An open-pit mine-design workbench that solves the ultimate pit limit exactly, as a maximum-weight closure of the block-precedence graph reduced to a minimum cut on a Dinic max-flow engine, running live in the browser, and derives the nested Whittle pit shells by revenue factor. It reproduces the published optima of three real MineLib instances to at most 2e-9 relative error, and self-checks every solve with the max-flow duality identity. This is the only one of the Faena four whose headline is validated against third-party published optima rather than its own generator.

Exact pit engine
Ultimate pit = maximum-weight closure -> min-cut via Picard 1976 reduction on a Dinic max-flow engine (TypeScript, live in browser); the max-closure equivalent of Lerchs-Grossmann, not pseudoflow
MineLib validation
newman1 (1,060 blocks, 5.2 ms), zuck_small (9,400 blocks, 237 ms), kd (14,153 blocks, 259 ms) all match: true, rel. error <= 1.86e-10 to 9.96e-10; 2 instances excluded with committed reasons
Pit shells & grade
Nested Whittle pit shells by revenue factor (value / tonnage / strip-ratio curves); live grade estimation via IDW, ordinary kriging, and grade-nn (ONNX); pit-surrogate AUC 0.9811 vs 0.7642 baseline
Scheduling (offline)
CPIT LP relaxation (scipy HiGHS) gives a certified NPV upper bound with a 10.46% reported integrality gap (newman1, 8 periods); artifact-only, rendered from JSON, never live
Data & inputs
Real: 3 MineLib instances fetched at runtime (no bytes committed); 9 synthetic deposits; bring-your-own block model via in-app drag-and-drop CSV with an explicit outlier policy
Testing & compute
7 TypeScript test suites (incl. a live-contract test); 100% client-side, offline precompute imports the same TS engine the browser runs
PitForge — Exact Ultimate Pit Limit & Nested Whittle Pit-Shell Workbench — Architecture
#mining-optimization #open-pit #ultimate-pit-limit #max-flow #min-cut #whittle #dinic #minelib #kriging #mining

Business Context

The ultimate pit and its nested shells set the envelope for reserves, phasing and cash flow, so a wrong or unauditable pit propagates into every downstream number. PitForge's value is that its exact answer is checkable two ways: against published third-party optima it did not create, and against the max-flow duality identity on every single solve. A 14,153-block instance with 219,778 precedences solves exactly in about 259 ms median in the browser, which puts a design-grade optimiser on a static page with no server and no licence. The learned surrogates are positioned honestly as fast approximations for what-if exploration, never as replacements for the exact result.

Strategic Value

PitForge is the most strongly validated of the Faena four, and the validation is third-party: its exact ultimate pit reproduces three published MineLib optima (newman1, zuck_small, kd) to at most 2e-9 relative error, with the largest solved in about 259 ms in the browser. Two honesty properties reinforce it. Scenario knobs are locked in real mode because the MineLib instances publish their own net values and precedences, so re-deriving them would break comparability with the published optimum, a deliberate decision to protect the benchmark. And the learned grade-nn is reported as a tie, not a win: R2 0.9613 against ordinary kriging 0.958, a 0.0033 margin the artifact itself calls a fast approximation that never beats the exact result. The CPIT relaxation publishes its 10.46% integrality gap rather than hiding it. It is a reusable pattern for an auditable, self-checking optimiser that proves itself against numbers it did not author.

The Challenge

The ultimate pit limit, the set of blocks worth mining once slope precedences are honoured, is the foundation of every open-pit design, and it has an exact solution: the maximum-weight closure of the precedence graph, equivalent to a minimum cut. In practice it is often approximated, or locked inside commercial software whose results cannot be reproduced or audited. Proving an implementation is correct requires more than "it returns a pit": it requires matching a published optimum on an instance you did not generate yourself, and checking the solver against its own duality identity on every run.

Our Approach

PitForge solves the ultimate pit limit as a maximum-weight closure, reduced to a minimum cut via Picard's 1976 construction and solved by a Dinic max-flow engine written in TypeScript, running live in the browser. The exact result is what it is described as: this is the max-closure / min-cut equivalent of Lerchs-Grossmann, not a re-implementation of Lerchs-Grossmann, and not Hochbaum's pseudoflow (referenced only as computing the same cut). From the exact pit it derives the nested Whittle pit shells over an ascending revenue-factor schedule, yielding value, tonnage and strip-ratio curves. Grade estimation runs three ways live (IDW, ordinary kriging, and a grade-nn ONNX surrogate over a 27-vector neighbour stencil), plus a pit-inclusion surrogate. A CPIT LP relaxation (scipy HiGHS) with greedy integer rounding is computed offline and rendered from JSON, never live. Every solve asserts pitValue = sum(positiveValue) minus maxflow. Static on GitHub Pages, with an in-app drag-and-drop CSV path for bring-your-own block models.

Key Performance Indicators

KPIBaselineResultImpact
Correctness, third-party validatedReturns "a pit" with no external checkReproduces 3 published MineLib optima (newman1, zuck_small, kd) to <= 2e-9 relative errorValidated against optima it did not generate, not against its own output
Exact solve, in the browserApproximate pit, or a licensed desktop solver14,153 blocks / 219,778 precedences solved exactly in ~259 ms median (Dinic min-cut over Picard reduction)Design-grade optimiser on a static page, zero backend
Self-check on every solveTrust the returned numberpitValue = sum(positive) - maxflow asserted on every solve (max-flow duality identity)The optimiser checks itself, not just the caller
Learned surrogate, honestly scopedClaim the neural net beats kriginggrade-nn R2 0.9613 vs ordinary kriging 0.958 (a tie); reported as a fast approximation, never beating the exact resultA 0.0033 margin is a tie, and the card says so

Architecture

pitforge pipeline

pitforge pipeline

The exact pit, in the browser, checked against published optima

PitForge is an open-pit mine-design workbench. It solves the ultimate pit limit exactly, as a maximum-weight closure of the block-precedence graph reduced to a minimum cut on a Dinic max-flow engine, running live in the browser, and derives the nested Whittle pit shells by revenue factor. Live at pitforge.fasl-work.com, part of the Faena mining-analytics hub.

Say what the engine is

The exact result is the max-closure / min-cut equivalent of Lerchs-Grossmann, via Picard’s 1976 reduction on a Dinic engine. It is not a re-implementation of Lerchs-Grossmann, and it is not Hochbaum’s pseudoflow, which is referenced only as computing the same cut. From the exact pit, nested Whittle shells over an ascending revenue-factor schedule give value, tonnage and strip-ratio curves.

Validated against MineLib, not against itself

The exact pit reproduces the published optima of three real MineLib instances:

  • newman1: 1,060 blocks, solved in 5.2 ms median, relative error 9.96e-10
  • zuck_small: 9,400 blocks, 237 ms, 1.86e-10
  • kd: 14,153 blocks / 219,778 precedences, 259 ms, 1.30e-10

All three match: true. Two further instances (marvin, mclaughlin_limit) are excluded with committed reasons (marvin ships with commercial Whittle software; neither has a verified public mirror) rather than silently dropped. In real mode the scenario knobs are locked, because the instances publish their own net values and precedences and re-deriving them would break comparability with the published optimum.

Honest about the learned and offline rungs

Every solve asserts the duality identity pitValue = sum(positive) - maxflow, so the optimiser checks itself. Grade estimation runs three ways live (IDW, ordinary kriging, and a grade-nn ONNX surrogate); the learned grade-nn is a tie, not a win (R2 0.9613 vs ordinary kriging 0.958, a 0.0033 margin), and the artifact calls it a fast approximation that never beats the exact result. Scheduling is a CPIT LP relaxation computed offline with scipy HiGHS, rendered from JSON, never live; it publishes a certified NPV upper bound with a 10.46% integrality gap, and states plainly that the rounded schedule is a heuristic and is never optimal. It is a design optimiser, not a JORC or NI 43-101 resource estimate.

Live demo · Source on GitHub

Technology Stack

TypeScript React Vite Three.js ONNX onnxruntime-web PyTorch KaTeX

In action

A short tour of the live app — the real interface, recorded from the deployed site.

PitForge — Exact Ultimate Pit Limit & Nested Whittle Pit-Shell Workbench in action

Application Screenshots

PitForge — Exact Ultimate Pit Limit & Nested Whittle Pit-Shell Workbench
PitForge — Exact Ultimate Pit Limit & Nested Whittle Pit-Shell Workbench