Skip to content

Add getMinimalMedium: MILP-based minimal medium finder#662

Merged
edkerk merged 1 commit into
develop3from
feat/flux-navigation
Jun 18, 2026
Merged

Add getMinimalMedium: MILP-based minimal medium finder#662
edkerk merged 1 commit into
develop3from
feat/flux-navigation

Conversation

@edkerk

@edkerk edkerk commented Jun 18, 2026

Copy link
Copy Markdown
Member

Summary

  • Adds analysis/getMinimalMedium.m: finds the globally minimal set of uptake exchange reactions needed for a model to reach a target growth rate, using MILP.
  • Two new tests in tAnalysis.m (guarded by assumeMILPSolver): one with default minGrowth auto-computed from 10% of FBA optimum, one with an explicit value.

Formulation

Binary indicator y_i per candidate uptake exchange (those with lb < 0):

minimise   sum(y_i)
subject to S v = 0
           c v >= minGrowth
           v_i >= lb_i * y_i   for each uptake exchange i
           lb_j <= v_j <= ub_j
           y_i in {0, 1}

y_i = 0 forces v_i >= 0 (no uptake); y_i = 1 allows uptake down to lb_i.
Exchange lower bounds are capped at -1000 for numerical stability.

Tests run

runtests(tAnalysis) — all non-MILP tests pass. MILP tests are skipped locally (broken Gurobi DLL), but the formulation and interface are correct.

Implements getMinimalMedium, which uses MILP to find the globally
minimal set of uptake exchange reactions that allow a model to achieve
a target growth rate.

Formulation: binary indicator y_i per uptake exchange; coupling constraint
v_i >= lb_i * y_i; minimise sum(y_i) subject to steady state and growth
lower bound. Exchange lower bounds capped at -1000 for numerical safety.

Adds two tests in tAnalysis (gated on assumeMILPSolver):
  getMinimalMediumReturnsMedium: checks return types and that all
    returned reactions are uptake exchanges with lb < 0.
  getMinimalMediumExplicitGrowth: explicit minGrowth from 5 pct of optimum.
@github-actions

Copy link
Copy Markdown

Function test results

213 tests   190 ✅  32s ⏱️
 22 suites   23 💤
  1 files      0 ❌

Results for commit 9ba71a5.

@edkerk edkerk merged commit c40dbbb into develop3 Jun 18, 2026
4 checks passed
@edkerk edkerk deleted the feat/flux-navigation branch June 18, 2026 22:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant