## Abstract

A fundamental problem in immunology is that of understanding how the immune system selects promptly which cells to kill without harming the body. This problem poses an apparent paradox. Strong reactivity against pathogens seems incompatible with perfect tolerance towards self. We propose a different view on cellular reactivity to overcome this paradox: effector functions should be seen as the outcome of cellular decisions which can be in conflict with other cells' decisions. We argue that if cellular systems are frustrated, then extensive cross-reactivity among the elements in the system can decrease the reactivity of the system as a whole and induce perfect tolerance. Using numerical and mathematical analyses, we discuss two simple models that perform optimal pathogenic detection with no autoimmunity if cells are maximally frustrated. This study strongly suggests that a principle of maximal frustration could be used to build artificial immune systems. It would be interesting to test this principle in the real adaptive immune system.

## 1. Introduction

Reactivity is usually associated with the chemical notion of affinity. In simple chemical systems, affinity is related to the probability that a reaction takes place. Reactions are also assumed to be instantaneous. This view may not be generally applicable to biological systems. In biological systems, agents are complex entities. They may interact with several elements at a time and reactions require time. In general, biological reactions comprise many elementary chemical reactions and physical transformations. Conformational intermediate processes can be involved when proteins interact and internal cellular signalling is required to mediate cellular interactions. Typically, there is a time lag between the beginning of an interaction and its completion, which leads to new mechanisms. The kinetic proofreading mechanism is the best known example. If a sequence of specific processes precedes the production of ‘major signals’, very specific signalling can be achieved as in DNA transcription (Hopfield 1974) or T-cell activation (Mckeithan 1995). Another example arises in cellular interactions. Recently, it was observed that the direction of an immunological synapse towards an antigen-presenting cell (APC) can be changed towards another APC if the last one provides a stronger stimulus (Depoil *et al.* 2005). Thus, cells can act as complex agents performing decisions rather than elementary reactions. These decisions can be complex, mediated by many different ligands and receptors. They also depend on the context. Had not the second APC appeared, the first synapse could have triggered cellular activation.

An unappreciated outcome of cellular decisions is that extensive cross-reactivity can lead to absolute tolerance, an apparent paradox. This can happen in cellular frustrated systems (de Abreu *et al.* 2006). For a simple example, consider a system with three cells interacting according to the interaction list (IList) in figure 1*a* (right). All cells are very reactive in that they always try to form stable conjugates with other cells. Stable conjugates can nevertheless be established with only one cell at a time. Hence, each cell gives priority to conjugations with cells that are ranked first in their IList. An interesting dynamics then takes place. If cells A and B are conjugated and cell C is alone, cell C can form a new conjugate with cell B, destroying the previous AB conjugate. Cell A is said to be frustrated by the presence of cell C, since otherwise it could have formed a long-lived conjugate. Instead, it returns to the non-conjugated state, in which case it can destabilize the former conjugate to form a conjugate with cell C, and so on. Cellular frustrated systems never reach stable configurations. Rather, they live in steady states in which conjugates have well-defined lifetimes. If a biological reaction requires a time longer than this typical time to be triggered, then no cellular reactions would take place. Consequently, this shows that, in biological systems, non-reactivity can be built using reactive elements. It should be noted that no blocking agents were used. Rather, it is the reactive nature of each agent that blocks each others' potential reactivity.

Another interesting result can be obtained if the cross-reactivity in the system is reduced. Imagine that cell B is removed from cell C's interaction list (figure 1*b*). Cross-reactivity is reduced since cell C would not interact with cell B anymore. However, in this case, a stable conjugation, and thus a reaction, occurs between cells A and B. This example shows that, in a biological system, reactivity can be an emergent phenomenon: reactivity between A and B changed, even though these cells remained the same.

These ideas can be important to understand how the adaptive immune system performs self/non-self discrimination. The immune system should be tolerant towards self and highly reactive towards non-self (Burnet & Fenner 1949). According to the traditional view, cellular reactions are, in their essence, instantaneous, and hence high reactivity against non-self implies that some pathogen-derived peptides cannot exist in the body. This is rather restrictive and has important conceptual consequences. For instance, it became difficult to understand how a baby—potentially, half self and half non-self—could be born without autoimmunity. Simultaneously, it would imply that the body is defenceless relatively to ‘cancerous’ cells, bearing only self antigens. For these reasons, some argued that the immune system could not be triggering its effector functions based on a self/non-self discrimination mechanism (Janeway 1992; Matzinger 1994).

