A synthetic 80-nucleotide genome (A/C/G/T) starts from one ancestor. Each generation every circulating lineage mutates independently — every site flips to a different random base with probability equal to the mutation-rate slider — and, with the branch-probability slider's chance, a lineage transmits, spawning a genetically identical copy that then mutates on its own path. At intervals across the tracked generations a lineage is "swabbed" and its genome recorded as a sample, exactly like real genomic surveillance.
Once sampling ends, every pair of sampled genomes is compared nucleotide-by-nucleotide to get a real Hamming distance (fraction of sites that differ) — this is the same genetic-distance idea real phylogenetics pipelines use as a fast proxy before full substitution models:
d(i,j) = (# sites where genome_i ≠ genome_j) / genome length
The distance matrix then drives a real UPGMA (average-linkage hierarchical clustering) build: repeatedly merge whichever two active clusters are closest, place the new node at height d/2, and recompute distances to everything else as the size-weighted average of the merged clusters' distances — until one root remains. The result is the dendrogram on the right: leaf order and branch heights are a direct, reproducible readout of the distance matrix, not decoration.
- Left pane — the genome alignment: one colored strip per sample, red-outlined cells mark sites that differ from the ancestor.
- Right pane — the UPGMA dendrogram; branch length (x-axis) is genetic distance, not time.
- Raise the mutation rate or generation count and the tree height and mean pairwise distance both grow — that's the same signal epidemiologists use to estimate how long an outbreak has been diverging.