The fragment-wise search (Fig. ) is the core process of the method. Optimization is performed by editing the molecular graph fragment by fragment, given an arbitrary molecule and an evaluation function as input. The state of each node in the search tree corresponds to a molecule with a state value and a number of visits. The action in tree search is to remove and add fragments. The tree search with the starting molecule as the root searches with the following process as one cycle. The molecule corresponding to the newly added node is treated as the optimized molecule.