assign_branches: Detect branches in the trajectory and assign cells to branches
Description
This function uses geodesic entropy to automatically determine
the number and location of branches in the trajectory.
Each cell is then assigned to the corresponding branch.