single iteration of the MCTS building process consists of four steps: 1) selection: a node to be expanded is selected; 2) expansion: the node is expanded by simulating the associated action; 3) simulation: the tracing is simulated following a random path until the terminal amino acid is reached; 4) back propagation: the result propagates back through the tree.

### Building KNN-Graph

Directly performing the MCTS algorithm to all the proposals may be time consuming, so we first built a graph based on $K$ nearest neighbors, where each node denotes a proposal and an edge connects two nodes if they are among the $K$ nearest neighbors, thus called KNN graph. Next, we determined the root node of the tree by finding $L$ proposals in $B$ which match the first $L$ amino acids in the sequence. Finally, we obtained several candidate fragments as the starting points. For each starting point, we ran the MCTS algorithm to obtain the optimal path. The optimal path was obtained by a control policy $\pi$ to maximize the total reward $R$, which is the sum of all the values $V_t$ in every following step $t$. The reward function $R$ thus is written as:

$$\begin{aligned}
\begin{split}
    R &= 