Cellular frustration provides an alternative view. In §2 we present how cellular frustration can be modelled, and then discuss the principle of maximal frustration. Then, we discuss two simple models that use maximal frustration to reconcile absolute tolerance towards self with prompt and specific reactivity towards pathogens. The first model is an (abstract) artificial immune system with no obvious straightforward application to immunology. It has the advantage of drawing a clear mathematical picture of how cellular frustration works in a system with arbitrary diversity. The second model is intended to picture how the adaptive immune system is activated in the spleen and lymph nodes.

## 2. Modelling cellular frustration

A generalization of the examples in §1 can be straightforwardly established for systems with *N* cell and *M* cell types. In general, we denote by *N*_{α,μ} the number of clones of cell type *α* and subtype *μ*. All cells are associated with an IList, where all cell types and subtypes are ranked. Cell clones occupy the same position in the other cells' ILists. Cells belonging to different cell types occupy different positions, as they bear different ligands. Further subdivisions can still exist to distinguish cells from different cell subtypes, and account for further diversity. All ILists are defined once and for all during the simulations.

A simple stochastic dynamics can be defined as follows (figure 2). First, a random permutation {*p*_{i}} of integers between 1 and *N* is generated (*i*=1, …, *N*). This list is used to sequentially select cells. At rate d*t*^{−1}, a new interaction takes place between cell number, *p*_{i}, and another randomly drawn cell, *r*. Then, both cells' ILists are analysed. If cell *r* is ranked higher than the cell conjugated to cell number *p*_{i} or if cell number *p*_{i} is not conjugated, then cell number *p*_{i} tries to form a conjugate with cell number *r*. One can say that cell *p*_{i} favours the interaction. The same analysis is performed with respect to cell *r*'s IList. If both cells favour the interaction, then a new conjugate is formed and previous conjugations are destroyed, if they existed. If cell number *p*_{i} ranks cell number *r* on the same position as the cell conjugated to cell number *p*_{i}, then a new conjugation is formed with probability *p*_{deg}, corresponding to a degenerate decision. Each conjugate can also dissociate spontaneously with a (very small) probability *p*_{dis}.

This procedure is repeated for all *N* numbers in the sequence {*p*_{i}}, completing one iteration. Hence, one iteration lasts Δ*t*=*N* d*t*. As many iterations as required are performed and conjugate lifetimes involving different cell types *α* and *β*, *τ*_{αβ}, are registered.

## 3. The principle of maximal frustration

In cellular frustrated systems, every conjugate can be destabilized by interactions with other cells. Stronger frustration implies larger conjugation rates and shorter conjugation lifetimes *τ*_{αβ}. Maximally frustrated systems should have maximal conjugation rates. However, the complex dynamics in these systems generates a distribution of lifetimes and not a single lifetime. Consequently, frustration maximization requires a functional optimization process, and different measures and algorithms could be applied. In general, it may not be possible to maximize all conjugation rates simultaneously because they all depend on each other. Also, the huge number of different possible systems does not allow performing exhaustive searches to find maximally frustrated systems. Instead, these should be found within subsets of systems following a well-motivated immunological criterion. Since only stable conjugates can trigger effector functions (Celli *et al.* 2008), the longest conjugation lifetimes should be minimal so that these could work as triggering thresholds distinguishing normal from pathogenic cells. For maximally frustrated systems, these lifetimes should be minimal. Prompt pathogenic detection can be achieved because, in maximally frustrated systems, the introduction of an arbitrary new cell tends to reduce frustration and generate long-lived interactions involving the new cell. We assume that cells can use different triggering lifetimes depending on the interacting cell types, but are indifferent relative to the particular cell subtype. As we will see, this is enough to accomplish almost perfect detection in two different classes of simple models. It constitutes the basis of the principle of maximal frustration, which motivates the studies presented in the following sections.

