The second component is an algorithm to solve an assignment problem to determine an optimal mapping between the ghost particles and target ligand atoms. In our implementation, we employ the Hungarian algorithm to find an assignment with a minimum cost between the ghost particles and target ligand atoms. The cost matrix is determined by calculating the Euclidean norm hungarian-algorithm-cpp.git. The output of this algorithm is a mapping M that minimizes the cost. The cost, which we refer to as the "loss function" is defined as: