Simple Algorithm for Recurring Tasks


I previously mentioned the little tool for Mac OS X called Consistency from Sciral which is for managing flexibly recurring tasks.

The approach is very simple. For every task, you specify a minimum time and a maximum time between occurrences. The Sciral Consistency UI gives you a table with a row for each task and a column for each day and you simply mark when you've done the task for that day.

The squares are colour-coded as follows:

This works surprisingly well. However, I wanted a system with a couple of additions. Firstly, I wanted to prioritise tasks based on this approach with ordering within tasks of the same colour. Secondly, I wanted something that would handle tasks that can be done multiple times during a day (like reading blogs or email).

For prioritisation, the following seems to do the job:

score = max(0, (1 + interval_since_last - minimum) / (1 + maximum - minimum))

This maps to the colours as follows:

and you can sort the tasks relative to the actual score to prioritise within a colour band.

Handling tasks that can happen multiple times within a day turns out to be easy. Simply change the units that you use to measure interval_since_last, minimum and maximum to hours for that task and it just works.

One thing I observed implementing this in Python, though, is that interval_since_last should be an integer rounded down. Otherwise something with a minimum of 1 will start to have a score > 0 before that 1 interval is up.

I'll make my command-line Python implementation available soon.