Algorithm Search⌘K

Algorithmadvanced

Elementary flux mode enumeration

Also called double description method for elementary modes.

List all elementary flux modes of a network by the double description method, as the extreme rays of the flux cone after each reversible reaction is split.

Time
O(m^2 d^2 R^2) worstO(m d^2 R^2) per_step
Space
O(m R) extra
Where
R = the largest number of rays kept after a step; d = the dimension of the kernel of the split matrix; m = the number of reactions after splitting
Properties
deterministicexactofflineiterative
Origin
Stefan Schuster, Claus Hilgetag, 1994

Elementary flux mode enumeration lists every elementary flux mode of a metabolic network: every minimal set of reactions that can carry a steady flux in the allowed directions. The standard method is the double description method, applied to the flux cone. First each reversible reaction is split into a forward and a backward irreversible copy, so that the modes become the extreme rays of a pointed cone. The method starts from a kernel basis of the stoichiometric matrix and adds the sign constraints one by one. At each step it keeps the rays that satisfy the new constraint and joins each adjacent pair of rays with opposite signs into a new ray. The output can be exponential in the size of the network, and counting the modes is #P-complete, so no method is fast on all networks. On networks of moderate size the method is practical, and it is the core of the standard tools.

In plain words

A metabolic network can usually run in many ways. Some of these ways are as small as possible: if you remove any one reaction from them, they stop working. These smallest routes are called elementary flux modes. Every way the network can run is a mix of them, so a list of all of them describes the whole network.

The method builds the list step by step. It starts with a few simple routes that balance every metabolite but may run some reactions the wrong way. Then it fixes one reaction at a time. Routes that run that reaction the right way are kept. Pairs of routes that run it in opposite directions are added together so that the reaction cancels, but only for pairs that are close neighbours. At the end, every route left is a correct smallest route, and none is missing.

The problem

Input. An n×m0n \times m_0 stoichiometric matrix SS with rational entries and the set of reversible reactions.

Output. All elementary flux modes of the flux cone C={v:Sv=0,  vj≥0 for irreversible j}C = \{v : S v = 0, \; v_j \ge 0 \text{ for irreversible } j\}, that is, the non-zero vectors of CC whose support is minimal. Each mode is given once, as the vector of coprime integers in its ray. A mode made only of reversible reactions and its negative are two different modes.

The algorithm

  1. EFM-ENUMERATION(S, rev)
  2. 1S' ← S with a column -S_j added for each reversible j; record which column came from which reaction
  3. 2compute the reduced row echelon form of S', with pivot columns Π and free columns F,
  4. and the kernel basis that is the identity on F; let K be the matrix of this basis and d = |F|
  5. 3rays ← the d basis vectors; done ← F
  6. 4for each pivot column p in Π:
  7. 5split rays into pos (x_p > 0), zero (x_p = 0) and neg (x_p < 0)
  8. 6new ← empty list
  9. 7for each x in pos and each y in neg:
  10. 8if the rows K_i with i in done, x_i = 0 and y_i = 0 have rank d - 2:
  11. append x_p y - y_p x to new
  12. 9rays ← pos + zero + new; add p to done
  13. 10drop the rays whose support is the two copies of one reaction, and map each other ray back to the original reactions
  14. 11return the modes, each scaled to coprime integers, sorted

Every stored vector lies in the kernel of S′S', and its coordinate xix_i is the value of the constraint xi≥0x_i \ge 0, so the zero set of a ray is its set of tight constraints. In the kernel basis of line L2 the free coordinates are the identity, so the starting cone, the part of the kernel with xF≥0x_F \ge 0, is a simplicial cone whose extreme rays are the basis vectors. The rank test of line L8 is the adjacency test of the double description method. The code first skips pairs with fewer than d−2d - 2 common zeros, which cannot pass the test. The new ray xpy−ypxx_p y - y_p x is a positive combination of xx and yy (since xp>0>ypx_p > 0 > y_p), and its coordinate pp is zero. The code works with exact fractions.

Example

Take network E of the definition page, with metabolites AA, BB, CC and reactions R1 (→A\to A), R2 (A→BA \to B), R3 (A↔CA \leftrightarrow C, reversible), R4 (B→CB \to C), R5 (C→C \to) and R6 (B→B \to). Line L1 adds the column R3b, the backward copy of R3, so S′S' has seven columns in the order R1, ..., R6, R3b. The pivot columns are R1, R2, R3 and the free columns are R4, R5, R6, R3b, so d=4d = 4. The kernel basis, written as (x1,…,x6,x3b)(x_1, \ldots, x_6, x_{3b}), is:

ray R1 R2 R3 R4 R5 R6 R3b
b1b_1 0 1 -1 1 0 0 0
b2b_2 1 0 1 0 1 0 0
b3b_3 1 1 0 0 0 1 0
b4b_4 0 0 1 0 0 0 1

The constraints for R1 and R2 change nothing, because no ray is negative there. For R3, b1b_1 is negative, b2b_2 and b4b_4 are positive, and b3b_3 is zero. The pair (b2,b1)(b_2, b_1) has the common zeros R6 and R3b among the processed constraints, and these two rows of KK have rank 2=d−22 = d - 2, so the pair is adjacent. It gives b1+b2=(1,1,0,1,1,0,0)b_1 + b_2 = (1, 1, 0, 1, 1, 0, 0), the route R1, R2, R4, R5. The pair (b4,b1)(b_4, b_1) has the common zeros R1, R5, R6, also of rank 2, and gives b1+b4=(0,1,0,1,0,0,1)b_1 + b_4 = (0, 1, 0, 1, 0, 0, 1), the cycle R2, R4, R3b. The list now has five rays. Line L10 drops b4b_4, which runs R3 forward and backward, and maps R3b back to R3 with a minus sign. The result is the four modes of the definition page: (1,1,0,0,0,1)(1, 1, 0, 0, 0, 1), (1,0,1,0,1,0)(1, 0, 1, 0, 1, 0), (1,1,0,1,1,0)(1, 1, 0, 1, 1, 0) and the cycle (0,1,−1,1,0,0)(0, 1, -1, 1, 0, 0).

On network N of the FBA page the code finds the three modes for growth by RESP1, by RESP2 and by fermentation. On a chain of kk diamonds, with 2k+22k + 2 reactions, it finds 2k2^k modes. The tests check these cases, a cycle of three reversible reactions (two modes, one in each direction), and 60 random networks against a brute force search over all supports.

Correctness

