2.1 Finding invariants as a Constraint Satisfaction Problem
We will illustrate our new method for computing the invariants with the case of P-invariants (but T-invariants, being dual, would work in the same fashion). Consider a Petri net with
p places and
t transitions, these transitions represent reactions
Li →
Ri, where
Li encodes the stoichiometry of the reactants as a vector over places, and
Ri the same for the products of the reaction. A P-invariant is a vector

s.t.
VT ·
I = 0, i.e. ∀1 ≤
i ≤
t V ·
Li =
V ·
Ri. Since those vectors all live in

, it is quite natural to see this as a Constraint Satisfaction Problem (CSP) [
18-
20] with
t (linear) equality constraints on
p finite domain (FD) variables.
Example 2 Using the Petri net of Example 1 we have:
This results in the following equations:
where obviously equation (2) is redundant.
The task is actually to find invariants with minimal support, with respect to set inclusion (a linear combination of invariants belonging to

also being an invariant), i.e., having as few non-zero components as possible, these components being as small as possible, but of course non trivial, we thus add the constraint that
V ·
1 > 0.
Example 3 In our running example we thus add A + E + AE + B > 0.
Now, to ensure minimality the labelling is invoked from small to big values. This means that for each variable, if an enumeration remains necessary after constraint propagation, values are tried in an increasing order starting at 0. This is closely related to the enumeration strategy used in the mixed integer programming method of [
16] that allows them to look for
shortest elementary modes. Such a restriction in the construction of the basis might thus also be possible in our approach. Then, a branch and bound procedure is wrapped around this search for solutions, maintaining a partial base

of P-invariant vectors and adding the constraint that a new vector
V is solution if

, which means that its support is not bigger than that of any vector of the base.
Unfortunately, even with the last constraint, no search heuristic was found that makes removing subsumed P-invariants unnecessary. Thus, if a new vector is added to

, previously found vectors with a bigger support must be removed. Section 2.6 will demonstrate other structural properties for which this step is not necessary.
The algorithm can be summarized as follows:
Algorithm 1 Minimal invariants computation
1: post the CSP for invariant V: ∀1 ≤ i ≤ t V · Li = V · Ri and V · 1 > 0
2: repeat
3: find a solution, enumerating from low to high
4: add the solution to the basis
5: remove non-minimal invariants from the basis if there are any
6: post the new constraint

7: until no solution found
8: expand symmetrical solutions of