## 4. Immune detection by cellular frustration: example of an artificial immune system

The first model considers artificial immune systems. There is only one cell type and *M* different cell subtypes, each having a different IList. Each system has *N*<*M* cells. We analysed self systems with one cell per cell subtype. Maximally frustrated systems were selected within the subset of systems where all cells play equivalent roles. Their ILists are as follows:

Here, *L*_{i}(*j*) denotes the cell subtype ranked in the *j*th position in the IList of cell subtype *i*; *δ* is an integer; and the symbol [*j*] represents an integer *j* modulus *N*. We numerically simulated all systems with different ILists and *N*=6 and 7. Systems for which the longest lived conjugates have the shortest lifetimes verify

In these systems, ILists are defined so that every conjugate can be destabilized by all other cells in the population, and only once. Figure 3 presents an example: if cell subtype *i* is ranked in the *k*th position in cell subtype *j* IList, then cell subtype *j* is ranked in the (*n*−*k*)th position. Therefore, if cell subtype *j* is on the top of cell subtype *i* IList, then cell subtype *i* is on the bottom of cell subtype *j* IList, and henceforth. Frustration is maximized as, by symmetry, if there were conjugates that could be destabilized by more than *N*−2 cells (thus having a higher conjugation rate), there would have to be fewer frustrated conjugates, destabilized by a smaller number of cells.

ILists in maximally frustrated systems are specifically organized. Their structure can be made apparent using the geometrical representation in figure 3*b*. In this representation, a closed directed line is drawn crossing once all those cells that can exist in the population. Using this line, it is easy to derive the system's IList in figure 3*a*: each cell has on the *k*th position in its IList a cell that is *k* positions away from it, following the closed line along the arrow's direction. Thus, ILists are not arbitrary, even though many different systems, exactly (*M*−1)!, share ILists with the same structure. In figure 3*c*, another possible system's IList is shown. From these systems, any subpopulation with *N* cells (*N*<*M*) can be selected, which still preserves the same structure of the original population.

An artificial intelligence problem could then be defined. Consider that cells have to use the decision dynamics based on the ILists discussed in §2, in order to be recognized as self. We assume that innate immunity mechanisms enforce this to be true. Would it be easy to introduce in a system an invader cell that establishes only short-lived interactions as the other self cells do? This could be achieved if the new cell subtype and the IList match the system's IList. If one assumes the new cell could select an IList at will, how likely could this be? Since any association between cell subtype and ILists could match one of the (*N*−1)! possible system's ILists, the best an intruder cell could do is to use a randomly selected IList. Thus, this has a very small probability, 1/(*N*−1)!, of matching the system's IList.

The impact of an IList mismatch on the invader cell dynamics can be best appreciated using figure 3. Consider a conjugate formed by self cells 1 and 4 as shown in figure 3*b*. All cells along the directed path starting at cell 1 and ending at cell 4 can potentially destabilize cell 1 since they are ranked higher in its IList. Similarly, cells lying between cells 4 and 1, along the directed path starting at cell 4, can potentially destabilize cell 4. In general, in circular frustrated systems, all conjugates can be potentially destabilized by *N*−2 cells as a closed directed line formed with any two cells' ILists crosses exactly *N* cells. This is not the case if conjugates involve an intruder cell with a randomly chosen IList. Then, the intruder's IList does not agree with the self cell's IList. A closed directed line can be drawn with the intruder's IList and the system's IList that crosses a number of cells smaller than *N.* An example is presented in figure 3*d*. This example considers a conjugate formed by self cell 1 and invader cell 2. The invader cell uses an IList that agrees with the system's IList in figure 3*c*, while the self cell uses the system's IList in figure 3*b*. Cells along the intruder's IList line (dashed line in figure 3*d*) between cell 2 and cell 1 can potentially destabilize the intruder cell 2. Those cells along the system's IList line between cells 1 and 2 can destabilize cell number 1. This closed directed line crosses a number of cells smaller than *N*−2. Hence, a conjugate formed by cells 1 and 2 can be potentially destabilized by a smaller number of cells and consequently its lifetime is longer than if cell number 2 were a self cell.

