Given a series of daily tasks, each with a known deadline, for example:
- 1. Study for math exam - 19th of January
- 2. Study for language exam - 21th of January
- 3. Practice piano for event - 15th of March
- 4. Train for soccer match - 3rd of May
what would be the best algorithm for allocating daily work time to each task, so that the closer a deadline for a certain task is, the more time will be allocated for that particular task? The total amount of daily work is subjective, let's suppose this particular person spends 12 hours in total every day on their tasks.
For example, if you had two tasks and the deadline for the first one was tomorrow, the deadline for the second one was two days from now (double the amount of time left when compared to first task), it would mean you'd have to spend 75% of your today's working time on the first task and 25% on the second task (or, for the case of our particular person who works 12 hours each day: 9 hours on first task and 3 hours on the second task). If both tasks had the same deadline, the working time would be evenly split amongst them (50% both).
Other mention is that this algorithm would only run once per day (so every new day, the calculations are performed again based on the (new) amount of tasks and the updated time left until each of them's deadline (so in the example presented in the previous paragraph, it would mean that tomorrow, when the calculations are made again, only the 2nd task exists anymore and this task will be allocated 100% of the working time).
- 1. Study for math exam - 19th of January
- 2. Study for language exam - 21th of January
- 3. Practice piano for event - 15th of March
- 4. Train for soccer match - 3rd of May
what would be the best algorithm for allocating daily work time to each task, so that the closer a deadline for a certain task is, the more time will be allocated for that particular task? The total amount of daily work is subjective, let's suppose this particular person spends 12 hours in total every day on their tasks.
For example, if you had two tasks and the deadline for the first one was tomorrow, the deadline for the second one was two days from now (double the amount of time left when compared to first task), it would mean you'd have to spend 75% of your today's working time on the first task and 25% on the second task (or, for the case of our particular person who works 12 hours each day: 9 hours on first task and 3 hours on the second task). If both tasks had the same deadline, the working time would be evenly split amongst them (50% both).
Other mention is that this algorithm would only run once per day (so every new day, the calculations are performed again based on the (new) amount of tasks and the updated time left until each of them's deadline (so in the example presented in the previous paragraph, it would mean that tomorrow, when the calculations are made again, only the 2nd task exists anymore and this task will be allocated 100% of the working time).