The proof has three parts. Splitting is a bijection between the modes of the original network and the modes of the split network that are not two-cycles. In the split network every reaction is irreversible, so the cone is pointed and its extreme rays are exactly its modes, by the rank test for modes. The double description step is correct: when a constraint ht≥0h t \ge 0 is added to a pointed cone, the extreme rays of the new cone are the old extreme rays with ht≥0h t \ge 0, together with one new ray for each adjacent pair with opposite signs, and no ray appears twice. Adjacency means that the common tight constraints have rank d−2d - 2, so the two rays span a two-dimensional face. By induction over the pivots, the final list holds each extreme ray of the split cone once. Both are theorems, and the full proof is below.

Proof: The nullspace double description method lists every elementary flux mode exactly oncefull

Fix an n×mn \times m matrix SS and a set of reversible reactions. The flux cone is C={v:Sv=0,  vj≥0 for irreversible j}C = \{v : S v = 0, \; v_j \ge 0 \text{ for irreversible } j\}, and the elementary flux modes (EFMs) are its non-zero vectors of minimal support, counted up to a positive factor (see the definition page). We show that efm_enumeration returns each EFM exactly once, as a vector of coprime integers.

Throughout, a ray is a non-zero vector up to a positive factor, and for a pointed polyhedral cone P={t∈Rd:At≥0}P = \{t \in \mathbb{R}^d : A t \ge 0\} with rank⁡A=d\operatorname{rank} A = d and a vector t∈Pt \in P, the tight set is Z(t)={i:ait=0}Z(t) = \{i : a_i t = 0\}, where aia_i is row ii of AA. We write AZA_Z for the rows of AA in ZZ.

Step 1: splitting

Line L1 builds S′S', with the columns of SS followed by −Sj-S_j for each reversible jj, so that column kk of S′S' is σkSj(k)\sigma_k S_{j(k)} with σk=±1\sigma_k = \pm 1. Let C′={x≥0:S′x=0}C' = \{x \ge 0 : S' x = 0\} and φ(x)j=∑k:j(k)=jσkxk\varphi(x)_j = \sum_{k : j(k) = j} \sigma_k x_k. A two-cycle is a vector of C′C' whose support is the two copies of one reversible reaction. For an EFM ee of CC, let ψ(e)\psi(e) put max⁡(ej,0)\max(e_j, 0) on the forward copy of jj and max⁡(−ej,0)\max(-e_j, 0) on the backward copy.

Lemma 1 (the support rank test). Let QQ be the support of a non-zero v∈Cv \in C. Then vv is an EFM of CC if and only if dim⁡ker⁡SQ=1\dim \ker S_Q = 1. The same holds for C′C' and S′S'.

Proof. If dim⁡ker⁡SQ≥2\dim \ker S_Q \ge 2, take w∈ker⁡SQw \in \ker S_Q independent of vQv_Q, with the sign chosen so that some ii has vi/wi>0v_i / w_i > 0. Let τ=min⁡{vi/wi:vi/wi>0}\tau = \min \{ v_i / w_i : v_i / w_i > 0 \}. Then u=v−τwu = v - \tau w (zero outside QQ) has Su=0S u = 0, is not zero because ww is independent of vv, has ui=0u_i = 0 for some i∈Qi \in Q, and has the sign of viv_i or 0 on every other i∈Qi \in Q. So u∈Cu \in C and supp⁡(u)⊊Q\operatorname{supp}(u) \subsetneq Q, and vv is not an EFM. Conversely, if dim⁡ker⁡SQ=1\dim \ker S_Q = 1 and u∈Cu \in C is non-zero with supp⁡(u)⊊Q\operatorname{supp}(u) \subsetneq Q, then uQ∈ker⁡SQu_Q \in \ker S_Q, so uQ=cvQu_Q = c v_Q with c≠0c \ne 0, and then supp⁡(u)=Q\operatorname{supp}(u) = Q, a contradiction. The argument for C′C' is the same with S′S', since C′C' is the flux cone of S′S' with all reactions irreversible. □\square

Lemma 2 (the splitting correspondence). ψ\psi maps the EFMs of CC to the EFMs of C′C' that are not two-cycles, and φ\varphi maps these back, with φ(ψ(e))=e\varphi(\psi(e)) = e and ψ(φ(x))=x\psi(\varphi(x)) = x.

Proof. Let ee be an EFM of CC. Then ψ(e)≥0\psi(e) \ge 0, S′ψ(e)=Se=0S' \psi(e) = S e = 0, and ψ(e)\psi(e) never uses both copies of a reaction. Its support columns in S′S' are the columns ±Sj\pm S_j for j∈supp⁡(e)j \in \operatorname{supp}(e), so dim⁡ker⁡Ssupp⁡(ψ(e))′=dim⁡ker⁡Ssupp⁡(e)=1\dim \ker S'_{\operatorname{supp}(\psi(e))} = \dim \ker S_{\operatorname{supp}(e)} = 1, and ψ(e)\psi(e) is an EFM of C′C' by Lemma 1. It is not a two-cycle, since it uses one copy per reaction. Clearly φ(ψ(e))=e\varphi(\psi(e)) = e.

Now let xx be an EFM of C′C' that is not a two-cycle. If xx had both copies of some reversible jj in its support, the two-cycle on these copies would be a vector of C′C' with support inside supp⁡(x)\operatorname{supp}(x), so by minimality supp⁡(x)\operatorname{supp}(x) would be these two copies, and xx would be the two-cycle. So xx uses at most one copy of each reaction. Then v=φ(x)v = \varphi(x) has Sv=S′x=0S v = S' x = 0, the sign of each irreversible flux is that of xx (non-negative), and the support columns of vv in SS are, up to sign, the support columns of xx in S′S'. By Lemma 1 for C′C' and then for CC, vv is an EFM of CC, and ψ(v)=x\psi(v) = x. □\square

So it suffices to list the EFMs of C′C', drop the two-cycles and apply φ\varphi, which is what line L10 does.

Step 2: the cone in kernel coordinates

Let m′m' be the number of columns of S′S'. Line L2 computes the reduced row echelon form of S′S' with pivot columns Π\Pi and free columns FF, ∣F∣=d=dim⁡ker⁡S′|F| = d = \dim \ker S', and the kernel basis whose vector bb is 1 at the bb-th free column and 0 at the other free columns. Let KK be the m′×dm' \times d matrix with these vectors as columns. Then t↦Ktt \mapsto K t is a bijection from Rd\mathbb{R}^d onto ker⁡S′\ker S', and the rows of KK in FF form the identity matrix. So

