Best Algorithm to Sort Tasks by Priorities – Human-Centric Approach

algorithmsreviewsortingtasktask-organization

I have developed a task management tool. And some task lists can be very large. (I have myself more than 300 tasks to do).

I would like to do some task reviews from time to time as the tasks pile up to be able to sort them by priority.

I imagine presenting tasks 2 by 2 to the user and ask him what task is more important than the other. Repeat until all the tasks are sorted.

Note that:

  • The algorithm need to be "halt resistant": the user can abort the review when he wants to and the result of precedent sortings would not be lost.
  • The tasks already have a initial rank already set by the user by hand that represent the priority.

My questions are

  1. What is the best algorithm that reduce the number of comparison
    needed to sort all tasks ?
  2. Do you have a better strategy to propose
    (or way of presenting the tasks and questions) in order to speed up
    these reviews ?

EDIT 1

Thank you very much for all this feedback !

To answer some questions:

  • Yes, each tasks have responsibles and each responsible can order all (thous their) tasks.
  • We already have tags, but a tasks review is there to determine priorities among them. I agree that priorities can also be set by features and at the task level.
  • I do not want to have a tree of tasks classified by features and lose the flat list. I prefer a flat backlog with tagged tasks. It is sometimes very useful to prioritize a task belonging to a not so important feature placed later in the queue.
  • I realize that I maybe have first focused on this problem on the software level (asking for an algorithm) but my question is maybe belonging more to a project management group. I wonder for example how the agile review meetings are held.

EDIT 2

The more I think about it and what is my goal is (asking this question of this algorithm), is that I want to make it fun to do the tasks review.

The ultimate goal is keep tasks ordered by priority. But it is danting to review tasks. I'd like to have a sexy interface where tasks are presented, and the user could play while doing his review. The sexy/playing part is up to me, but I have a hard time finding a way to logically (algorithmically) present tasks and then order them, giving that the user can stop this process at anytime.

Say I present 2 random tasks, and that the user says that B is more important than A and stop there. Then what ? Does that mean I simply update the rank to b.rank = a.rank – 1 (lower the more important it is). And why randomly by the way ? Is there a logically thing to do there ? You see, I don't know how to proceed.

EDIT 3

I received a lot of input and I will greatly profit from all of them, so a big thank to all of you.

Best Answer

Bucket Sort

But I'm getting ahead of myself.

Consider the use cases of listing and sorting tasks like this.

  • A dev completed a task and needs to know what to work on next
  • A Project Manager needs to estimate a delivery date
  • A customer/stakeholder needs to be assured that their requests are Very Important to you

All three of those really only care about the top portion of the list. You also need to consider that the list is likely to change over time as things get added naturally, the one customer to request a feature left (making their requests moot), or new features subsume older requests. By the time you get to items 170-175, the work around them will have changed significantly, so there's not much point in quibbling over their exact order. You can start doing that when they end up in the top 20-30.

Here's how to avoid the problems outlined above. Start with a bucket sort. Define several different categories for relative importance; colors work well here. Avoid naming them with emotionally charged words like "critical" or "important", because everyone wants their requests to be "important", and it will skew the ratings. Instead, use either broad descriptions or canonical items as break points. A good top category might be "data loss, corruption, theft, or misrepresentation". If you use canonical items as decision points, you can either use real ones or generalized ones like "the new icons are one pixel too narrow, so pad them in CSS to compensate".

Then, use your new standards to group the tickets into rough clusters of relative importance. In sorting terms, it's similar to using quick sort with seven or so predefined pivots. You end up doing at most three comparisons, but after the first few your team will likely have someone suggest a category initially and discuss from there.

After you have a basic categorization, you should have zero items in your top category and a small number in your second category. If you have more than zero items in your top category, then stop this sort process immediately and work on those items.

Next, you can subsort the first non-empty group of items by any preferred method. Repeat with the next group as necessary until you can satisfy all of the three bullet points at the top of this answer. Any farther and you're likely wasting your time.

Related Topic