Research code, selected visualizations, and the final submission from our 2026 International Mathematical Modeling Challenge solution to Protecting Wildlife at Scale, using Etosha National Park in Namibia as the case study.
Our team received an IM²C Meritorious Award at the international level. In 2026, 68 finalist teams from 37 countries and regions reached the international round; 11 teams received Meritorious recognition. Official results.
We treated wildlife protection as a constrained resource-allocation problem. The computational pipeline combines a spatial graph of the park with threat priorities, patrol routing, monitoring coverage, seasonal risk simulation, and budget search.
- Spatial representation — convert geospatial layers into a navigable fine-grid graph, then aggregate it into larger blocks for tractable optimization.
- Priority scoring — assign local and neighborhood-aware priority values from wildlife, water, vegetation, infrastructure, and existing coverage features.
- Patrol allocation — distribute ranger groups across patrol houses and candidate areas under travel-time and overlap constraints.
- Monitoring allocation — place GPS and acoustic/sound-tracker coverage within a fixed budget.
- Risk simulation — simulate seasonal threat events and interception under the assumptions defined in the model.
- Plan search — screen feasible allocations on a shorter horizon, then evaluate the strongest candidates over a full simulated year.
| File | Role |
|---|---|
build_graph.py |
Geospatial ingestion and fine-grid construction |
solution/compute_node_priority.py |
Spatial priority scoring |
solution/build_big_square_graphs.py |
Block-level graph construction |
solution/build_big_dist_with_portals.py |
Inter-block route and travel-cost preprocessing |
math_solution/patrol_alloc_greedy_unique.py |
Patrol allocation search |
math_solution/select_sound_border_cells.py |
Border monitoring placement |
math_solution/risk_year_simulation.py |
Seasonal annual-risk simulation |
math_solution/math_model.py |
Budget logic and top-level plan search |
math_solution/viz_patrol_alloc_k2.py |
Route/allocation visualization |
simulation.py |
Fine-grid patrol-sector and softmax route simulation |
single_patrol_demo.py |
Single-patrol routing demonstration |
The geospatial preprocessing and visualization code uses Python with the dependencies in requirements.txt.
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txtThe repository includes the generated block graph, travel matrices, priorities, patrol-house mapping, and original result artifacts used by the retained optimizer. Rebuilding those artifacts from scratch still requires the source geospatial layers and the fine-grid graph described in data/README.md.
Run the automated runtime suite:
python -m unittest discover -s tests -vRun the patrol allocator against the restored Etosha artifacts:
python math_solution/patrol_alloc_greedy_unique.py \
--Kmin 2 --Kmax 2 --topL 20 --Tlim 12 \
--out /tmp/patrol-smoke.jsonRun the top-level annual-risk model on the small, self-contained fixture:
python math_solution/math_model.py \
--total-budget 0 \
--dist examples/synthetic/dist.json \
--sound-graph examples/synthetic/small_graph.json \
--sound-priority examples/synthetic/priority.json \
--out /tmp/math-model-smoke.json \
--report-out /tmp/math-model-smoke.md \
--skip-plot --no-progressThe fixture exercises the orchestration and full 365-day risk-simulation path. The first command above exercises patrol allocation on the restored competition-scale block data.
This release preserves the original modeling, optimization, simulation, preprocessing, and visualization code together with the generated block-level planning artifacts, representative outputs, and final paper. Raw GIS inputs and the generated 33,264-node fine-grid graph are not included because they were never tracked in the repository.
The simulation parameters in math_solution/risk_year_simulation.py are competition-model assumptions, not field-calibrated conservation forecasts. The repository should therefore be read as a mathematical modeling and optimization project rather than an operational wildlife-management system. The final report documents the assumptions, limitations, and decision framework used in the submission.
GitHub Actions performs a repository-wide syntax check plus unit and integration tests. The suite covers fine-grid patrol simulation, border monitoring selection, a full synthetic annual-risk run, and an optimizer run against the restored Etosha block-level data. Rebuilding the geospatial inputs themselves remains outside the repository because the raw layers are not included.
I co-developed the mathematical model, developed the optimization/search approach used to compare resource allocations, and implemented the computational pipeline and simulations used to evaluate candidate plans.


