sentences:  minimizing the following quantity
  where formula_10 are the entries of the inverse of the covariance matrix of the distance estimates.Finding the tree and branch lengths minimizing the least squares residual is an NP-complete problem.However, for a given tree, the optimal branch lengths can be determined in formula_11 time for ordinary least squares, formula_12 time for weighted least squares, and formula_13 time for generalised least squares (given the inverse of the covariance matrix).