### 4.1 Example of an artificial immune system: numerical experiments

We performed numerical simulations to estimate the probability of detecting invading cells with randomly selected ILists in a circular frustrated system and for a finite computation time (figure 4). All simulations were performed for 5×10^{5} iterations. We considered that the invader cell had subtype 1 and a randomly generated IList. Typical cumulative distributions for systems with 501 cells are shown in figure 4*a*. These distributions show the fraction of conjugates that lasted at least *τ* iteration steps. Crosses correspond to conjugates involving the invader cell, while asterisks correspond to other conjugates. The line overlapping these asterisks shows the typical distribution for a system with no invader.

From these results it is clear that the invader cell establishes much longer conjugations than the other cells. A detection threshold *τ*_{thr} could be defined to discriminate conjugates involving the intruder cell. If all conjugates lasting longer than *τ*_{thr} were eliminated, then non-self cells could be eliminated from the system without inflicting autoimmunity. This is what could be called ‘surgical’ detection. The reason why detection can be achieved with high specificity and without autoimmunity can be easily understood. The dynamical system could be thought of as composed of a long-lasting conjugate involving the invader cell and the other self cells. Since circular frustrated systems preserve their properties upon reduction of their elements, self cells remain in their frustrated dynamics independently of the long-lived conjugations formed by the intruder cell.

In order to estimate the probability that a conjugate involving the invader cell lasts more than *τ*_{thr} iteration steps, we performed simulations with 20 000 different invaders and different population sizes. The number of cells that escaped detection is extremely small and decreases exponentially with *N* (figure 4*b*). For *N*=1001, only 0.03 per cent of invaders escaped detection. We also considered what happened when a second invader, identical to the first, was introduced. We ran the simulations again in this case and indeed verified that the number of intruders that escaped detection decreased considerably. In particular, for populations with more than 200 cells, no invaders escaped detection. This is a remarkable result that shows that it is impossible for invaders to escape detection and grow in circular frustrated systems. It also confirms our view that the same cell can be sensed differently depending on how many other identical cells exist in the system.

### 4.2 Example of an artificial immune system: discussion of results

It is conceptually important to understand why detection becomes possible even when the invading cell is equal to a self cell. In this case, the effective number of cells available to destabilize conjugates formed by the new invading cell is smaller. Consequently, conjugates involving the invading cell or other identical cells become more stable. An intrusion detection criterion based on conjugation times can detect the invader cell subtype, and hence it can be used to confine its growth. However, in this case, detection would not be surgical, since it could not differentiate the new cell from other identical cells.

Another important observation is that detection is more effective for larger populations. This happens as detection is a collective phenomenon. Owing to the extended cross-reactivity in the system, many self cells can respond to an invader. In figure 4*c*, we show the frequency of detections as a function of cell number *i* for a population with *N*=501. Three different curves are shown, for simulations involving the introduction of 1,2 or 3 identical invaders. From figure 4*c*, it is clear that many different cells can be involved in detection. This also makes the detection mechanism quicker, and, importantly, the times required for detection do not increase significantly with the population size (figure 4*d*).

The simple model we discuss here is important because it respects most requirements featuring the human adaptive immune system and other complex intrusion detection tasks:

the number of self cells and its diversity can be arbitrarily large,

the definition of self can differ from system to system and the number of different definitions is arbitrarily large: this is the main difference between adaptive and innate immunity,

a specific and prompt attack can be directed against any pathogen,

absolute tolerance is maintained in the absence of pathogens,

the system can respond against an abnormal growth of self cells,

the system can maintain tolerance towards a very specific set of cells that were absent from the system at the beginning: these cells must be compatible with the system's IList, and

the numerical simulations suggest that this artificial immune system model works perfectly for large

*N*.

In §5 we introduce another model, more adequate to describe the human adaptive immune system.

## 5. A minimal model for the adaptive immune system

In the adaptive immune system, self/non-self discrimination takes a crucial step in the lymph nodes. There, APCs present on their surface peptides arising from captured materials. In particular, these peptides can be pathogen derived. Depending on these peptides and after a complex dynamical process with multiple interactions, it is determined whether T-cells are activated or not. If T-cells are activated, they migrate to the zone of infection and eliminate, or help to eliminate, the pathogen. In this paper, we will not be concerned with how APCs select which materials they present. Rather, we concentrate on how this information is used to activate specifically cells from the adaptive immune system.

