Hi community,
I’m looking for an efficient way to split a tree into its biggest (or one may call them first) branches. In the example below I have a tree whose biggest branches would be {0;0;x} and {0;1;y} where the indices x and y can run independently of each other from 0 to any other positive integer.

The two trees I’m looking for after having split the big tree would be these two below:

Thank you,
Juan
