Draw a 7x7 grid; the columns represent the workers, the rows represent the jobs.
The individual cells c_ij represent the cost when job i is done by worker j.
You have to mark one cell per column and per row such that the sum of the marked
c_ij is minimal.
Let a_ij in [0, 1] be an integer variable such that a_ij == 1 when job j is performed
by worker j, and 0 otherwise. So you have to minimize the following formula:
sum(i, j in [1, 7] | a_ij*c_ij). w.r.t. the constraints:
sum(i in [1, 7] | a_ij == 7) and
sum(j in [1, 7] | a_ij == 7).
This indeed is the classical "job assignment problem" which happens to be the
smallest class of problems in the MNCF ("Minimal Cost Network Flow") problems
and can be easily solved with a network simplex algorithm.
Solving it recursively is ludirous because it can be highly inefficient. The brutest
force method of them all is to iterate over the 7! possibilities and pick the cheapest.
kind regards,
Jos