Problem:
Given a set of recurring tasks, and knowing how long each take will take and how often they must recur, create a schedule that most evenly spreads out the time to do the tasks.
For example, I have to "run antivirus", "defragment hard drive", and "update computer" every 2 days, I have to "update hardware", "clean internals" every 3 days, and I have to "replace hard drive", "replace graphics card", "replace cpu" every 5 days. Each chore takes a certain amount of time, in minutes.
Given this information, what days in the month should I do each chore?
Attempts:
I have "solved" this problem twice, but each solution will take over 1 million years to compute.
First algorithm I used generated all possible "days", ie, every combination of tasks that could be run. Then, for every possible combination of days in a month, I checked the month to see if it fit the constraints (tasks run every x days, day is evenly spread). This is the most naive approach and would have taken python longer than the age of the universe to check.
The algorithm I'm currently running would also work. It generated every possible "day plan" across the month for each task, ie, I could run a every-5-day task starting on the 1st, 2nd, 3rd, 4th or 5th. Then, for every combination of every day plan, I add up the day plans to form a month plan. I then sum up the times of each task in every day of that month to see how it fares. This algorithm must run through 1e14 combinations, which might be possible if written in a compiled languages and executed in parallel across a huge cluster for a few days...
Summary
I would like to know if there's a better way to do this. To summarize, I have some tasks, that must recur every x days, and want to spread them across a given month so that each day is filled with the same amount of time on these tasks.
Thank you.