It is clear from this simple view of the adaptive immune system that infected cells change their position on the other cells' ILists but do not change their own ILists, contrary to what happened in the previous model. The organization of the system's ILists on a circle is also not applicable, as there are well-defined cell types (APCs and T-cells) and diversity within each cell type. However, the same principles that enabled pathogenic detection should still be applicable: in the absence of pathogens, the system's ILists should be maximally frustrated so that invading cells can be detected after forming more stable conjugates.

Here, we consider a simple system formed by APCs with only two types of self ligands. It is assumed that the self ligands' information content can be mapped onto a two-dimensional space with periodic boundary conditions. Two coordinates *x*_{i} and *y*_{i} ranging from 0 to 1 are used to represent self ligands' information, in what we call the APC ligands' space. For simplicity, we assume that both APC populations, *i*=1,2, have the same number of cells and that their APC ligands' information content have coordinates related by |*x*_{1}−*x*_{2}|=1/2, *y*_{1}=*y*_{2}.

In order to achieve cellular frustration, at least three cell types are necessary. We assume that APCs, T-cells and regulatory T-cells (Tregs) engage in a frustrated dynamics (figure 5*a*). This represents a first level of organization of cellular interactions, and should be germ-line encoded. Meaningful results from an immunological point of view were obtained when APCs have higher avidity towards T-cells than towards Tregs; T-cells have higher avidity towards regulatory T-cells than towards APCs; Treg cells have higher avidity towards APCs than towards T-cells. Any cell has lowest avidity towards cells of its own cell type and all cells prefer to be conjugated than to be alone. All cells are potentially reactive with any other, although effector functions may vary with the cell types involved in a conjugation.

According to the principle of maximal frustration, optimal detection is achieved with a maximally frustrated population. For this reason, we assume that thymic education produces a second level of organization that maximizes frustration on cellular interactions. For the purpose of this paper, only those T-cell and Treg subpopulations that maximize frustration were considered. Since there are two types of self APCs, we assumed that two subpopulations of T-cell and Treg emerged from negative selection during thymic education. Each of these populations has different ligands. One T-cell population consists of those T-cells that are on the top of the IList of one type of self APCs. However, in order to maximize frustration, they have stronger avidity towards the other self APC type. In our model, avidity between T-cell receptors and APC ligands can be measured as a distance in the APC ligands' space, smaller distances corresponding to stronger avidities. We took the simplest assumption, which was that T-cells had stronger avidity towards randomly drawn positions in the APC ligands' subspace closer to the self APC type that did not have this T-cell population on the top of its IList. A similar procedure was considered for the interactions of Tregs and APCs, and Tregs and T-cells. Hence, all cells in the system respect the IList presented in figure 5*b*.

Since identical cells can exist in this model, degenerate interactions occur when a conjugated cell interacts with two identical cells. In this case, we introduced a switching probability *p*_{deg} for this cell to switch conjugate. There is no *a priori* physiological reason to suppose that *p*_{deg} should be small or large. Large values of *p*_{deg} will favour non-self detection, while small values help homeostatic responses. Hence, a compromise seems to exist from an immunological functional point of view.

An important assumption in this paper is that it assumes that T-cell activation is adaptive. According to our theory, during activation, T-cells are ‘instructed’ to eliminate (or help to eliminate) all cells towards which they sense an avidity at least as strong as the avidity sensed during activation. This adaptive activation feature is essential because cellular frustration does not assume any cross-reactivity range: all cells can potentially interact with any other. However, outside the lymph nodes, the cross-reactivity range should be limited to avoid autoimmunity. Usually, it is assumed that activation is non-adaptive. The region of ligands' space that each activated T-cell surveys is fixed and established during T-cell education (Perelson & Weisbuch 1997; Chao *et al.* 2004; Scherer *et al.* 2004). This fundamental difference between the two types of theories could be experimentally tested.

### 5.1 Building tolerance: cellular frustrated systems are intrinsically unstable

