Thank you for coding up the algorithm! I noticed it is slow compared to alternative function clue::solve_LSAP for larger instance.
set.seed(42)
n = 3000
cost_mx = matrix(sample(1:1000, n*n, replace = TRUE), nrow = n)
system.time({
sol_rcpp = RcppHungarian::HungarianSolver(costMatrix = cost_mx)
})
system.time({
sol_clue = clue::solve_LSAP(x = cost_mx, maximum = FALSE)
})