Generalize MCTS algorithm