How it Works
Bacteria and phage are each split into several discrete genotype classes arranged on a ring. In this matching-alleles model, a phage of genotype g is only fully able to infect a bacterium of the same genotype g; the matching stringency slider softens that lock-and-key rule into a Gaussian kernel over genotype distance, so a phage can also partially infect bacteria a step or two away on the ring when stringency is low. Each genotype of bacteria grows logistically toward a shared carrying capacity and is killed off in proportion to how much matching phage pressure it experiences, while each genotype of phage grows by successfully infecting matching bacteria and otherwise decays.
Because a phage genotype that becomes very effective quickly drives its matching bacterial genotype down, and a bacterial genotype that becomes rare stops feeding its phage, every genotype eventually rises and falls in turn — the classic Red Queen pattern where being common is itself a disadvantage. A small mutation rate lets a fraction of each generation's offspring drift into a neighbouring genotype class, which is essential: without it any genotype driven to zero simply disappears forever and the whole ring collapses instead of cycling indefinitely.
dB[g]/dt = r·B[g]·(1 − ΣB/K) − infectionRate·B[g]·Σ_p P[p]·kernel(|g-p|)
dP[g]/dt = burst·P[g]·Σ_b B[b]·kernel(|g-b|) − decay·P[g]
mutation: X[g] += mutRate·(X[g-1] + X[g+1] − 2X[g]), X ∈ {B, P}
Frequently Asked Questions
What is the Red Queen hypothesis?
The Red Queen hypothesis, named after the character in Through the Looking-Glass who must keep running just to stay in place, describes how hosts and parasites are locked in perpetual coevolution: as bacteria evolve resistance to the currently common phage genotype, phage that can infect a different, previously rare bacterial genotype gain the advantage, so neither side ever settles into a fixed winning strategy.
What is matching-allele resistance?
In a matching-allele model, a phage can only successfully infect a bacterium if their genotypes correspond to the same allele class, much like a key fitting only one lock. A bacterium is resistant to every phage genotype except the one that matches its own, which is what drives the frequency-dependent selection behind Red Queen cycling.
What does the infection matching stringency slider do?
Stringency controls how narrowly a phage genotype's infectivity is confined to its exactly matching bacterial genotype. At high stringency only bacteria of the identical genotype can be infected; lowering it widens the kernel so phage can also partially infect bacteria of neighbouring genotype classes, softening the strict lock-and-key matching.
Why is mutation necessary for the cycles to continue?
Without mutation, whichever bacterial genotype is currently rare simply grows unopposed until it dominates, and the matching phage genotype eventually drives its target to extinction with nothing to replace it, collapsing the cycle. A small mutation rate continuously reseeds neighbouring genotype classes, keeping every allele class populated so new cycles of resistance and counter-resistance can keep starting.
What does the 'dominant genotype' indicator show?
The dominant genotype indicator highlights whichever allele class currently has the largest population, separately for bacteria and for phage. Watching the highlighted class cycle around the genotype ring over time is a direct visual signature of Red Queen dynamics: the phage indicator chases the bacteria indicator around the ring rather than either one staying fixed.