Retroactive priority queues in Python

Parker Rule

May 18, 2021

Retroactivity

("back to the future")

Partially retroactive: updates in the past and present, (fast) queries in the present

Fully retroactive: updates in the past and present, (fast) queries in the past and present

Easy general transformation: rollback

Retroactivity

Full retroactivity

What's in a queue?

Auxiliary data structures:

Weight-balanced B-trees (Arge and Vitter 2003, Bender et al. 2005)

Scapegoat trees (Galperin and Rivest 1993)

Various BST augmentations (prefix sum, etc.)

My implementation is mostly augmented scapegoat trees.

Code tour & demo

Future work

Related partially retroactive data structures

Fully retroactive priority queues—all the way

Performance improvements

Generalization

Related work

retroactive, a popular 6.851 final project by Chelsea Voss

rpqvis, a visualization project from this iteration of 6.851

retroactive-priority-queue, a similar implementation project from this iteration of 6.851 with different underlying data structures (treaps)

Thank you!

Retroactive priority queues in Python

By Parker Rule

Retroactive priority queues in Python

  • 423