But after this iteration, the paths will be:
A B 1
B C 1
C B 1
A C 2
A B 3
in next iteration, the recursive statement will generate (A,C,2), (A,B,3), and (A,C,4), after the group by, it will still be (A,C,2) and (A,B,3)
so I think it should stop after this iteration.