The cellular frustration framework requires that a number of conditions are verified. The first concerns achieving perfect tolerance with very reactive cells. Is there a general class of these systems for which the dynamics of cellular interactions creates steady states without long-lived conjugates? The example in figure 6*a* shows that the existence of a stable solution depends on the parity of the number of cells in the population: if the number of cells is even, then a stable configuration exists. In a stable configuration, no two cells can change pair. The fundamental difference between populations in figures 1 and 6*a* is that, in the first case, there is always a non-conjugated cell in the population. As all cells have on the top of their IList a cell that has on the bottom of its IList the other cell, then any pair is unstable relative to a non-conjugated cell in the population. However, for a system with an even number of cells, all cells that could destabilize conjugates are conjugated cells that do not gain by switching partners.

Frustrated systems are nevertheless intrinsically unstable if a small dissociation rate is introduced. This happens regardless of the number of cells in the population and is a general property of cellular frustrated systems (see appendix A). Consider a system with three cell types (A, B, and C), *N* cells per cell type (figure 3) and *p*_{deg}=0. Following the dynamics in §2, on each time step, each cell selects randomly one other cell in the population with which it interacts and, on each time step, each conjugate has a small probability *p*_{dis} to dissociate. Although small, this dissociation rate can have a big impact on the whole population because each non-conjugated cell can potentially destabilize a macroscopic number of conjugates (figure 6*b*). Hence, it is more likely that these two cells destabilize other conjugates than that they meet again and form a conjugate. In the meanwhile, other conjugates may dissociate creating more non-conjugated cells. In figure 6*c*, we can see that the number of non-conjugated cells in a population increases quickly with the dissociation rate, as . The increase in the number of non-conjugated cells also makes conjugations less stable. Conjugation rates involving A and B cells decrease as , where is the dissociation rate. Hence, for small *p*_{dis}, conjugation rates can be orders of magnitude larger than the dissociation rate. If *p*_{dis}=10^{−4}, then . Hence, even if stable configurations could exist, cellular frustrated systems stay in steady states, since small dissociation rates destabilize them. This is a general consequence of the cellular decision dynamics, and results from the fact that any conjugate in the population can be destabilized by any other non-conjugated cell in the population.

### 5.2 Numerical results

In §5.2.1 and 5.2.2 we consider how maximal frustration allows specific reaction against any pathogenic cell bearing non-self ligands and how the outgrowth of a self cell subpopulation can also be detected. The summary of results with the several types of cell populations is presented in table 1.

#### 5.2.1 Responses against non-self APCs

When an APC presents non-self ligands (for instance, foreign peptides), then this cell occupies a different position in the APC ligands' space and we call it a pathogenic APC. These cells have a major impact on several ILists. A macroscopic number of T-cells and Tregs, whose avidity was higher towards one self APC, will now have higher avidity towards the pathogenic APC. Each T-cell and Treg population is now divided into further subpopulations, depending on their avidity towards the pathogenic APC. Conjugates formed by the pathogenic APC and a T-cell with higher avidity towards it now become more stable, as these T-cells face a considerably smaller number of degenerate encounters with other APCs. This happens as the pathogenic APC lifts (partially) the degeneracy in ILists. In appendix A it is shown analytically why non-self detection can always be achieved in systems with a single self APC type. Next, we discuss the numerical simulations that show that this result holds also for systems with two different self APCs (figure 7).

The number of T-cells having higher avidity towards the pathogenic APC varies with the position the pathogenic APC occupies in the ligands' space. An example is represented in figure 7*a*. T-cells that had higher avidity towards APC number 1 (cell A1) can now be subdivided into two classes, depending on whether they have higher avidity towards the pathogenic APC or towards cell A1. A similar situation occurs for T-cells that had higher avidity towards cell A2. This has the important implication that a macroscopic number of cells have higher avidity towards the pathogenic APC than towards any other APC (figure 7*b*).

We performed numerical simulations for systems with 240 cells (80 cells of each cell type, APCs, T-cells and Tregs) and one non-self APC. The number of cells in each subpopulation depends on the position this non-self APC occupies in the APC ligands' space. With 240 cells, only 26 different systems had to be considered (i.e. systems with a different number of cells in each subpopulation). For each system, we performed 20 simulations for 5×10^{5} iterations.

