If the (i, j) th element represent the cost of assigning i th task to j th agent, then by replicating each column of the matrix k tines where k is the capacity of an agent, the problem reduces to simple one to one assignment problem.