---
title: BOM-Aware MILP for Contract-Driven Procurement
url: https://www.emergentmind.com/topics/bom-aware-milp
type: topic
---

# BOM-Aware MILP for Contract-Driven Procurement

A BOM-aware MILP (Mixed-Integer Linear Program) is a class of mathematical optimization models that explicitly encode bill-of-materials (BOM) relationships as algebraic constraints, integrated with supplier contract terms such as minimum order quantities (MOQ), lead times, price tiers, capacity caps, and approved substitutions. The BOM-aware MILP structure, as instantiated in the Contract2Plan framework, supports the verified planning of procurement and multi-echelon inventory for production networks subject to both operational and contractual feasibility [2601.06164].

## 1. Notation, Parameters, and Decision Variables

The BOM-aware MILP is constructed with rigorous set and parameter definitions:

- **Sets and Indices:**
  - $S$: Suppliers ($s \in S$)
  - $P$: Parts; $F \subseteq P$ denotes finished goods ($p \in P$, $f \in F$)
  - $N$: Stocking nodes (plants, DCs; $n \in N$)
  - $T$: Planning periods ($t \in T$)
  - $K_{s,p}$: Price tier index for each supplier-part $(s,p)$

- **Parameters:**
  - $a_{p,f} \in \mathbb{N}$: BOM coefficient for $p$ in $f$
  - $d_{n,f,t} \geq 0$: Demand for $f$ at $n$ in $t$
  - $L_{s,p} \in \mathbb{N}$: Lead time for $p$ from $s$
  - $MOQ_{s,p}$, $M_{s,p} \in \mathbb{N}$: Minimum and maximum order quantities
  - $Cap_{s,p,t} \geq 0$: Capacity cap for $x_{s,p,t}$
  - $\tau_{s,p,k} \in \mathbb{N}$, $c_{s,p,k} \geq 0$: Tier threshold and per-unit costs
  - $K_{s,p} \geq 0$: Fixed order/setup cost
  - $h_{n,p} \geq 0$: Holding cost per unit-period
  - $c_{n,p}^{exp} \geq 0$: Emergency purchase penalty
  - $\alpha_{n,p'} \in \{0,1\}$: Substitution approval indicator

- **Decision Variables:**
  - $x_{s,p,t} \geq 0$: Ordered quantity of $p$ from $s$ at $t$
  - $z_{s,p,t} \in \{0,1\}$: Order activation for $(s,p)$ at $t$
  - $u_{s,p,t,k} \in \{0,1\}$: Tier selection binary
  - $I_{n,p,t} \geq 0$: On-hand inventory
  - $y_{n,f,t} \geq 0$: Produced quantity of $f$ at $n$, $t$
  - $e_{n,p,t} \geq 0$: Emergency purchase quantity

These variables and parameters jointly enable the encoding of BOM-flow, multi-tier pricing, supplier restrictions, and cross-site interactions.

## 2. Objective Function and Constraint System

The BOM-aware MILP minimizes total expected cost over the planning horizon:

\[
\min_{x,z,u,I,y,e}\; \sum_{s,p,t}\Bigl(\sum_{k=1}^{K_{s,p}}c_{s,p,k}\,u_{s,p,t,k} + K_{s,p}\,z_{s,p,t}\Bigr) + \sum_{n,p,t}h_{n,p}\,I_{n,p,t} + \sum_{n,p,t}c^{\mathrm{exp}}_{n,p}\,e_{n,p,t}
\]

- **Procurement Cost**: Aggregates piecewise-tiered per-unit costs and fixed setup charges, with tier-eligibility governed by $u_{s,p,t,k}$.
- **Inventory Holding**: Assesses cost across all nodes, parts, and periods.
- **Emergency Purchases**: Penalizes out-of-plan procurement, which is costly by design.

### Constraint Categories

- **BOM-Driven Material Balance**:
  \[
  I_{n,p,t} = I_{n,p,t-1} + \sum_{s \in S}x_{s,p,t-L_{s,p}} + e_{n,p,t} - \sum_{f \in F}a_{p,f}\,y_{n,f,t}
  \]
  All flows incorporate true lead times, linking procurement, stock, and production in each period.

- **Demand Fulfillment**:
  \[
  \sum_{f \in F}a_{p,f}\,y_{n,f,t} + e_{n,p,t} \geq d_{n,p,t}
  \]
  Guarantees service of exogenous finished-good demand.

- **Contractual Procurement Constraints**:
  - MOQ and activation: $x_{s,p,t} \geq MOQ_{s,p} z_{s,p,t}$
  - Capacity: $x_{s,p,t} \leq Cap_{s,p,t}$
  - Tier eligibility: $\sum_{k=1}^{K_{s,p}} u_{s,p,t,k} = z_{s,p,t}$; $x_{s,p,t} \geq \sum_{k=1}^{K_{s,p}} \tau_{s,p,k} u_{s,p,t,k}$
  - Approved substitution: $x_{n,p',t} \leq \alpha_{n,p'} M'$

These enforce contractually dictated procurement limits and ensure physical material feasibility consistent with BOM structures.

## 3. Automated Pipeline: Contract Text to MILP Compilation

The BOM-aware MILP backbone supports direct structuring of plans from unstructured contract text using a hybrid retrieval–GenAI–solver pipeline:

- **Retrieval and Chunking**:
  - BM25 plus dense retriever identifies paragraphs or table cells answering "MOQ," "lead time" queries.
  - Clauses are chunked with scope context (effective dates, sites).

- **Schema-Constrained Extraction**:
  - A fixed JSON schema specifies fields (e.g., `supplier_id`, `moq`, `lead_time_periods`) with evidence span and confidence annotation.
  - LLM outputs are constrained to this structure; all values must have textual provenance.

- **Normalization and Mapping**:
  - Units, currencies, and entity names are canonicalized.
  - Schema fields deterministically populate the MILP parameters.

- **MILP Compilation**:
  - Schema fields map directly to MILP constraints as above.
  - Conditional and piecewise clauses (e.g., "MOQ applies above quarterly volume 600") are encoded when aggregation structures permit; otherwise, a conservative collapse or abstention triggers.

This pipeline formalizes the transition from heterogeneous document sources to robust, verifiable input for MILP-based planning.

## 4. Solver-Based Compliance Gating and Diagnostic Verification

Before any plan is emitted, a four-layer compliance verifier is invoked:

1. **Schema & Unit Validation**: Checks structured data for completeness, numeric consistency, monotonicity (e.g., price tiers), and valid effective date windows.
2. **Provenance & Grounding**: Ensures every structured field directly maps to a supported textual evidence span; flags mis-scoped or stale clauses.
3. **Cross-Document Consistency & Safe Repair**:
   - Constraints are grouped by affected tuple (supplier, part, scope, window).
   - Precedence resolves conflicts (e.g., addendum overrides master).
   - Monotone ("Class A") conflicts are conservatively merged; nonmonotone conflicts invoke abstention for human review.
4. **Solver Feasibility Check**:
   - Full MILP is compiled and checked for feasibility.
   - Minimal Infeasible Subsystem (IIS) extraction localizes unsatisfiable constraint sets if infeasible.
   - Otherwise, a slack-minimization auxiliary MILP,
     \(\min \sum_j w_j \xi_j\) subject to \(g_j(x) \leq \xi_j, \xi_j \geq 0\),
     identifies where slacks (e.g., MOQ, lead-time, capacity violations) concentrate.
   - Conditional iteration re-extracts or repairs as diagnostics dictate; unresolved nonmonotonicity or ambiguity results in abstention.

## 5. Formal Compliance Guarantees and Abstention Mechanics

Contract2Plan's compliance logic relies on a detailed constraint taxonomy:

- **Class A (Monotone Feasibility):** MOQ (increases), lead time (increases), capacity (decreases), and cadence constraints. Safe for conservative numerical merge.
- **Class B (Eligibility):** Price tier constraints. Safe to enforce strictly.
- **Class C (Nonmonotone/Exceptions):** Rebates, carve-outs, approvals, and cross-references. Unsafe for automated numeric merge; abstention enforced.

A formal guarantee (Theorem 1) states: If the true value is among the retrieved candidates (coverage) and the MILP constraint is monotone, then a plan feasible for the conservatively merged (i.e., most restrictive) value is contract-feasible under the true conditions. In all other cases—absent provenance, irreducible ambiguity, or non-monotonic conflict—the system abstains, requiring human adjudication.

## 6. Synthetic Micro-Benchmark and Robustness Findings

An independent micro-benchmark with 500 synthetic single-item, no-backlog instances over $T=5$ periods illustrates the necessity of solver-based verification:

- **Setup Highlights:**
  - Two sourcing modes: cheap supplier (MOQ, lead time, price tier) and immediate emergency buy.
  - Action per period: one of nine discrete order quantities, totaling $9^5=59,049$ schedules per instance.
  - Randomization over demand, true MOQ, lead time, cost, and extraction errors (with explicit under- and overstep probabilities for MOQ and lead time).

- **Observed Metrics:**
  - 16.6% incidence of planned MOQ violation (83/500).
  - Mean regret of extraction-only plan: \$142.33 (5.4% of mean optimal cost; 95% CI [113.67, 171.07]).
  - 90th percentile regret: \$587.74; 99th percentile: \$1,569.61; maximum: \$2,242.22.
  - 27.2% of instances incurred any regret.
  - Joint MOQ and lead time under-estimation yielded the highest tail risk.

This heavy-tailed risk evidence motivates the necessity of the compliance gate and conservative repair logic in BOM-aware MILP pipelines [2601.06164].

## 7. Scaling, Future Directions, and Architectural Invariants

Scaling BOM-aware MILP with contract-grounded verification demands increased computational and data-engineering sophistication:

- Large BOMs and multi-echelon networks require decomposition algorithms (Benders, Dantzig–Wolfe), rolling horizon or stagewise approaches.
- Efficient high-volume parsing, parallel solver calls, and seamless integration with contract governance and access control systems are essential.
- Crucially, the four-layer compliance architecture and evidence-grounding invariant remain intact, preserving auditable contract safety at scale prior to plan emission.

A plausible implication is that future advances will emphasize verifiability, transparency, and fail-safe abstention in optimization pipelines translating from unstructured contract corpora to actionable plans, particularly as BOMs and supply chain networks grow in scale and complexity.

Source: https://www.emergentmind.com/topics/bom-aware-milp