  The formation of deuterons in heavy-ion collisions at relativistic energies
is investigated by employing two recently advanced models -- the Minimum
Spanning Tree (MST) method and the coalescence model by embedding them in the
PHQMD and the UrQMD transport approaches. While the coalescence mechanism
combines nucleons into deuterons at the kinetic freeze-out hypersurface, the
MST identifies the clusters during the different stages of time evolution. We
find that both clustering procedures give very similar results for the deuteron
observables in the UrQMD as well as in the PHQMD environment. Moreover, the
results agree well with the experimental data on deuteron production in Pb+Pb
collisions at $\sqrt{s_{NN}} = 8.8$ GeV (selected for the comparison of the
methods and models in this study). A detailed investigation shows that the
coordinate space distribution of the produced deuterons differs from that of
the free nucleons and other hadrons. Thus, deuterons are not destroyed by
additional rescattering.
