Kinetic Heap
A kinetic heap is an event-driven kinetic priority queue introduced by Basch, Guibas, and Hershberger that tracks the minimum or maximum element among continuously moving keys by maintaining parent-child order certificates and processing certificate failures as keys cross.
Kinetic heap is an event-driven priority queue within computation and algorithms designed to maintain the minimum (or maximum) element among a set of n items whose numerical keys vary continuously with time t. Introduced by Julien Basch, Leonidas J. Guibas, and John Hershberger at the 1997 ACM–SIAM Symposium on Discrete Algorithms (SODA) and published in the Journal of Algorithms in 1999 as the foundational example of the kinetic data structure (KDS) framework, a kinetic heap augments a classical binary heap with algebraic certificates on every parent–child edge and schedules each certificate's expiration time in a global event queue. Together with its companion kinetic priority queues—the kinetic tournament, the kinetic hanger, and the kinetic heater—the kinetic heap serves as the core event-scheduling engine inside kinetic geometric algorithms for collision detection, kinetic convex hulls, kinetic closest pairs, and dynamic visibility maintenance.
Unlike static priority queues such as the Fibonacci heap, pairing heap, or violation heap, which only modify keys at discrete caller-initiated operations, a kinetic priority queue treats each item's key as a known continuous trajectory ki(t) (most commonly an affine linear function ki(t) = ai t + bi or a bounded-degree polynomial) and advances through time by repairing the heap only at the discrete instants when a child's key overtakes its parent's key.
Problem Formulation: The Kinetic Priority Queue
Let S = {1, 2, ..., n} be a set of n elements, where the priority of each element i ∈ S is a continuous, piece-wise algebraic function of time t ∈ [0, ∞):
ki(t) = ai t + bi
(or more generally a degree-s algebraic trajectory such that any pair of trajectories ki(t) and kj(t) intersect at most s times). A kinetic priority queue must maintain a pointer to the element attaining the instantaneous minimum key:
i*(t) = arg mini ∈ S ki(t)
as time t advances continuously, while also supporting three dynamic operations at arbitrary times t:
- Insert(i, ki(t)): Add a new element i with trajectory ki(t) to S at the current time t.
- Delete(i): Remove element i from S at time t.
- Change-Trajectory(i, k′i(t)): Replace the motion law of element i at time t with a new trajectory k′i(t) satisfying k′i(t) = ki(t) (corresponding to an elastic collision, control impulse, or flight-plan update).
Geometrically, in the (t, k)-plane, the trajectories k1(t), ..., kn(t) form an arrangement of n lines (or pseudo-segments), and maintaining the minimum element i*(t) is equivalent to tracking the lower envelope of the line arrangement as a vertical sweep line moves rightward with increasing t. Whenever the current minimum line intersects another line and ceases to be the lowest trajectory, an external event occurs; any structural rearrangement performed by the data structure among non-minimum elements is an internal event.
Architecture of the Kinetic Heap and Event-Driven Certification
Binary Tree Structure and Parent–Child Certificates
A kinetic heap stores the n elements in a balanced binary tree—typically a complete binary tree of height ⌊log2 n⌋—that satisfies the standard min-heap structural invariant at the current time t0: for every tree edge linking a parent node u to a child node v, the instantaneous keys obey:
ku(t0) ≤ kv(t0)
To kinetize this static binary heap within the kinetic data structure paradigm, each parent–child edge (u, v) is equipped with an elementary inequality certificate [u ≤ v] asserting that ku(t) ≤ kv(t). Because a tree on n nodes has n − 1 edges, a kinetic heap maintains n − 1 certificates in total.
Certificate Failure Times and the Global Event Queue
For each parent–child edge (u, v) with affine trajectories ku(t) = au t + bu and kv(t) = av t + bv that currently satisfies ku(t0) ≤ kv(t0), the certificate [u ≤ v] can only fail at a future time t > t0 if the child's key decreases faster (or increases more slowly) than the parent's key—that is, if the relative slope satisfies av < au (or, for general algebraic trajectories, at the earliest root t > t0 of ku(t) − kv(t) = 0). Specifically, for linear trajectories:
- If au ≤ av, the inequality ku(t) ≤ kv(t) remains valid for all t ≥ t0, so its failure time is tfail(u, v) = +∞ (an inactive certificate).
- If au > av, the two lines cross at the exact future expiration timestamp:
tfail(u, v) = (bv − bu) / (au − av) ≥ t0
All active certificates with finite failure times tfail < +∞ are stored in a conventional static priority queue Q—called the global event queue—keyed by their scalar expiration timestamps tfail. Because the timestamps tfail are static real numbers rather than moving functions of time, Q can be implemented as a standard binary heap, Fibonacci heap, or radix heap.
Certificate Expiration and Local Swap Repair
When time t reaches the minimum timestamp tfail(u, v) at the head of the global event queue Q, the child v is overtaking its parent u (kv(t) = ku(t) and av < au). The kinetic heap repairs the violation in O(1) tree-pointer updates and O(log n) event-queue operations:
- Parent–Child Swap: Swap the elements stored at parent u and child v inside the binary heap tree. If u was the root of the kinetic heap, v becomes the new overall minimum element (triggering an external event for the calling algorithm).
- Certificate Replacement: Swapping u and v invalidates only the certificates incident to the tree positions of u and v. In a binary tree, at most five tree edges are incident to the pair (u, v):
- The edge (u, v) itself, whose certificate reverses from [u ≤ v] to [v ≤ u] with failure time +∞ (since av < au means v will remain smaller than u for all future t > tfail under linear motion).
- The edge from u's parent p to the upper node position (if u was not the root), whose certificate becomes [p ≤ v].
- The edge from the upper node position to u's other child w (the sibling of v), whose certificate becomes [v ≤ w].
- The two edges from the lower node position (now holding u) to the two original children x and y of v, whose certificates become [u ≤ x] and [u ≤ y].
- Event Queue Rescheduling: Compute the new failure times for these at most four adjacent edges and update their entries in the global event queue Q (each taking O(log n) time in Q). Because ku(tfail) = kv(tfail) at the exact instant of crossing, all four adjacent inequalities [p ≤ v], [v ≤ w], [u ≤ x], and [u ≤ y] are guaranteed to hold at t = tfail without cascading further swaps at that instant.
The Four KDS Quality Metrics Applied to Kinetic Heaps
Basch, Guibas, and Hershberger evaluated every kinetic data structure along four asymptotic criteria:
- Responsiveness: The worst-case time required to process a single certificate failure and restore the invariant. In a kinetic heap, swapping u and v updates at most 4 other certificates in the event queue Q of size ≤ n − 1, so each event takes O(log n) worst-case time; therefore the kinetic heap is responsive.
- Locality: The maximum number of certificates in which any single element i participates, which governs the cost of Change-Trajectory(i, k′i(t)). Because a binary tree node has at most 1 parent and at most 2 children, every element in a kinetic heap participates in at most 3 certificates (O(1) locality). Consequently, when an element changes trajectory after a collision, only at most 3 entries in Q need to be recomputed, taking O(log n) time.
- Compactness: The total number of active certificates maintained by the structure. A kinetic heap stores n − 1 parent–child certificates, achieving optimal O(n) compactness.
- Efficiency: The ratio between the worst-case total number of internal certificate-failure events processed by the data structure and the worst-case number of external events (changes to the true minimum i*(t)). By Davenport–Schinzel theory, the lower envelope of n lines in the plane has at most n − 1 vertices (Ω(n) external events in the worst case), and for degree-s trajectories the complexity is λs(n) = n 2Θ(α(n)s−2). Because a polylogarithmic factor logc n is negligible compared to n, a KDS is called efficient if its total event count is O(n polylog n).
Sweeping Analysis of Total Events in a Kinetic Heap
Determining the exact worst-case number of certificate failures in a kinetic heap with n linear trajectories ki(t) = ai t + bi was a classic problem in kinetic geometry:
- Basch, Guibas, and Hershberger (1999) proved an initial upper bound of O(n log3 n) total events by defining a potential function on each tree node that counts how many descendants have both a currently larger key kv(t) > ku(t) and a smaller slope av < au ("inversion potential" at tree levels).
- Guilherme D. da Fonseca, Celina M. H. de Figueiredo, and Paulo C. P. Carvalho (2001) tightened the analysis of the kinetic heap to O(n log2 n) worst-case events for linear trajectories—matching the asymptotic event bound of the kinetic tournament without sacrificing O(1) locality! Their proof defines, for each time t and each tree edge e, the imbalance between the slopes of subtrees and shows via a binary representation of subtree weights that the sum of potential drops across all levels of the complete binary tree is bounded by O(n log2 n).
Alternative Kinetic Priority Queues: Tournament, Hanger, and Heater
To explore trade-offs between the O(n log2 n) event count of a deterministic kinetic heap and the Ω(n log n) information-theoretic sorting barrier across all tree levels, researchers developed three closely related kinetic priority queues:
Kinetic Tournament
A kinetic tournament (Basch, Guibas, and Hershberger, 1999) organizes the n elements at the leaves of a complete binary tournament tree of height ⌈log2 n⌉. Every internal node w stores the winner (minimum key at time t) of its two child subtrees wleft and wright, certified by a single comparison certificate [winner(wleft) ≤ winner(wright)].
- Events and Efficiency: By applying a divide-and-conquer recurrence across the ⌈log2 n⌉ levels of the tournament—where an internal node covering m leaves experiences as many events as the lower envelope of m trajectories, O(m) for lines or λs(m) for degree-s curves—the total number of events across all internal nodes is ∑h=1log n (n / 2h) O(2h) = O(n log n) for linear trajectories (and O(λs(n) log n) for degree-s trajectories).
- Locality Penalty: Because the winning element at the root must appear at every ancestor along its root-to-leaf path, a single element can participate in Θ(log n) certificates (O(log n) locality), and when an internal certificate fails at height h, the new winner must percolate up through up to h ancestor comparisons, costing O(log2 n) worst-case time per event or flight-plan update.
Kinetic Hanger
Introduced by Haim Kaplan, Robert E. Tarjan, and Kostas Tsioutsiouliklis (2001), a kinetic hanger is a randomized variant of the kinetic heap that avoids maintaining a fixed complete binary tree shape. When a new element is inserted (or during initial construction), it hangs down from the root by choosing left or right child branches independently at random with probability 1/2 at each step until reaching an empty child slot, while certificate expirations swap parent and child in place exactly as in a kinetic heap.
- Because the expected depth of any node is O(log n) and each node still has at most 1 parent and 2 children, a kinetic hanger preserves O(1) worst-case locality (at most 3 certificates per item) and O(log n) expected responsiveness, while reducing the expected total number of certificate failures on linear trajectories from O(n log2 n) down to O(n log n) expected events.
Kinetic Heater
Also introduced by Basch, Guibas, and Hershberger (1999), a kinetic heater applies the random-priority principle of a treap to kinetic priority queues. Each element i is assigned a static random priority pi in addition to its time-varying key ki(t): the binary tree is a binary search tree on the static priorities pi and a min-heap on the kinetic keys ki(t). When a child's key kv(t) overtakes its parent's key ku(t), the heater performs a single tree rotation (as in a treap or splay tree) rather than an in-place node swap, achieving O(1) locality and O(n α(n) log n) expected events.
| Kinetic Priority Queue | Total Events (Linear Trajectories) | Locality (Certificates per Item) | Responsiveness (Time per Event) | Flight-Plan Update Cost | Structural Representation |
|---|---|---|---|---|---|
| Kinetic Heap | O(n log2 n) worst-case | O(1) (at most 3) | O(log n) worst-case | O(log n) worst-case | Complete binary min-heap; in-place parent–child swap |
| Kinetic Tournament | O(n log n) worst-case | O(log n) | O(log2 n) worst-case | O(log2 n) worst-case | Complete binary leaf tournament; bottom-up winner percolation |
| Kinetic Hanger | O(n log n) expected | O(1) (at most 3) | O(log n) expected | O(log n) expected | Randomized binary tree insertion; in-place parent–child swap |
| Kinetic Heater | O(n α(n) log n) expected | O(1) (at most 3) | O(log n) expected | O(log n) expected | Randomized treap on static priorities; single tree rotation |
Applications in Computational Geometry and Simulation
Kinetic heaps and their tournament/hanger counterparts appear across dynamic and kinetic geometry:
- Hierarchical Kinetic Data Structures and the Global Event Queue: Every kinetic data structure—such as the kinetic Delaunay triangulation, kinetic convex hull, or kinetic closest pair—produces certificates whose failure times may themselves depend on sub-structures. When a geometric algorithm nests kinetic structures hierarchically, a kinetic heap or kinetic tournament maintains the earliest expiring event across mobile sub-components.
- Continuous Collision Detection and Molecular Dynamics: In hard-sphere gas simulations, robotic motion planning, and rigid-body physics engines, pairwise time-of-impact functions between moving bounding volumes or Voronoi cells are tracked by kinetic priority queues, exploiting the O(1) locality of the kinetic heap or kinetic hanger so that when two particles collide and change velocity trajectories, only 3 certificates per affected pair need to be rescheduled.
- Parametric Shortest Paths and Parametric Minimum Spanning Trees: In networks whose edge weights vary linearly with a parameter λ (we(λ) = ae λ + be), sweeping λ from −∞ to +∞ inside Prim's algorithm or Dijkstra's algorithm reduces to maintaining kinetic priority queues over the cut edges, locating all breakpoints of the parametric minimum spanning tree piece-wise linear weight curve.
Frequently Asked Questions
When a parent and child swap in a kinetic heap at time tfail, can the swap immediately trigger another swap at the exact same timestamp?
Under general position (where no three trajectories pass through a common point at the same instant tfail), a swap between parent u and child v at t = tfail never triggers an immediate cascading swap. Because ku(tfail) = kv(tfail) at the exact moment of intersection, replacing u with v below u's parent p preserves kp(tfail) ≤ ku(tfail) = kv(tfail), and placing u above v's children x, y preserves ku(tfail) = kv(tfail) ≤ min(kx(tfail), ky(tfail)). Thus all four updated adjacent certificates have failure times ≥ tfail.
Why do we still need a static priority queue Q if we already have a kinetic heap?
The kinetic heap orders elements by their time-varying keys ki(t), which change continuously and change relative rank as trajectories cross. However, to know when the next crossing will happen inside the kinetic heap, the simulation must find the minimum among the static scalar failure timestamps tfail(u, v) ∈ ℝ of the n − 1 parent–child certificates. Those timestamps are fixed numbers (until a swap or trajectory update modifies at most 4 of them), so a standard static priority queue Q (such as a binary heap or Fibonacci heap) is used as the global event scheduler.
When should an engineer choose a kinetic heap over a kinetic tournament?
A kinetic heap (or randomized kinetic hanger) is preferred whenever items frequently undergo trajectory updates (Change-Trajectory, Insert, or Delete) due to collisions or user steering, because its O(1) locality (at most 3 certificates per item) guarantees O(log n) worst-case time per trajectory update and per event, compared to O(log2 n) in a kinetic tournament. Conversely, if trajectories are high-degree curves (s ≥ 3) that rarely change flight plans, a kinetic tournament provides a clean worst-case event bound of O(λs(n) log n).
References
- Basch, J., Guibas, L. J., & Hershberger, J. (1999). "Data Structures for Mobile Data." Journal of Algorithms, 31(1), 1–28. https://doi.org/10.1006/jagm.1998.0988
- da Fonseca, G. D., de Figueiredo, C. M. H., & Carvalho, P. C. P. (2001). "Kinetic Heap-Ordered Trees: Tight Analysis and Improved Algorithms." Information Processing Letters, 85(3), 165–169. https://doi.org/10.1016/S0020-0190(02)00368-X00368-X)
- Kaplan, H., Tarjan, R. E., & Tsioutsiouliklis, K. (2001). "Faster Kinetic Heaps and Their Use in Broadcast Scheduling." In Proceedings of the Twelfth Annual ACM–SIAM Symposium on Discrete Algorithms (SODA 2001), pp. 836–844. https://dl.acm.org/doi/10.5555/365411.365793
- Guibas, L. J. (1998). "Kinetic Data Structures: A State of the Art Report." In Robotics: The Algorithmic Perspective (WAFR 1998), pp. 191–209. A. K. Peters. https://doi.org/10.1201/9781439864531
- Agarwal, P. K., Eppstein, D., Guibas, L. J., & Henzinger, M. R. (1998). "Parametric and Kinetic Minimum Spanning Trees." In Proceedings of the 39th Annual Symposium on Foundations of Computer Science (FOCS 1998), pp. 596–605. IEEE. https://doi.org/10.1109/SFCS.1998.743510