Given that the recursion depth may not be known, you can stop at a reasonable limit, for example, in 10 moves and / or ignore trees with a lower utility value. By adding additional constraints such as these, you can also ensure that a solution is found quickly, without the need to optimize intensively.
, , , , . , , , , A* , , ,
, , .
.