def linear_assignment(X):
    indices = _hungarian(X).tolist()
    indices.sort()
    # Re-force dtype to ints in case of empty list
    indices = np.array(indices, dtype=int)
    # Make sure the array is 2D with 2 columns.
    # This is needed when dealing with an empty list
    indices.shape = (-1, 2)
    return indices
Solve the linear assignment problem using the Hungarian algorithm.
dataset/ETHPy150Open scikit-learn/scikit-learn/sklearn/utils/linear_assignment_.py/linear_assignment