Distance matrix comparison and tree construction