How to implement a mental priority queue?

How would you implement a mental priority queue to handle dynamically changing data?

My use case is the daily task list. I realized that I basically maintain a mental task stack (i.e., I work on the last task that occurred to me) and manage it poorly. This leads to a lot of dropped tasks and frustration. No good. I want to maintain a mental priority queue instead. Actions I’d need to perform on this queue:

  • add task to queue (automatically assigned to the back of the queue)
  • delete task from front of queue (just finished a prioritized task)
  • delete tasks from the rest of the queue (tasks no longer need to be done)
  • re-prioritize a task (by moving it forward or backward in the queue)

I’ll propose a few potential implementations:

  1. peg list with gaps: As I’m given new tasks, I associate them with my peg images for numbers 0, 5, 10, 15, … With gaps I have more freedom to re-prioritize tasks (e.g., if the 4th task at index number 15 becomes more important than the 2nd task at index number 5, then I can re-assign the 4th task the index number, say, 3, making it the second task). To traverse all my tasks I must traverse my peg list, which would be ~5x the length of my actual number of tasks. Not ideal
  2. tie peg list to memory palace: E.g., I could have a memory palace with 50 locations and tie my index to those locations.
  3. Zettelkasten indexing: I number my tasks 0, 1, 2, 3, … I re-prioritize tasks by giving them an identifier “[NUMBER][LETTER]”. (e.g., if the 4th task at index number 3 becomes more important than the 2nd task at index number 1, then I can re-assign the 4th task the identifier “0A”). I could keep on in this way, “[NUMBER][LETTER][number][letter]…” (e.g., “0Aia…”). To traverse all my tasks I must traverse my peg list, while checking if each item in my list has a sub-indexed item. (E.g., 0? Yes: dishes. 0A? Yes: laundry. 0Ai? No. 0AB? No. 1? Yes: vacuum). Each number is image from my peg list, small numbers are a diminuitive version of that image, letters are my shaper images.
  4. Memory palace with linked list extension: I place each task with object at locations 0, 1, 2, 3, … in my memory palace. If I need to re-prioritize a task, I interact with another task rather than a locus object (e.g., if the 4th task at location index number 3 becomes more important than the 2nd task at location index number 1, then I can interact it with the 1st task using a Left/Right scheme to indicate that it comes after the 1st task. The new structure would looks as follows: 0-indexed object interacting 1st task, 1st task interacting with 2nd task (previously, 4th task), 1-indexed object interacting with 3rd task (previously 2nd task), 2-indexed object interacting with 4th task (previously 3rd task).
  5. Memory Palace with gaps, and linked list extension: The peg list in options 1 and 2 seems unnecessary to me at this point. But still, having a way to place items sequentially and leaving space between them to handle potential re-prioritizations is still valuable. A memory palace with gaps does exactly that. And if worse comes to worst, I fill up all the gaps, and still need to re-prioritize, I can always just build a linked list (see option 6) on-the-fly off of one of those items. Not a terrible hack.
  6. Pure linked list / chain: Be aware of your current task and how it relates to the next task (action-upon image, color, shapes, etc.). Repeat for each subsequent task. Traversal is easy and non-redundant. Item completion only requires one to point their awareness to the next item in the list. Deletion from the middle of the list requires a little extra work. You have to unlink the item from the previous item (e.g., putting a big red “X” through it?) and re-linking that previous item to the next item. Re-prioritizing requires even more work, basically deleting the task from it’s original location in the chain, breaking the link and linking it in at its location-to-be in the chain.

I think number 4 is the best. Any thoughts?

5 Likes

My first thought is “I wish I’d got a proper night’s sleep.” :stuck_out_tongue:

But my second was: Multiple rooms, representing priority, with multiple loci in each.

So:

  • Adding a task: choose a priority (room) and place at a locus there.

  • Deleting a task: mangle the image, wherever it is. (e.g. Cross out, paint red, crush, set on fire.)

  • Reprioritise a task: mangle at current location, place at new location.

Flaws:

  • Each room is limited to number of locations, so over time it fills up. If you have multiple sets of rooms you need enough so you can cycle through them over 3 or 4 days, then you can always shift to next in cycle if you have a large volume.

  • Increasing fragmentation over time, as tasks become more divided by mangled images. The only easy cure to that is again more sets of rooms, and taking time to “defrag” the content of the previous rooms to the next rooms. Time consuming, and judging when it’s worthwhile depends on how good an overview you have at any one moment.

  • Although my idea removes ghosting in most cases, the remaining cases seem to be if you move an item, leaving a mangled item behind in its old position, then if you associate it too similarly you may draw the ghost of the mangle action to the new image. My best solution to that, other than trying to be more varied, is to use a mangling for each priority level, plus a “done” mangling. Then if you find a item in the priority 2 room with a priority 3 mangling ghost, you know it left priority 3 and is likely still in priority 2. But if it has any “done” ghost to it, you did it somewhere already regardless of the priority. It does mean that fluctuating priority can be confusing still, however.

That’s the best I can invent on the fly, so it may not be complete. For example, whether the rooms are organised with a linear path or not isn’t specified - which might simplify reading it back, but might add more work in filtering out the moved and finished items.

So I think:

  • This is better than option 1 & 2, because there is no fixed limit as there is for spaced pegs/single MP.

  • Option 3 seems a higher cognitive load, requiring a depth search of each possible tree. How would you easily transpose an item across such a system? Sounds labour-intensive and slow.

  • Option 4 (if I understood correctly) sounds easier but takes work that would create more possible ghost image effects. This linked list (like the programming version, yes?) I think is called a chain in mnemonic parlance. Imagine a chain, and you move a link up the chain. The link already there may leave a ghost image, making it difficult to know which is the link to follow, and then the link after has the same problem, which could cause skipping sections of the chain. You have to ensure you re-attach both threads of the chain correctly, without ghost images. A fix for that might be adding a single component to each link that signifies the number of updates to that link - so each original has a zero or no marker, but the first replacement includes a ‘1’ image, the second a ‘2’ image, and so on. This means you might be able to discern which ghostly image is correct when they happen.

I think 4 seems tidier with a ghost image fix, but my idea might be more effective and quicker if you have the MPs for it - not sure.

So, that’s my thoughts on this :slight_smile:

2 Likes

I maintain my daily task list on a handwritten list that I cross off each task as its completed.

Even if I have the tasks also in a digital tracker I reference that while building my list for the day. I developed this habit during my IT project management work but it also applies well to memory.

This seems a bit like focus creep to me considering your other ambitious projects.

Using pen and paper to reduce cognitive load is usually always going to be available and just investing in a pocket notebook would probably solve this issue if you are worried about wanting to add to your list without access to pen and paper.

I also get a nice rewarding feeling every time I cross the task off my paper list.

4 Likes

I tend to agree with @zweb_chess for using his better method. A memory system should not be used for dynamc data. Visual images don’t like to be updated like a database. It sounds like this is a case of a boy owning a big hammer.

4 Likes

Thanks a lot for the feedback. You’ve given me a lot to think about. I haven’t yet had to think precisely about the actual implementation and consquences of unliking. e.g., the ghost image consequences, alternatives such as maintaining an updates account, etc. I like the red paint :slight_smile:

One thing I didn’t clarify was that, in practice, these priority rankings aren’t dense. That is, there are usually as many priority rankings as there are items. In other words, it would be rare for two items to be tied on priority. So, having a separate room for each priority, in my case, wouldn’t work. But having a separate locus object would be fine.

Another thing I didn’t clarify was that, in practice, these task lists get flushed at the end of each day. So I don’t have to worry about the complications of day-over-day maintenance, ghost images, defraging, etc.

I liked your idea of adding an updates count image to the task. That way you know how many previously-linked tasks you need to pass over before you get to your current task. However, doesn’t that create a new problem of ghost images with the updates count? Wouldn’t you have to put a red “X”, say, through the “0” before you update to “1”? Do you have a meaningful image for number which should be thought of cumulatively? E.g., a bathtub filling which is empty, filled to 1 inch. filled to 2 inches, etc. That way you wouldn’t need to put a red “X” through the update count. But then, I don’t think bathtub with 1-inch of water is discernibly different than a bathtub with 2-inches of water. So I don’t think what I just proposed is actually feasible. But maybe there’s something there.

Your comments about the linked list made me aware that I never even specified a pure linked list as a solution. So I edited my original post to include it as my (6) option. There, I echoed some of the points you made here. In particular, it seems like the most straightforward structure, but re-prioritization can be really costly.

I also added a (5) option to hybridize the gaps solution and the memory palace with linked list solution.

As of now, I think the best solutions are as follows:

  • When re-prioritizations happen rarely: option 6, the pure linked list
  • When re-prioritizations happen often: option 5, the memory palace with gaps
  • When re-prioritizations happen a moderate amount: option 5, but adjust the gap size down to only that which is needed, allowing for a linked list extension off of any item as a hack if worse comes to worst.
1 Like

@zweb_chess , @thinkaboutthebible

Clearly a written task list is the simple, straightforward solution. Not everything needs to be maintained in memory. But I am still curious about the mental implementation if only to understand a little bit more about myself. Currently, I don’t do the mental task list well. I know some people who do. What’s going on? Do they use a different underlying data structure (e.g., stack vs priority queue)? Are they just better at directing their attention? Is this a working memory thing?

Also, I’m using this as an exercise in understanding the limits of typical memory sports data structures. It’s been very useful to discover how these structures really aren’t suited for re-prioritizations. So, maybe nothing more to see here.

Still, I’m going to implement a few of these for a few days each and report back. Maybe I discover something interesting :slight_smile:

3 Likes

Looking forward to hearing about it.

@zoderfit, I like to see the spirit of exploration in mnemonics. There are a lot of dark corners that still need to be explored so don’t think that I was saying that the subject can’t be hit with a hammer. Maybe you just haven’t found the right approach yet. I’ll be reading to see what you come up with also! Good luck.

5 Likes

Would all your tasks be interchangeable if you didn’t consider their priority?
Meaning: can you decide to pick up and do any of them at any time throughout the day?

I treat my daily vs non-daily tasks differently, but in both cases I really need to have them separated by the necessary conditions that would allow me to accomplish them.
For example: these tasks can only be done during working hours, for these i’ll need to be at the computer, these need at least 5 consecutive minutes of undivided attention, for these i’ll need to go outside, etc

If I wanted to memorize what tasks I need to do, I’d make a different mini palace for each needed condition. Example: opening the computer will remind me of the palace in which i put the things I have to do at the computer, looking at the watch will remind me of the palace where i put the things I have to do during working hours, etc. You could also make a palace to remind you of all these palaces and put it in the fridge if that is a distractor you come across often, and this one wouldn’t ever have to change.

Then I’d only have to prioritize the elements within each group, so then the re-prioritization won’t happen as often and it’s easier to handle

1 Like

This isn’t my case, but it is interesting to think about.

If your conditions are all location-based, you could just construct a memory palace from the actual locations where you’d do the tasks, most likely your home or work.

I asked my wife how she thinks her brain handles this problem (she’s great with this stuff). She basically said that she maintains a traversal path over locations where she has tasks. If a task needs to be re-prioritized, she just modifies the traversal path. So, it’s kind of the opposite of what we normally do with memory palaces, where we typically fix a traversal path and modify items associated with locus objects on the path.

But with the other conditions you list, yeah, they seem harder. I think this is related to the problem of multi-columnar data which I posted on in Historical Timeline.

How about practicing “counting” all day?

Eventually you might be able to bind tasks to numbers and keep track of time-and-event bindings with immense precision!

1 Like

Interesting I never thought of it that way, I do the same for the things that need to be done around the house. The path is decided based on efficiency and on constraints that can change (like can I make noise, do I have enough time for this task, is this task time-sensitive)
But everybody must be doing something like that in their mind when they have to run errands out of the house (First go to the post office, then go to the bank, pass by the baker, etc. This kind of path will mostly depend on opening times and shortest subpaths. If something changes, for example you’re told you also need to pass by the supermarket, you’ll instinctively adjust the path… right?)

My husband said that he only writes things down when they start becoming too many, but usually he just makes a mental note that whenever a specific topic or thought comes up then he’ll be reminded of a specific task he has to do that is for it or related to it. I objected that this is leaving too much to chance and some things to do might never come up, but I also failed to find an example for which this wouldn’t work

1 Like

I’m glad you asked this. It made me reflect more on my own process. Right now, I do something like that. I’ll remember the number of things I have to do. E.g., I have to grab 5 things before I leave the house. I just trust that when it comes time to grab the 5 things, that will be able to regenerate what they are. Just knowing that there are 5 things, no more or less, dramatically reduces my search space.

But this his a hack for remembering a set of things, not an order list, let alone a priority queue.

So it’s as if your husband ties tasks to a memory palace, so to speak, of thoughts, concepts, locations, etc., and runs a subconscious polling process, continuously asking, “Is there a task associated with this thing?” That’s certainly a way to do it. Doesn’t seem optimal. But then again, who even knows what’s optimal in this space.

It’s more like:
-he has a bunch of pegs - so they are not spatially placed anywhere
-there are multiple pegs per task - so he’s often reminded of the task in multiple occasions
-that are sure to come up soon enough - otherwise he would choose different pegs, or otherwise they are not that important if it turns out they never come up
-that are sure to remind him of the tasks associated with them - and he doesn’t have to explicitly wonder what is associated with them
In fact I do see it working in real time: I’ll bring up a subject because I have a task associated with it that I need collaboration for, and he’ll say “wait this reminds me I have to do that other task” and immediately proceeds to do it. So I guess it will mostly be feasible if your spouse doesn’t mind holding their own thoughts in a more structured way and reschedule their own tasks accordingly, but as far as getting things done, it does work. On the downside, other times he’ll say “please could you stop bringing that up because it reminds me that I still have to do this task”. So especially for things you’re not able to accomplish quickly and soon, one should probably use a different method or will end up stressed out by all these reminders.
For efficiency, it won’t allow for a big picture so it will require more time and effort overall in the accomplishing of tasks. But for a lot of tasks (those that won’t stress you out) it does require minimal effort in the structure and thought process, and it does ensure you won’t miss a task

1 Like