Neighbour joining (NJ, paper) is a phylogeny reconstruction method. Then it finds the pair of vertices that when merged and split out gives the minimal total edge length \(S_{ij}\) of the new almost-star graph. The distance from the merging of vertices \(i\) and \(j\) to each other vertex \(k\) is \(d_{(i-j)k} = (d_{i,k} + d_{j,k})/2\).