UPGMA and Neighbor Joining (NJ) are greedy algorithms that will reconstruct the correct tree in polynomial time when D[i,j], the matrix of observed inter-taxon distances, is ultrametric or additive, respectively.
How should you reconstruct a tree when D[i,j] is not additive? NJ can be used as a greedy heuristic. It is not guaranteed to give the correct tree, but if D[i,j] does not deviate too far from additive it may give a tree which is a good hypothesis for the evolutionary events that occurred.
Alternatively, one may use distance-based exhaustive search. The basic approach is as follows
The following questions remain:
We select branch lengths that minimize the error in fitting the tree metric, T[i,j], to D[i,j]. There are a number of ways to measure this error. Many take the following approach:
E = | k k |
∑ ∑ (D[i,j] - T[i,j])a | (1) |
i=l j=i+l |
This model can be refined by choosing different values of a.
To actually compute the branch lengths requires considerable computational effort. We need to find edge lengths e1, e2, ... such that Equation (1) is minimized given the following constraints
There are also several approaches to scoring the tree, t. One approach is to score the tree according to its error, as given in Equation 1. In this case, the minimum error is sought.
Another frequently used approach is Minimum Evolution. In this method, the branch lengths are fitted using ordinary least squares (a=2). The tree is scored by the length of the tree; that is, by summing the lengths of all branches in the tree.
Rzhetsky and Nei (1993) claim that minimum evolution performs well on simulated trees and that under certain conditions the true tree minimizes the tree length score. However, Gascuel, 2000 reported that minimum evolution did not work much better than NJ in his simulation studies.
Taxa are points in a metric space with pairwise distances, D[i,j]. Tree building is equivalent to hierachical clustering of these points.
Both of these greedy algorithms maintain a forest of subtrees, beginning with the set of singleton trees (i.e., trees with one leaf and no edges). At each iteration, the algorithm merges two neighboring subtrees in the forest. This step is repeated until only one tree remains - the final result.
The algorithms differ in
The UPGMA algorithm is a variant of average linkage. UPGMA is based on the molecular clock assumption. The consequences of this assumption are that
However, if the assumption is violated (i.e., if D is a not ultrametric), then
The NJ algorithm deals with this problem by correcting for variations in the rate of change. The "corrected" distance between a pair of nodes is calculated by subtracting the average of the distances to all other leaves.
If O is additive, then NJ will reconstruct the correct unrooted tree in quadratic time.
If D is a ultrametric, then the root can be determined directly from the data as a consequence of the molecular clock hypothesis. The root is located at the midpoint of the longest pathway between two taxa. UPGMA does this automatically.
If D is not ultrametric, then additional information is needed. To root a tree one should add an outgroup to the data set. An outgroup is an taxon for which external information (eg. paleontological information, morphology, ...) is available that indicates that the outgroup branched off before all other taxa. For example, bear could be used as an outgroup in a canine phylogeny.
The outgroup should not be too closely related to the taxa in question. Nor should the outgroup be very distantly related to the taxa. The use of more than one outgroup generally improves the estimate of tree topology.