algorithms for branching 2737906