Quick-and-dirty schedule optimization. An example: I have 7 different songs I can practice. I have 30 minutes total practice time. And I can break that into 5 minute windows. So I could practice one song for 30 minutes, or 6 different songs for 5 each, or one for 25 minutes and one for 5 minutes,etc. Separately I have a utility function and will be able to calculate the optimum configuration.
I need to generate all the various practice allocations. I did something like this before, the "algorithm" was revolting -- I generated all the possible combinations of [0,5,10,15,20,25,30]^7 and then threw away all those rows which didn't sum to 30.
Gross, stupid method, I know. I've been trying to identify what this problem is mathematically, then I should be able to find an efficient algorithm to solve it in Python. Alas, I cannot describe this to google well enough to find it.
Can anyone advise this problem class or appropriate algorithm to solve?
================
I did a lousy job describing the problem. Let me try again:
I have a single 30 minute window to practice my music. I have seven different songs that I could practice during that 30 minute window. For each of the seven songs, I can practice between 0, 5, 10, .., 25, 30 minutes, but total combined practice time of all songs must be 30 minutes. I have some utility function that scores the different possible practice schedules.