Hello,

I'm trying to figure out how to create a program that will solve the assignment problem. The idea I have is to create a 2D array, with each element holding a cost. Only certain costs would be added up and stored in variables. To calculate the sum of the costs I need to come up with a way to generate all the combinations.

I don't know how to explain it very well, so I made tables to show what I mean.

For example, a 3x3 matrix will produce 6 possible combinations, here are 2 of the combinations:

Code:

` `

0 1 2

0 X

1 X

2 X

cost1 = Matrix[0][0] + Matrix[1][1] + Matrix[2][2]

Code:

` `

0 1 2

0 X

1 X

2 X

cost2 = Matrix[0][0] + Matrix[1][2] + Matrix[2][1]

(Sorry for the code fragments, couldn't think of anything else.)

Would appreciate any help, thx!