def linear_assignment(X):
 indices = _hungarian(X).tolist()
 indices.sort()
 indices = np.array(indices, dtype=int)
 indices.shape = ((-1), 2)
 return indices

def linear_assignment ( X ) : indices = _hungarian ( X ) . tolist ( ) indices . sort ( ) indices = np . array ( indices , dtype = int ) indices . shape = ( ( - 1 ) , 2 ) return indices
solve the linear assignment problem using the hungarian algorithm .