This algorithm was implemented directly into Nicotine
1 and then added to BIOCHAM [
9], which are both programmed in GNU-Prolog, and allowed for immediate testing.
Example 4 In our running example we find two minimal semi-positive P-invariants:
• E = AE = 1 and A = B = 0
• A = B = AE = 1 and E = 0
2.2 Equality classes
The problem of finding minimal semi-positive invariants is clearly EXPSPACE-hard since there can be an exponential number of such invariants. For instance the model given in Example 5 (described in [
12] among others, and called "classic X-Y" in [
17], where × is the number of places between each pair of transitions and Y the number of transitions) has 2
n minimal semi-positive P-invariants (each one with either
Ai or
Bi equal to 1 and the other equal to 0).
Example 5 (Classic 2-n) (Figure)
A first remark is that in this example, there is a variable symmetry between all the pairs (Ai, Bi) of variables corresponding to places. This symmetry is easy to detect (purely syntactical) and can be eliminated through the usual ordering of variables, by adding the constraints Ai ≤ Bi.
This classical CSP optimization is enough to avoid most of the trivial exponential blow-ups and corresponds to the initial phase of
parallel places detection and merging of the equality classes optimization [
21] for the standard Fourier-Motzkin algorithm. Note however that in that method, classes of equivalent variables are detected and eliminated before and
during the invariant computation, which would correspond to local symmetry detection and was not implemented in our prototype.
Moreover, in [
21],
equality class elimination is done through replacement of the symmetric places by a representative place. The full method reportedly improves by a factor two the computation speed. Even if in the context of the original article this is done only for ordinary Petri nets (Petri nets where the weights are only 0 or 1), we can see that it can be even more efficient to use this replacement technique in our case:
Example 6
...
A + B
![[implies]](/corehtml/pmc/pmcents/x21D2.gif)
4*C
...
Instead of simply adding A ≤
B to our constraints, which will lead to 3 solutions when C = 1
before symmetry expansion: (
A,
B)
![[set membership]](/corehtml/pmc/pmcents/x2208.gif)
{(0, 4), (1, 3), (2, 2)},
replacing A and B by D will reduce to a single solution D = 4
before expansion of the subproblem A +
B =
D.
This partial detection of independent subproblems, which can be seen as a complex form of symmetry identification, can once again be done syntactically at the initial phase, and can be stated as follows: replace ∑i ki * Ai by a single variable A if all the Ai occur only in the context of this sum i.e., in our Petri net all pre-transitions of Ai are connected to Ai with ki edges and to all other Aj with kj edges and same for post-transitions. For a better constraint propagation, another intermediate variable can be introduced such that A = gcd(ki) · A'. In our experiments the simple case of parallel places (i.e., all ki equal to 1 in the sum) was however the one encountered most often.
2.3 Example, the MAPK Cascade
The MAPK signal transduction cascade is a well studied system that appears in lots of organisms and is very important for regulating cell division [
22]. It is composed of layers, each one activating the next, and in detailed models shows two intertwined pathways conveying EGF and NGF signals to the nucleus.
A simple MAPK cascade model, that of [
23] without scaffold, is used here as an example to show the results of P-invariant computation.
Seven minimal semi-positive P-invariants are found almost instantly. Intuitively, they represent the different levels of the cascade (i.e., RAFK, RAF, MEK and MAPK) and the corresponding phosphatases (RAFPH, MEKPH and MAPKPH). The use of those P-invariants as visual
modules, as depicted in Figure is quite similar to one part of the approach of [
24] to make biochemical systems more easy to grasp. The full list is given in Table .
| Table 1P-invariants of the MAPK cascade model of [23] |
In the next section other examples are used as benchmarks of this method, they are all much bigger than this one, which had only about 30 compounds, however note that one of those is still a model of the MAPK signalling cascade.
Note that these 7 P-invariants define 7 algebraic conservation rules (i.e., mass conservation) and thus decrease the size of the corresponding ODE model from 22 variables and equations to only 15.
2.4 Evaluation on other biochemical examples
Schoeberl's model is a more detailed version of the MAPK cascade, which is quite comprehensive [
8], but too big to be studied by hand. It can however be easily broken down into fourteen more easily understandable units formed by P-invariants, as shown in Table , along other examples representing amongst the biggest reaction networks publicly available.
| Table 2Minimal semi-positive P-invariant computation on bigger models of biochemical reaction networks |
All the curated models in the September 2010 release of biomodels.net were also tested and none of them required more than 1s to compute all its minimal P-invariants.
We could not compare our results with those provided in [
13] since the models they use, coming from metabolic pathways flux analyses, do not have an integer stoichiometry matrix, however the examples of Table show the feasibility of P-invariant computation by constraint programming for quite big networks. Note that for networks of this size, the upper bound of the domain of variables had to be set manually. It was actually set to the value 8, which is about the double of the maximum value in all the biological models we have encountered up to now. The only over-approximation of the upper bound found was the product of the
l.c.m. of stoichiometric coefficients of each reaction, which explodes really fast and leads to unnecessarily long computation. The manual bound results in a loss of completeness, but it is not enforced either by QR-factorization methods, and does not seem to miss anything on real life examples.
Though they are not specifically suited for this task (i.e., finding integer invariants), we tried some of the most well known Elementary Flux Modes computing packages on these examples. METATOOL [
14] and efmtool [
25] were chosen, since both can be run as Matlab packages. The results are not included in Table but are summarized with the non-biochemical examples of next section.
2.5 Non-biochemical benchmarks
Even if our main purpose is to use the insight on the dynamics gained from the structural properties computed by our CSP, an evaluation of the proposed method on non-biochemical models remains of interest.
The literature on invariant computation is quite large, however there does not seem to exist any standardized benchmark. Each author selects some examples with different properties (see for instance [
12] from which only a few examples are used in [
17], even though it is cited as reference) and few reuse the previously published sets of examples.
Moreover, even when the software used in these articles is available, usually only binary implementations are available, and only for some specific architectures and through a specific request process. In some cases none is provided at all.
Therefore, using a machine comparable in specifications, we chose to reuse the data published in the most recent work, that of Ciardo et al. [
17]. Since we had to re-encode ourselves the selected examples, only a subset of their benchmarks is covered, namely the classical dining philosophers problem [
26], the standard exponential invariant case [
12] and the circular trains [
27]. These seem to cover the whole range of different schemes appearing in [
17].
Note that there are usually many symmetries in these parametric examples and thus that a more powerful (or manual) symmetry detection would be called for in these specific cases. Nevertheless, since (intracellular) biochemical systems usually do not generate such structure, we did not push further the integration of more advanced symmetry detection/breaking in our tools.
METATOOL's "CONSERVATION RELATIONS" were used when possible, but that only allows to find - as expected - 91 out of the 10 billion invariants for the classic example, in 0.33s. Models were thus transposed such that METATOOL and efmtool's EFM search correspond to P-invariant computation. Transposed models appear with a 'b' ending in the data repository. efmtool was given the SBML files as input whereas some .dat files were generated for METATOOL. For all the examples of this section as well as Kohn's map, METATOOL gave the error message "Cannot sort modes with more than 52 rows" that was interpreted as some kind of "out of memory" error. For efmtool, in the same cases (all examples of this section plus Kohn's map) the computation was stopped after 10 minutes or more, with messages like "iteration 43/116: 224850 modes, dt = 2040206ms." that were interpreted as overtime. Note however that as already stated, these packages do not focus on integer stoichiometric matrices and thus have a much broader scope that might explain their poor performance on our benchmarks.
The results are presented in Table , where as in [
17] "om" represents an out-of-memory error, and "ot" an overtime. "na" was used when conservation relations are strictly fewer than P-invariants. The results seem to indicate that a constraint-based approach fares reasonably well, usually in the same order of magnitude as some purely symbolic encoding via decision diagrams [
17], whereas the solutions of the CSP are explicit. Even in the case where finding explicit solutions revealed too costly (classic 10-10, which has 10
10 minimal P-invariants), one can stop the computation before symmetry expansion and get an answer in a reasonable time.
| Table 3Minimal semi-positive P-invariant computation on general (non-biochemical) benchmarks of the literature |
The CSP approach can therefore be seen as a kind of intermediate between purely implicit (i.e., solutions encoded, for instance as a decision diagram, and needing to be decoded to be displayed) and purely explicit methods. It also remains very flexible as next section will prove and could incorporate many more optimizations (variable ordering heuristics, more symmetry elimination, etc.) at a quite low cost.
All the 80 Petri nets of
http://www.petriweb.org/ were also tested. Only one took more than 1s: model 1516, which took about 3s to compute 1133 minimal P-invariants. Since we do not have data for the other approaches on these models they were not added to the table of results but they confirm the feasibility and generality of our approach.
We think that the structure of this kind of net is however very different (average degree, arc weights, etc.) from that of usual biochemical reaction models and intend to explore this distinction further in the future.
2.6 Generalizing the approach to other structural properties
An interesting feature of the presented method is that it is actually flexible enough to encompass other structural properties than place or transition invariants. This is, to our knowledge, not the case of other alternative methods.
If for the Petri net of Example 1 one obtained the constraints shown in Example 2 to compute P-invariants, one can notice that they can easily be adapted to compute sur- or sub-invariants, i.e., weighted sums that can only grow (resp. decrease) during the evolution of the system (see [
28], for instance, for a formal definition). Indeed the following CSP describes exactly all the sub-invariants of the system and is obtained in the same manner but with ≤ instead of =.
Example 7 Using the Petri net of Example 1:
results in the following FD constraints:
Sur-invariants would be obtained with ≥ instead of ≤.
Now, getting a basis of minimal sub/sur-invariants can be done with the same branch and bound technique used for invariants, allowing to obtain information on pools of species of the biochemical system that, for instance, never increase during any ODE simulation.
One can go slightly farther and once again reuse the same machinery, including symmetry breaking, to compute siphons and traps of the Petri net (see [
29] for definition and example of use in biology). This time a boolean CSP is obtained with the following constraints for the example of traps:
Example 8 Using the Petri net of Example 1 we obtain the following boolean constraints:
To compute siphons one simply need to reverse
![[implies]](/corehtml/pmc/pmcents/x21D2.gif)
into
![[is implied by]](/corehtml/pmc/pmcents/x21D0.gif)
.
Note that in the boolean domain, the support minimality can be imposed by enumerating in increasing (lexicographic) order, there is no need for any a posteriori check of minimality (step 5 of Algorithm 1). The algorithm thus becomes:
Algorithm 2 Minimal traps computation
1: post the CSP for trap V
2: repeat
3: find a solution, enumerating from low to high
4: add the solution to the basis
5: post the new constraint

6: until no solution found
7: expand symmetrical solutions of

This computation of traps and siphons can actually bring information about the dynamics of the model, including temporal logic formulae that it satisfies
2, together with other structural properties [
4,
30] they provide an interesting toolkit to analyze structurally the dynamics of a Systems Biology model.