count_to_tree function

Calculate tree based on count matrix