PathLengths function

Calculate length of paths between each pair of vertices within tree