Let X be a finite set and let d be a function from X X X into an arbitrary
group G. An example of such a function arises by taking a tree T whose vert
ices include X, assigning two elements of G to each edge of T (one for each
orientation of the edge), and setting d(i, j) equal to the product of the
elements along the directed path from i to j. We characterize conditions wh
en an arbitrary function d can be represented in this way, and show how suc
h a representation may be explicitly constructed. We also describe the exte
nt to which the underlying tree and the edge weightings are unique in such
a representation. These results generalize a recent theorem involving undir
ected edge assignments by an Abelian group. The non-Abelian bi-directed cas
e is of particular relevance to phylogeny reconstruction in molecular biolo
gy. (C) 1999 Academic Press.