The Hungarian algorithm solves the assignment problem in polynomial time. Given workers and tasks, and an n×n matrix containing the cost of assigning each worker to a task, it
As David said in the comment:
Multiply the cost matrix by -1 for maximization.