Neighbour joining is a method that infers relationships between witnesses (or organisms if using biological sequence data) by sequentially grouping those that show fewest differences. The illustration below shows this process in an example. It uses a distance matrix as input. Neighbour joining is implemented in software packages like PHYLIP or PAUP*. The method was developed by Saitou and Nei in 1987.
Fig. 1: A fictitious example how neighbour joining works (by Wikipedia user Tomfy).
– Saitou, Naruya and Masatoshi Nei. 1987. "The neighbor-joining method: a new method for reconstructing phylogenetic trees." In Molecular Biology and Evolution, vol. 4, issue 4, pp. 406-425, July 1987.