C′={Kt:t∈P},P={t∈Rd:Kt≥0},C' = \{K t : t \in P\}, \qquad P = \{t \in \mathbb{R}^d : K t \ge 0\},

and PP is pointed, since its constraints contain t≥0t \ge 0. The coordinate xi=Kitx_i = K_i t is 0 exactly when constraint ii is tight. The code keeps every ray as the vector x=Kt∈Rm′x = K t \in \mathbb{R}^{m'}, so the tight set of a ray is its zero set, and all operations below are linear, so they commute with t↦Ktt \mapsto K t.

Lemma 3 (extreme rays by rank). Let P={t:At≥0}P = \{t : A t \ge 0\} be pointed, with rank⁡A=d\operatorname{rank} A = d. A non-zero t∈Pt \in P spans an extreme ray of PP if and only if rank⁡AZ(t)=d−1\operatorname{rank} A_{Z(t)} = d - 1. A ray is extreme in C′C' if and only if its support is minimal, so the extreme rays of C′C' are its EFMs.

Proof. The set {u∈P:AZ(t)u=0}\{u \in P : A_{Z(t)} u = 0\} is the smallest face of PP that contains tt, and tt is in its relative interior. Its linear span is ker⁡AZ(t)\ker A_{Z(t)}, because near tt every vector of ker⁡AZ(t)\ker A_{Z(t)} satisfies the other constraints strictly. So the face is the ray of tt if and only if ker⁡AZ(t)\ker A_{Z(t)} has dimension 1, that is, rank d−1d - 1. For C′C', with A=KA = K, the tight set of x=Ktx = K t is the complement of its support QQ, and dim⁡ker⁡KZ=dim⁡{x∈ker⁡S′:xi=0 off Q}=dim⁡ker⁡SQ′\dim \ker K_{Z} = \dim \{x \in \ker S' : x_i = 0 \text{ off } Q\} = \dim \ker S'_Q. So xx is extreme if and only if dim⁡ker⁡SQ′=1\dim \ker S'_Q = 1, which is the EFM test of Lemma 1. □\square

Call two extreme rays r,r′r, r' of PP that are not multiples of each other adjacent if rank⁡AZ(r)∩Z(r′)=d−2\operatorname{rank} A_{Z(r) \cap Z(r')} = d - 2. This is the test of line L8, where the rows are the rows of KK for the processed constraints on which both rays are zero.

Lemma 4 (the double description step). Let P={t:At≥0}P = \{t : A t \ge 0\} be pointed with rank⁡A=d\operatorname{rank} A = d, let RR hold one vector for each extreme ray of PP, and let hh be a row vector. Split RR into R+R^+, R0R^0, R−R^- by the sign of hrh r. Then the extreme rays of P′=P∩{ht≥0}P' = P \cap \{h t \ge 0\} are, each exactly once,

R+  ∪  R0  ∪  {(hr) r′−(hr′) r  :  r∈R+,  r′∈R−,  r,r′ adjacent in P}.R^+ \;\cup\; R^0 \;\cup\; \{ (h r)\, r' - (h r')\, r \; : \; r \in R^+, \; r' \in R^-, \; r, r' \text{ adjacent in } P \} .

Proof. P′P' is pointed and its matrix A′=(A;h)A' = (A; h) has rank dd. Write Z′Z' for tight sets in P′P'.

(a) Each r∈R+∪R0r \in R^+ \cup R^0 is in P′P', and Z′(r)⊇Z(r)Z'(r) \supseteq Z(r), so rank⁡AZ′(r)′≥d−1\operatorname{rank} A'_{Z'(r)} \ge d - 1. All these rows vanish on r≠0r \ne 0, so the rank is at most d−1d - 1. By Lemma 3, rr is extreme in P′P'.

(b) For adjacent r∈R+r \in R^+ and r′∈R−r' \in R^-, let w=(hr)r′−(hr′)r=αr′+βrw = (h r) r' - (h r') r = \alpha r' + \beta r with α=hr>0\alpha = h r > 0 and β=−hr′>0\beta = -h r' > 0. Then w∈Pw \in P, hw=0h w = 0, and w≠0w \ne 0 since r,r′r, r' are independent. For a row aia_i of AA, aiw=αair′+βaira_i w = \alpha a_i r' + \beta a_i r is a sum of two non-negative terms, so it is 0 if and only if i∈Z(r)∩Z(r′)i \in Z(r) \cap Z(r'). So Z′(w)=(Z(r)∩Z(r′))∪{h}Z'(w) = (Z(r) \cap Z(r')) \cup \{h\}. The kernel of AZ(r)∩Z(r′)A_{Z(r) \cap Z(r')} has dimension 2 and contains rr and r′r', so it is their span, and hr≠0h r \ne 0 shows that hh is not a combination of these rows. So rank⁡AZ′(w)′=d−1\operatorname{rank} A'_{Z'(w)} = d - 1, and ww is extreme in P′P' by Lemma 3.

(c) Let ww be extreme in P′P'. If hw>0h w > 0, then Z′(w)=Z(w)Z'(w) = Z(w), so ww is extreme in PP by Lemma 3, and w∈R+w \in R^+. If hw=0h w = 0 and ww is extreme in PP, then w∈R0w \in R^0. Otherwise hw=0h w = 0, and rank⁡AZ(w)=d−2\operatorname{rank} A_{Z(w)} = d - 2: it is at least d−2d - 2 because adding the one row hh gives rank d−1d - 1, and at most d−2d - 2 because ww is not extreme in PP. The face G={u∈P:AZ(w)u=0}G = \{u \in P : A_{Z(w)} u = 0\} of PP then has a two-dimensional span and is pointed, so it is the cone over two extreme rays r1,r2r_1, r_2 of GG, which are extreme rays of PP (a face of a face is a face). Their common tight set contains Z(w)Z(w), so its rank is at least d−2d - 2, and at most d−2d - 2 because both lie in its kernel; so they are adjacent. As ww is in the relative interior of GG, w=ar1+br2w = a r_1 + b r_2 with a,b>0a, b > 0. From hw=0h w = 0, either hr1=hr2=0h r_1 = h r_2 = 0, but then hh vanishes on the span of GG, so hh is a combination of the rows AZ(w)A_{Z(w)} and rank⁡AZ′(w)′=d−2\operatorname{rank} A'_{Z'(w)} = d - 2, a contradiction; or one of hr1,hr2h r_1, h r_2 is positive and the other negative, say hr1>0>hr2h r_1 > 0 > h r_2. In the plane spanned by r1,r2r_1, r_2, the vectors of GG with hu=0h u = 0 form one ray, which contains both ww and (hr1)r2−(hr2)r1(h r_1) r_2 - (h r_2) r_1. So ww is in the third set.

