The action with the highest UCB score is selected for the roll-out. In case of multiple actions sharing the largest score, random selection is performed. The child state is instantiated and added to the search tree by employing the associated reaction template to the molecule specified in the action using RDKit. In case the reaction did not give any output, the action Q is given a value of -10 6 , effectively preventing reselection. If no actions are available, the state is marked terminal and the state evaluated with the reward function (see below).