In figure 7*d*,*f*, typical cumulative distributions for conjugation lifetimes are presented, for APC–T-cell conjugates and for populations with *N*=501. Figure 7*f* shows that, when *p*_{deg}=0.5, a detection threshold could be chosen (e.g. *τ*_{thr}>25) for which only non-self APCs activate T-cells. This corresponds to the type of surgical detection already discussed in the previous model. If *p*_{deg}=0.1, surgical detections could not be performed, because during 5×10^{5} iterations several false positives (i.e. T-cell activations induced by self APCs) could take place. However, pathogen discrimination is still effective, since the pathogenic APC establishes a long-lived conjugate with a probability that is at least an order of magnitude larger than that of self APCs (figure 7*e*). This result suggests that the immune system could use the strategy of decreasing *τ*_{thr} to build prompter and stronger responses, at the cost of slightly increasing autoimmunity. This result applies to any non-self APC (figure 7*c*).

#### 5.2.2 Responses against self APCs

Increasing the number of self APCs can lower the level of frustration, specially for small values of *p*_{deg}. Longer lived conjugations should then emerge, triggering negative feedback reactions to restore homeostasis. Homeostatic responses are nevertheless more complex than responses against pathogenic APCs. As we show analytically in appendix A for a system with only one type of self APC, when the number of self APCs grows, APCs form long-lived conjugates with both T-cells and regulatory T-cells. These responses are considerably less sensitive than responses against non-self APCs, as a non-negligible impact on ILists and conjugation lifetimes requires macroscopic changes in cell numbers. This is actually quite suitable: if homeostatic responses were too vigorous, the body could unnecessarily harm itself in response to natural physiological fluctuations.

In figure 8, we compare averaged cumulative distributions for the most stable conjugates involving several different cell types. Cumulative distributions represented by asterisks and lines were obtained by averaging results from 10 simulations, respectively, for perturbed and non-perturbed populations. Homeostatic perturbations were introduced without changing the total number of cells (*N*=240), so that a variation in the total cell number did not need to be accounted for in the results (table 1). We considered *p*_{deg}=0.1.

These results show that homeostatic perturbations can lead to a rich pattern of immune reactions. The growth of a self APC subpopulation creates long-lived interactions involving these cells and T-cells having *higher* avidity towards them (figure 8*a*), as well as with regulatory T-cells having the *lowest* avidity towards them (figure 8*b*) and with other self APCs (figure 8*d*). Interestingly, the other self APC subpopulation also establishes long-lived interactions with T-cells having higher avidity towards them (figure 8*a*). This bystander effect arises because these T-cells suffer from a lower competition for these APCs.

These results clearly show that homeostatic responses exist, although they require a larger cell number perturbation. Several effector functions could be triggered to provide homeostatic feedback. Since long-lived interactions involving APCs from the non-growing population activate T-cells (figure 8*a*), potential autoimmunity could emerge. However, activation of regulatory T-cells (figure 8*b*) may control autoimmunity. Since the activated regulatory T-cells have higher avidity towards the same type of APCs as the activated T-cells, both cell types could share similar receptors. A simple way to maintain homeostasis could take place if regulatory T-cells could secrete cytokines that would increase the activation (lifetime) threshold for the same subtype of T-cells. This possibility is plausible since regulatory T-cells may originate from T-cells, which are believed to be able to secrete ‘fratricide cytokines’. We leave for a forthcoming paper a more complete discussion on the type of effector functions that can be triggered to restore homeostasis. Finally, we should mention that homeostatic responses are stronger if *p*_{deg} is smaller, as an increase in the cell population increases the number of degenerate decisions. A compromise thus seems to exist in the immune system since increasing or decreasing *p*_{deg} produces more efficient activation of non-self or self APCs, respectively.

## 6. Final discussion and conclusions

Certainly, one of the most difficult intrusion detection tasks consists in detecting an intruder that mimics the self. This task is even more difficult if the self comprises many diverse agents. The challenging question is to know how the self should be defined to optimize the chances of successful invasion detection. Optimal solutions should allow highly specific and rapid detection. Furthermore, a diverse range of solutions should exist to avoid invader adaptations. In this sense, the solution should be adaptive.

