cut_tree function

Cut a hierarchical tree