Paths exploring algorithm for the new tree structure.