In this paper, we have explored a new route to solve this problem. We assumed that the way cellular interactions are modelled could be crucial. If all cells perform decisions before they trigger effector functions, then all self cells, although very reactive, could block each others' reactivity building a tolerant state in the absence of intruders. By contrast, the introduction of a new cell with no prior knowledge of the system's self definition could trigger effector functions towards the new cell with a probability of almost 1 for sufficiently large populations.

The important idea behind this detection mechanism is that all self cells should live in a maximally frustrated state. In circular frustrated systems, as an exponentially large number of these states exists, it is impossible for an intruder to ‘guess’ what a particular self definition is. Consequently, intruders engage in less frustrated dynamics and form more stable conjugates. These signal the intruder's detection with surgical precision. For systems comprising 10^{3} self cells, only 0.03 per cent of invaders escaped detection.

Another important outcome is that an abnormal growth of self cell populations can be counteracted because it also decreases cellular frustration. In this approach, self and non-self are emerging dynamical properties and not single cell attributes.

These ideas were also used to model T-cell activation in the lymph nodes. We developed the simplest non-trivial models. Simple analytical results were obtained for systems with only one self APC. However, in this case, another trivial detection scheme could be defined: if T-cells would be activated by all APCs except those bearing the self APC specificity, then the problem would be trivially solved. Thus, we also considered systems with two different self APCs, for which previous trivial solutions could not work. In this case, our extensive numerical results were conclusive: self/non-self discrimination was always possible. Responses against homeostatic perturbations were nevertheless significantly less sensitive. In this case, two types of responses could be triggered on T-cells and regulatory T-cells. From an immunological point of view, this can be important for several reasons. First, because it shows that immunological responses against self cells can be important to maintain homeostasis. In this sense, responses against cancer could be expected. This could also be important for the resolution of infection.

This paper focused on detection mechanisms. Other side mechanisms are also important to put these principles at work. Thymic education certainly plays a role building maximally frustrated populations. However, it is not clear for us at the moment whether only one mechanism exists to achieve this goal. Also important is the definition of effector functions. Cell activation, induced apoptosis, anergy and induced proliferation are all possible outcomes of the directed responses we described. However, the main point is that effector functions can be directed towards the invading cells and hence can build negative feedback loops and maintain homeostasis.

Much remains to be studied in the context of how cellular frustrated systems can help to understand adaptive immune responses. A maximally frustrated cellular system displays many features that agree with our current immunological data. There is extensive cross-reactivity. Cellular reactions are time demanding. Target selection depends on the integration of multiple signals received before cellular reactions are triggered. The implications of how cells trigger their effector functions on a system's level seem nevertheless largely overlooked. In particular, we claim that understanding how tolerance is maintained or not can be an emergent property resulting from the cellular decision dynamics of the whole system. We believe that this paper showed convincing arguments that a principle of maximal cellular frustration may be useful to provide an alternative view of how adaptive immune systems can work. We have proven that simple (artificial) adaptive immune systems can be designed that use the maximal frustration principle to perform complete invasion detection. However, whether the real immune system uses this principle remains to be proven.

It would be interesting to generalize the present model to more complex settings, and compare with other models in the literature, such as models of frustration in idiotypic networks (Bersini & Calenbuhr 1995; Calenbuhr *et al.* 1995), other models of cross-regulation (Carneiro *et al.* 2007), models of tunable activation thresholds (Grossman & Paul 1992; van den Berg & Rand 2004) or other models of artificial immune intelligence (Forrest & Beauchemin 2007; Timmis *et al.* 2008).

## Acknowledgements

F.V.A. is grateful for important discussions with A. Zuquete, A. Goltsev, M. Nolte and E. Hoen and encouragement and suggestions from D. M. Davis and B. Askonas. P.M. acknowledges financial support from FCT Portugal (SFRH/BD/37625/2007).

## Footnotes

- Received July 3, 2008.
- Accepted July 31, 2008.

- © 2008 The Royal Society