(d) No ray appears twice. The rays of R+∪R0R^+ \cup R^0 are distinct extreme rays of PP, and the new rays are not extreme in PP (each is a positive combination of two independent rays). Two different adjacent pairs span two different two-dimensional faces of PP, and each new ray lies in the relative interior of its face, so different pairs give different rays. □\square

Step 3: the loop

Lemma 5 (the invariant). Let D0=FD_0 = F and let DsD_s be FF plus the first ss pivot columns processed by line L4. After ss rounds of the loop, the list rays holds exactly one vector KtK t for each extreme ray of Ps={t:Kit≥0 for i∈Ds}P_s = \{t : K_i t \ge 0 \text{ for } i \in D_s\}.

Proof. By induction on ss. For s=0s = 0, P0={t≥0}P_0 = \{t \ge 0\}, the orthant, whose extreme rays are the unit vectors ebe_b, and KebK e_b is the kernel basis vector bb of line L3. Each PsP_s is pointed and its matrix has rank dd, because it contains the identity rows of FF. For the step from ss to s+1s + 1 with pivot pp, the new constraint is h=Kph = K_p, and ht=xph t = x_p for the stored vector x=Ktx = K t. Line L5 splits the rays by the sign of xpx_p. Lines L7 and L8 test each pair of a positive and a negative ray for adjacency in PsP_s: the rows KiK_i for i∈Dsi \in D_s with xi=0x_i = 0 and yi=0y_i = 0 are AZ(r)∩Z(r′)A_{Z(r) \cap Z(r')}, and the code compares their rank with d−2d - 2. (The test that skips pairs with fewer than d−2d - 2 common zeros only saves time, since fewer rows cannot have rank d−2d - 2.) For an adjacent pair, line L7 forms ap y−bp xa_p\, y - b_p\, x with ap>0>bpa_p > 0 > b_p, which is the vector (hr)r′−(hr′)r(h r) r' - (h r') r of Lemma 4. Line L9 keeps R+∪R0R^+ \cup R^0 and the new vectors. By Lemma 4 this is exactly one vector for each extreme ray of Ps+1P_{s+1}. □\square

Theorem. efm_enumeration returns the sorted list of the EFMs of CC, each exactly once, as the primitive integer vector of its ray.

Proof. If d=0d = 0, then ker⁡S′={0}\ker S' = \{0\}, so C′={0}C' = \{0\}, C=φ(C′)={0}C = \varphi(C') = \{0\} has no EFMs, and the code returns the empty list. Otherwise, after the last pivot, D=F∪ΠD = F \cup \Pi is all coordinates, so P={t:Kt≥0}P = \{t : K t \ge 0\} and KP=C′K P = C'. By Lemma 5 the list holds one vector for each extreme ray of C′C', and by Lemma 3 these are the EFMs of C′C'. Line L10 drops the two-cycles and maps the others by φ\varphi; by Lemma 2 this gives each EFM of CC exactly once, up to a positive factor. The function primitive divides by the positive gcd after clearing denominators, so it keeps the sign and maps each ray to one integer vector, and the set removes nothing that is not a repeat. □\square

Remark (signs and reversible modes). A mode ee whose support has only reversible reactions gives two EFMs, ee and −e-e, which are different rays of CC. They come from two different extreme rays of C′C', one on the forward copies and one on the backward copies, so both are returned.

Complexity

  • Output size. The number of modes can be exponential in the size of the network: the chain of kk diamonds has 2k+22k + 2 reactions and 2k2^k modes. So no algorithm lists the modes in time polynomial in the input alone. This is a theorem.
  • Counting. Counting the modes is #P-complete (Acuña and co-authors 2009, Section 3.2), by a reduction from counting perfect matchings of a bipartite graph. So even the number of modes is hard to compute. This is a theorem.
  • Polynomial delay. If every reaction is reversible, the supports of the modes are the circuits of a linear matroid, and they can be listed with polynomial delay. Acuña and co-authors (2009) note that the question is open for networks with irreversible reactions. This is a theorem for the reversible case.
  • Cost of this method. Each of the at most mm steps tests at most R2R^2 pairs, and each rank test is a Gaussian elimination on at most mm rows with dd columns, which costs O(md2)O(m d^2) operations. So the time is O(m2d2R2)O(m^2 d^2 R^2) arithmetic operations, where RR is the largest list of rays after a step, and the space is O(mR)O(m R). This is a theorem.
  • Intermediate lists. RR is at least the number of modes and can be much larger, because the cones of the middle steps can have more extreme rays than the final cone. How large it gets depends on the order of the pivots, and Fukuda and Prodon (1996) discuss orders for the double description method in general. This is a heuristic: no order is known to be good on all inputs.
  • Exact arithmetic. With fractions, the entries can grow during the run. Scaling each new ray to coprime integers keeps them small in practice, which is a heuristic.

Properties

  • Exact and complete. With exact arithmetic the method returns every mode once and nothing else.
  • Not output sensitive. The work depends on the intermediate lists, not only on the output.
  • Deterministic. The set of modes does not depend on the order of the pivots, though the work does.
  • Generates the cone. The modes generate the flux cone by non-negative combinations with matching signs. The tests check that a random steady-state vector is a non-negative combination of the modes.
  • Splitting doubles some work. Each reversible reaction adds one column and one two-cycle to the split cone, and the two-cycle is removed at the end.

Variants and improvements

  • The original tableau method. Schuster and Hilgetag (1994) started from a tableau of the transposed stoichiometric matrix with an identity block and cancelled one metabolite at a time. It is also a double description method, with a different start.
  • The nullspace approach. Wagner (2004) started from a kernel basis, as this page does, so that only the sign constraints of reactions remain. The number of steps is then the rank of the matrix, which is at most the number of metabolites.
  • Combinatorial adjacency. Instead of the rank test, two rays are adjacent if no third ray is zero on all their common zeros. This test needs only the zero sets, and it can be stored as bit vectors. Gagneur and Klamt (2004) compare the two tests and describe the binary approach, which stores the zero sets as bit vectors to save memory.
  • Reversible reactions without splitting. Many tools treat reversible reactions directly: they process the irreversible constraints and handle the lineality space of the cone separately. This avoids the extra columns.
  • Partial lists. When the full list is too large, a mixed-integer program can find modes one at a time, for example the shortest modes or the modes that use a given reaction. Finding one mode is polynomial, but finding a shortest one is NP-hard (Acuña and co-authors 2009).
  • Related enumerations. Vertex enumeration of polytopes and Fourier-Motzkin elimination use the same pairing step.

When to use it

Use it to list all routes of a small or medium network, such as central carbon metabolism, to find the routes with the best yield, the reactions that every route needs, or the minimal cut sets. For a genome-scale model the list is usually far too large, and flux balance analysis or flux variability analysis answer most questions with linear programs. If you need only some modes, compute them one at a time instead.

Pitfalls

  • Forgetting the two-cycles. After splitting, each reversible reaction gives a two-cycle that is an extreme ray of the split cone but not a mode. It must be removed.
  • Exchange reactions. Whether exchange reactions are in SS changes the answer. Without them, only internal cycles are modes.
  • Floating point. The rank test with a tolerance can give wrong adjacency on large networks. Exact or integer arithmetic avoids this at a cost.
  • Memory. The intermediate lists, not the output, usually decide whether the run finishes.
  • Reading modes as fluxes. A mode is a direction, not a flux that the cell uses. Real flux vectors are combinations of many modes.

Implementations

Each implementation follows the pseudocode above. A comment @line links a line of code to a line of the pseudocode. Point at a line of the pseudocode to see the matching code. The build runs the native tests of each language.

elementary_flux_mode_enumeration.pyI0RawGitHub
# SPDX-License-Identifier: MIT
# Part of https://algorithm.tamnd.com/elementary-flux-mode-enumeration/. The authors are listed in prov/E5TT1K.jsonl.
"""Elementary flux modes by the nullspace form of the double description method.

Input: the n x m stoichiometric matrix S and a list rev of m booleans
(rev[j] is True if reaction j is reversible). Output: every elementary flux
mode, as a tuple of coprime integers, so each mode appears once up to a
positive factor. A mode e and its negative -e are two modes when both are
sign-feasible (a cycle of reversible reactions).

Steps:
1. Split each reversible reaction j into a forward copy (column S_j) and a
   backward copy (column -S_j). Every reaction of the new matrix S' is
   irreversible, so the modes of S' are the extreme rays of the pointed cone
   C = {x : S' x = 0, x >= 0}.
2. Take a kernel basis K of S' with an identity block on the free
   coordinates F. The cone {x in ker S' : x_F >= 0} has the columns of K as
   its extreme rays.
3. Add the constraints x_p >= 0 for the other coordinates p, one at a time,
   by the double description step: keep the rays with x_p >= 0, and combine
   each adjacent pair of a ray with x_p > 0 and a ray with x_p < 0 into a
   ray with x_p = 0. Two rays are adjacent if the matrix of the processed
   constraints that both satisfy with equality has rank d - 2, where
   d = dim ker S'.
4. Drop the two-cycles (forward and backward copy of one reaction) and map
   each ray back to the original reactions.
"""

from __future__ import annotations

from fractions import Fraction
from math import gcd
from typing import List, Sequence, Tuple

from sy3lp import nullspace, rank, rref


def primitive(x: Sequence[Fraction]) -> Tuple[int, ...]:
    """Scale a rational vector to coprime integers, keeping the sign."""
    den = 1
    for v in x:
        den = den * v.denominator // gcd(den, v.denominator)
    ints = [int(v * den) for v in x]
    g = 0
    for v in ints:
        g = gcd(g, abs(v))
    return tuple(v // g for v in ints) if g else tuple(ints)


def split_reversible(S, rev):
    """Return S' and back, where back[k] = (j, +1 or -1) for column k."""
    cols = list(range(len(rev)))
    back = [(j, 1) for j in cols]
    for j in cols:
        if rev[j]:
            back.append((j, -1))
    Sp = [[row[j] * s for j, s in back] for row in S]
    return Sp, back


def efm_enumeration(S: Sequence[Sequence[int]], rev: Sequence[bool]):
    """All elementary flux modes of (S, rev), sorted."""
    m = len(rev)
    Sp, back = split_reversible(S, rev)  # @line L1
    mp = len(back)
    if Sp and any(any(x != 0 for x in row) for row in Sp):
        _, piv = rref(Sp)
    else:
        piv = []
    free = [j for j in range(mp) if j not in piv]
    basis = nullspace(Sp, mp) if Sp else nullspace([], mp)  # @line L2
    d = len(basis)
    if d == 0:
        return []
    # The kernel matrix K (mp x d): row j gives x_j as a function of t.
    K = [[basis[b][j] for b in range(d)] for j in range(mp)]
    rays = [list(v) for v in basis]  # @line L3
    done = list(free)
    for p in piv:  # @line L4
        pos = [r for r in rays if r[p] > 0]  # @line L5
        zero = [r for r in rays if r[p] == 0]
        neg = [r for r in rays if r[p] < 0]
        new = []  # @line L6
        for a in pos:  # @line L7
            za = {i for i in done if a[i] == 0}
            for b in neg:
                common = [i for i in za if b[i] == 0]
                if len(common) < d - 2:
                    continue
                if rank([K[i] for i in common]) == d - 2:  # @line L8
                    new.append([a[p] * y - b[p] * x for x, y in zip(a, b)])
        rays = pos + zero + new  # @line L9
        done.append(p)
    modes = set()  # @line L10
    for r in rays:
        supp = [k for k in range(mp) if r[k] != 0]
        if len(supp) == 2 and back[supp[0]][0] == back[supp[1]][0]:
            continue  # a two-cycle j forward + j backward
        v = [Fraction(0)] * m
        for k in supp:
            j, s = back[k]
            v[j] += s * r[k]
        modes.add(primitive(v))
    return sorted(modes)  # @line L11


def brute_force_efms(S, rev):
    """EFMs by brute force over all supports.

    A sign-feasible steady-state vector e is an EFM if and only if the
    columns of S on supp(e) have a kernel of dimension 1. So for every
    support Q: if ker S_Q has dimension 1 and its basis vector has full
    support on Q, the vector or its negative (or both) is a mode when it is
    non-negative on the irreversible reactions.
    """
    from itertools import combinations
    m = len(rev)
    out = set()
    for size in range(1, m + 1):
        for Q in combinations(range(m), size):
            SQ = [[row[j] for j in Q] for row in S]
            B = nullspace(SQ, size) if S else nullspace([], size)
            if len(B) != 1 or any(x == 0 for x in B[0]):
                continue
            for sign in (1, -1):
                e = [sign * x for x in B[0]]
                if all(rev[j] or x > 0 for j, x in zip(Q, e)):
                    v = [Fraction(0)] * m
                    for j, x in zip(Q, e):
                        v[j] = x
                    out.add(primitive(v))
    return sorted(out)


# Network E of the page: R1 -> A, R2 A -> B, R3 A <-> C, R4 B -> C,
# R5 C ->, R6 B ->. Metabolites A, B, C.
S_E = [
    [1, -1, -1, 0, 0, 0],   # A
    [0, 1, 0, -1, 0, -1],   # B
    [0, 0, 1, 1, -1, 0],    # C
]
REV_E = [False, False, True, False, False, False]


def diamond_chain(k):
    """A chain of k diamonds: 2k + 2 irreversible reactions and 2^k EFMs.

    Metabolites M_0, ..., M_k. Uptake -> M_0, two parallel reactions
    M_{i-1} -> M_i for each i, and secretion M_k ->.
    """
    n, m = k + 1, 2 * k + 2
    S = [[0] * m for _ in range(n)]
    S[0][0] = 1
    for i in range(1, k + 1):
        for c in (2 * i - 1, 2 * i):
            S[i - 1][c] = -1
            S[i][c] = 1
    S[k][m - 1] = -1
    return S, [False] * m
sy3lp.py 327 lines
# SPDX-License-Identifier: MIT
# Shared module of the constraint-based metabolic pages of https://algorithm.tamnd.com/. The authors are listed in prov/.
"""Exact linear algebra and an exact simplex method in Fraction.

The reference copy is in biology/systems-biology/flux-balance-analysis/
impl/python/. The other constraint-based pages hold byte-identical copies.

Contents:
- rref(M), rank(M), nullspace(M, ncols), solve_linear(A, b): Gaussian
  elimination over the rationals.
- simplex_standard(A, b, c): minimize c x subject to A x = b, x >= 0, by the
  two-phase simplex method with Bland's rule.
- solve_lp(c, ...): a linear program with bounds, equality rows and <= rows,
  reduced to the standard form and solved by simplex_standard.
- polytope_vertices(A, b, lb, ub): all vertices of {x : A x = b,
  lb <= x <= ub} with finite bounds, by brute force. Tests use it as an
  independent reference.

A bound of None means minus or plus infinity. Every number is converted to
Fraction, so the results are exact.
"""

from __future__ import annotations

from fractions import Fraction
from itertools import combinations, product
from typing import List, Optional, Sequence, Tuple

Matrix = List[List[Fraction]]


def frac(x) -> Fraction:
    """Convert an int, a Fraction, a float or a string to Fraction."""
    return x if isinstance(x, Fraction) else Fraction(x)


def rref(M: Sequence[Sequence]) -> Tuple[Matrix, List[int]]:
    """Return the reduced row echelon form of M and its pivot columns."""
    R = [[frac(x) for x in row] for row in M]
    pivots: List[int] = []
    if not R:
        return R, pivots
    rows, cols = len(R), len(R[0])
    r = 0
    for col in range(cols):
        if r == rows:
            break
        p = next((i for i in range(r, rows) if R[i][col] != 0), None)
        if p is None:
            continue
        R[r], R[p] = R[p], R[r]
        inv = 1 / R[r][col]
        R[r] = [x * inv for x in R[r]]
        for i in range(rows):
            if i != r and R[i][col] != 0:
                f = R[i][col]
                R[i] = [a - f * b for a, b in zip(R[i], R[r])]
        pivots.append(col)
        r += 1
    return R, pivots


def rank(M: Sequence[Sequence]) -> int:
    """The rank of M (0 for an empty matrix)."""
    if not M or not M[0]:
        return 0
    return len(rref(M)[1])


def nullspace(M: Sequence[Sequence], ncols: int) -> Matrix:
    """A basis of {x : M x = 0}, one vector for each free column.

    The vector of free column f has x_f = 1 and x_g = 0 at the other free
    columns. M may have no rows; then the basis is the unit vectors.
    """
    if not M:
        return [[Fraction(int(i == j)) for i in range(ncols)] for j in range(ncols)]
    R, piv = rref(M)
    free = [j for j in range(ncols) if j not in piv]
    basis = []
    for f in free:
        x = [Fraction(0)] * ncols
        x[f] = Fraction(1)
        for i, p in enumerate(piv):
            x[p] = -R[i][f]
        basis.append(x)
    return basis


def solve_linear(A: Sequence[Sequence], b: Sequence) -> Optional[List[Fraction]]:
    """One solution of A x = b (free variables set to 0), or None if none."""
    if not A:
        return None if any(frac(x) != 0 for x in b) else []
    n = len(A[0])
    aug = [list(row) + [bi] for row, bi in zip(A, b)]
    R, piv = rref(aug)
    if n in piv:
        return None
    x = [Fraction(0)] * n
    for i, p in enumerate(piv):
        x[p] = R[i][n]
    return x


class LPResult:
    """status is 'optimal', 'infeasible' or 'unbounded'."""

    def __init__(self, status: str, x=None, value=None):
        self.status = status
        self.x = x
        self.value = value

    def __repr__(self) -> str:
        return f"LPResult({self.status!r}, {self.x!r}, {self.value!r})"


def _pivot(T: Matrix, basis: List[int], r: int, c: int) -> None:
    inv = 1 / T[r][c]
    T[r] = [x * inv for x in T[r]]
    for i in range(len(T)):
        if i != r and T[i][c] != 0:
            f = T[i][c]
            T[i] = [a - f * b for a, b in zip(T[i], T[r])]
    basis[r] = c


def _run(T: Matrix, basis: List[int], allowed: int) -> str:
    """Simplex iterations with Bland's rule on columns 0 .. allowed - 1.

    The last row of T holds the reduced costs and minus the objective value.
    Enter: the smallest column with a negative reduced cost. Leave: the row
    with the smallest ratio, ties broken by the smallest basic column.
    """
    m = len(T) - 1
    while True:
        obj = T[m]
        c = next((j for j in range(allowed) if obj[j] < 0), None)
        if c is None:
            return "optimal"
        best = None
        for i in range(m):
            if T[i][c] > 0:
                key = (T[i][-1] / T[i][c], basis[i])
                if best is None or key < best[0]:
                    best = (key, i)
        if best is None:
            return "unbounded"
        _pivot(T, basis, best[1], c)


def simplex_standard(A: Sequence[Sequence], b: Sequence, c: Sequence) -> LPResult:
    """Minimize c x subject to A x = b and x >= 0, exactly.

    Phase 1 minimizes the sum of one artificial variable per row. Phase 2
    starts from the basis that phase 1 finds. Bland's rule makes both phases
    terminate.
    """
    n = len(c)
    cc = [frac(x) for x in c]
    rows = []
    for row, bi in zip(A, b):
        r = [frac(x) for x in row]
        bi = frac(bi)
        if bi < 0:
            r, bi = [-x for x in r], -bi
        rows.append(r + [bi])
    m = len(rows)
    if m == 0:
        if any(x < 0 for x in cc):
            return LPResult("unbounded")
        return LPResult("optimal", [Fraction(0)] * n, Fraction(0))
    # Phase 1 tableau: [A | I | b], objective row = minus the sum of the rows.
    T = []
    for i, r in enumerate(rows):
        T.append(r[:n] + [Fraction(int(k == i)) for k in range(m)] + [r[n]])
    obj = [-sum(T[i][j] for i in range(m)) for j in range(n)] + [Fraction(0)] * m
    obj.append(-sum(T[i][-1] for i in range(m)))
    T.append(obj)
    basis = [n + i for i in range(m)]
    _run(T, basis, n + m)
    if T[m][-1] != 0:
        return LPResult("infeasible")
    # Drive the artificial variables out of the basis, or drop redundant rows.
    i = 0
    while i < len(T) - 1:
        if basis[i] >= n:
            j = next((j for j in range(n) if T[i][j] != 0), None)
            if j is None:
                del T[i]
                del basis[i]
                continue
            _pivot(T, basis, i, j)
        i += 1
    m = len(T) - 1
    T = [row[:n] + [row[-1]] for row in T]
    obj = list(cc) + [Fraction(0)]
    for i in range(m):
        cb = cc[basis[i]]
        if cb != 0:
            obj = [a - cb * t for a, t in zip(obj, T[i])]
    T[m] = obj
    status = _run(T, basis, n)
    if status == "unbounded":
        return LPResult("unbounded")
    x = [Fraction(0)] * n
    for i in range(m):
        x[basis[i]] = T[i][-1]
    return LPResult("optimal", x, sum(a * v for a, v in zip(cc, x)))


def solve_lp(c, A_eq=(), b_eq=(), A_le=(), b_le=(), lb=None, ub=None,
             maximize=False) -> LPResult:
    """Optimize c x subject to A_eq x = b_eq, A_le x <= b_le, lb <= x <= ub.

    lb defaults to 0 for every variable and ub to None (no upper bound). A
    bound of None is infinite. The result holds x and the value in the
    original variables.
    """
    n = len(c)
    lb = [0] * n if lb is None else lb
    ub = [None] * n if ub is None else ub
    # x_j = off_j + sum over k of coef[j][k] * y_k with y >= 0.
    cols: List[List[Tuple[int, int]]] = []
    off: List[Fraction] = []
    ny = 0
    for j in range(n):
        lo = None if lb[j] is None else frac(lb[j])
        hi = None if ub[j] is None else frac(ub[j])
        if lo is not None and hi is not None and lo > hi:
            return LPResult("infeasible")
        if lo is not None:
            off.append(lo)
            cols.append([(ny, 1)])
            ny += 1
        elif hi is not None:
            off.append(hi)
            cols.append([(ny, -1)])
            ny += 1
        else:
            off.append(Fraction(0))
            cols.append([(ny, 1), (ny + 1, -1)])
            ny += 2
    caps = [(j, frac(ub[j]) - frac(lb[j])) for j in range(n)
            if lb[j] is not None and ub[j] is not None]
    nslack = len(A_le) + len(caps)
    N = ny + nslack
    A: List[List[Fraction]] = []
    b: List[Fraction] = []

    def expand(row) -> Tuple[List[Fraction], Fraction]:
        out = [Fraction(0)] * N
        shift = Fraction(0)
        for j in range(n):
            a = frac(row[j])
            if a == 0:
                continue
            shift += a * off[j]
            for k, s in cols[j]:
                out[k] += a * s
        return out, shift

    for row, bi in zip(A_eq, b_eq):
        r, s = expand(row)
        A.append(r)
        b.append(frac(bi) - s)
    s_idx = ny
    for row, bi in zip(A_le, b_le):
        r, s = expand(row)
        r[s_idx] = Fraction(1)
        s_idx += 1
        A.append(r)
        b.append(frac(bi) - s)
    for j, cap in caps:
        r = [Fraction(0)] * N
        r[cols[j][0][0]] = Fraction(1)
        r[s_idx] = Fraction(1)
        s_idx += 1
        A.append(r)
        b.append(cap)
    sign = -1 if maximize else 1
    cy, _ = expand([sign * frac(x) for x in c])
    res = simplex_standard(A, b, cy)
    if res.status != "optimal":
        return LPResult(res.status)
    x = []
    for j in range(n):
        x.append(off[j] + sum(s * res.x[k] for k, s in cols[j]))
    return LPResult("optimal", x, sum(frac(a) * v for a, v in zip(c, x)))


def polytope_vertices(A: Sequence[Sequence], b: Sequence, lb: Sequence,
                      ub: Sequence) -> List[Tuple[Fraction, ...]]:
    """All vertices of {x : A x = b, lb <= x <= ub}, with finite bounds.

    A point is a vertex if and only if the columns of A at the coordinates
    strictly between their bounds are linearly independent. So try every set
    F of such columns and every choice of a bound for the other coordinates.
    The cost is exponential; use it only on small examples.
    """
    n = len(lb)
    lo = [frac(x) for x in lb]
    hi = [frac(x) for x in ub]
    r = rank(A) if A else 0
    found = set()
    for size in range(r + 1):
        for F in combinations(range(n), size):
            AF = [[row[j] for j in F] for row in A]
            if size and rank(AF) < size:
                continue
            rest = [j for j in range(n) if j not in F]
            for choice in product((0, 1), repeat=len(rest)):
                x = [Fraction(0)] * n
                for j, ch in zip(rest, choice):
                    x[j] = hi[j] if ch else lo[j]
                rhs = [frac(bi) - sum(frac(row[j]) * x[j] for j in rest)
                       for row, bi in zip(A, b)]
                if size:
                    sol = solve_linear(AF, rhs)
                    if sol is None:
                        continue
                    for j, v in zip(F, sol):
                        x[j] = v
                elif any(v != 0 for v in rhs):
                    continue
                if all(lo[j] <= x[j] <= hi[j] for j in range(n)):
                    found.add(tuple(x))
    return sorted(found)
test_elementary_flux_mode_enumeration.py 89 lines
# SPDX-License-Identifier: MIT
# Part of https://algorithm.tamnd.com/elementary-flux-mode-enumeration/. The authors are listed in prov/E5TT1K.jsonl.
"""Tests of efm_enumeration() against brute force over all supports."""

import random
from fractions import Fraction as F

from elementary_flux_mode_enumeration import (REV_E, S_E, brute_force_efms,
                                              diamond_chain, efm_enumeration,
                                              primitive)
from sy3lp import solve_lp

S_N = [
    [1, -1, -1, -1, 0, -1],
    [0, 2, 2, 1, 0, -1],
    [0, 0, 0, 1, -1, 0],
]


def is_steady(S, v):
    return all(sum(a * b for a, b in zip(row, v)) == 0 for row in S)


def test_network_e():
    modes = efm_enumeration(S_E, REV_E)
    assert modes == sorted([
        (1, 1, 0, 0, 0, 1),    # R1 + R2 + R6
        (1, 0, 1, 0, 1, 0),    # R1 + R3 + R5
        (1, 1, 0, 1, 1, 0),    # R1 + R2 + R4 + R5
        (0, 1, -1, 1, 0, 0),   # the cycle R2 + R4 - R3
    ])
    # R1 + R2 + R4 + R5 is the sum of two other modes, yet it is a mode.
    assert tuple(a + b for a, b in zip((1, 0, 1, 0, 1, 0), (0, 1, -1, 1, 0, 0))) \
        == (1, 1, 0, 1, 1, 0)
    # The sum of the first two modes is steady but not elementary.
    s = tuple(a + b for a, b in zip((1, 1, 0, 0, 0, 1), (1, 0, 1, 0, 1, 0)))
    assert is_steady(S_E, s) and primitive([F(x) for x in s]) not in modes


def test_network_n():
    modes = efm_enumeration(S_N, [False] * 6)
    assert modes == [(2, 0, 0, 1, 1, 1), (3, 0, 1, 0, 0, 2), (3, 1, 0, 0, 0, 2)]


def test_diamond_chain_doubles():
    for k in range(1, 6):
        S, rev = diamond_chain(k)
        assert len(efm_enumeration(S, rev)) == 2 ** k


def test_all_reversible_cycle_counts_both_directions():
    # A <-> B <-> C <-> A: one cycle, in two directions.
    S = [[-1, 0, 1], [1, -1, 0], [0, 1, -1]]
    assert efm_enumeration(S, [True] * 3) == [(-1, -1, -1), (1, 1, 1)]


def random_network(rng):
    n, m = rng.randint(1, 3), rng.randint(3, 7)
    S = [[rng.choice([-1, -1, 0, 0, 0, 1, 1, 2]) for _ in range(m)]
         for _ in range(n)]
    rev = [rng.random() < 0.3 for _ in range(m)]
    return S, rev


def test_random_against_brute_force():
    rng = random.Random(31)
    for _ in range(60):
        S, rev = random_network(rng)
        modes = efm_enumeration(S, rev)
        assert modes == brute_force_efms(S, rev)
        for e in modes:
            assert is_steady(S, e)
            assert all(rev[j] or x >= 0 for j, x in enumerate(e))


def test_modes_generate_the_cone():
    # Every sign-feasible steady state is a non-negative combination of modes.
    rng = random.Random(32)
    for _ in range(20):
        S, rev = random_network(rng)
        modes = efm_enumeration(S, rev)
        if not modes:
            continue
        m = len(rev)
        weights = [rng.randint(0, 3) for _ in modes]
        v = [sum(w * e[j] for w, e in zip(weights, modes)) for j in range(m)]
        A = [[e[j] for e in modes] for j in range(m)]
        res = solve_lp([0] * len(modes), A_eq=A, b_eq=v)
        assert res.status == "optimal"

History

Schuster and Hilgetag (1994) defined elementary flux modes and gave the first algorithm, which combines pairs of rows of a tableau to cancel one coordinate at a time. Schuster, Fell and Dandekar (2000) made modes a general definition of a metabolic pathway and computed them for example networks. In 2004 Wagner started the iteration from a kernel basis, and Gagneur and Klamt showed that the known algorithms are forms of the double description method, which comes from the study of polyhedral cones in the 1950s. Acuña and co-authors (2009) proved that counting the modes is #P-complete.

References

  1. Stefan Schuster and Claus Hilgetag, On elementary flux modes in biochemical reaction systems at steady state, Journal of Biological Systems 2(2), 1994, 165-182, the definition of elementary flux modes and the first algorithm that combines pairs of vectors to cancel one coordinate at a time
  2. Stefan Schuster, David A. Fell and Thomas Dandekar, A general definition of metabolic pathways useful for systematic organization and analysis of complex metabolic networks, Nature Biotechnology 18(3), 2000, 326-332, the use of elementary modes as metabolic pathways, with the computation of modes for example networks
  3. Clemens Wagner, Nullspace approach to determine the elementary modes of chemical reaction systems, Journal of Physical Chemistry B 108(7), 2004, 2425-2431, the start of the iteration from a kernel basis of the stoichiometric matrix
  4. Julien Gagneur and Steffen Klamt, Computation of elementary modes, a unifying framework and the new binary approach, BMC Bioinformatics 5, 2004, 175, the description of the known algorithms as the double description method, the splitting of reversible reactions, the adjacency tests, and the binary approach
  5. Komei Fukuda and Alain Prodon, Double description method revisited, Combinatorics and Computer Science, Lecture Notes in Computer Science 1120, 1996, 91-111, the double description step, the adjacency test by tight constraints, and the effect of the order in which constraints are added
  6. Vicente Acuña, Flavio Chierichetti, Vincent Lacroix, Alberto Marchetti-Spaccamela, Marie-France Sagot and Leen Stougie, Modes and cuts in metabolic networks, complexity and algorithms, BioSystems 95(1), 2009, 51-60, Section 3.2 (counting elementary modes is

About this page

The build computes these levels from the evidence in the repository. Each row says what the next level needs. Read what the levels mean.

LadderLevelWhat the next level needs
Human proofH1 sketch
  • a full proof of time.per_step
  • a full proof of time.worst
  • a full proof of space.extra
LeanL0 no Lean part
  • name a Lean module in the lean field (07)
Code (python)I0 not checked yet
  • the tests did not run in this build
VisualV0 none
  • add viz/scene.ts or a figure (10)
WritingW2 basic
  • a scene preset for the example