User:Ringwith/Kinetic Tournament

A Kinetic Tournament is a kinetic data structure, obtained by the kinetization of a heap. It maintains a set of $$n$$ (continuously) moving points as a tree that satisfies the following heap property - if $$B$$ is a child node of $$A$$, then $$f_A(t) \geq f_B(t)$$ - at all times $$t$$, where $$f_X(t)$$ refers to the value stored in node $$X$$ at time $$t$$. A kinetic heap data structure is a type of kinetic priority queue and is typically used to maintain the upper envelope of a collection of functions in a plane (i.e. the largest value in the heap at any given time).

Implementation and operations
A regular heap can be kinetized by augmenting with a certificate $$(A>B)$$ for every pair of nodes $$A, B$$ such that $$B$$ is a child node of $$A$$. If the value stored at a node $$X$$ is a function $$f_X(t)$$ of time, then this certificate is only valid while $$f_A(t) > f_B(t)$$. Thus, the failure of this certificate must be scheduled in the event queue at a time $$t$$ such that $$f_B(t) = f_A(t)$$.

Dealing with certificate failures
When a certificate $$(A>B)$$ fails, the data structure must swap $$A$$ and $$B$$, and update the other certificates that each of them was present in.

For example, if $$B$$ (call its child nodes $$Y,Z$$) was a child node of $$A$$ (call its child nodes$$B,C$$ and its parent node $$X$$), and the certificate $$(BB), (AC), (B>Y), (B>Z)$$ with new certificates $$(B>A), (BC), (A>Y), (A>Z)$$.

Thus, assuming non-degeneracy of the events (no two events happen at the same time), only a constant number of events need to be de-scheduled and re-scheduled even in the worst case.

Operations
A kinetic heap supports the following operations:
 * $$create-heap(h)$$ - create an empty kinetic heap $$h$$
 * $$find-max(h, t)$$ (or $$find-min$$) - return the $$max$$ (or $$min$$ for a $$min-heap$$) value stored in the heap $$h$$ at the current virtual time $$t$$
 * $$insert(X,f_X,t)$$ - insert a key $$X$$ into the kinetic heap at the current virtual time $$t$$, whose value changes as a continuous function $$f_X(t)$$ of time $$t$$
 * $$delete(X,t)$$ - delete a key $$X$$ at the current virtual time $$t$$

Variants
This article deals primarily with "simple" kinetic heaps as described above, but other variants have been developed for specialized applications, such as:
 * Fibonacci kinetic heap
 * Incremental kinetic heap

Other kinetic priority queues which require linear space and achieve similar performance bounds are:
 * Kinetic Heater
 * Kinetic Tournament
 * Kinetic Hanger

Performance
Kinetic heaps perform well according to the four metrics (responsiveness, locality, efficiency and compactness) of kinetic data structure quality defined in Basch etc.

Responsiveness
A kinetic heap is responsive, since each certificate failure causes the concerned keys to be swapped and leads to only five certificates being replaced in the worst case.

Locality
Each node is present in one certificate each along with its parent node and two child nodes (if present), meaning that each node can be involved in a total of three scheduled events in the worst case, thus kinetic heaps are local.

Compactness
Each edge in the heap corresponds to exactly one scheduled event, therefore the number of scheduled events is exactly $$n-1$$ where $$n$$ is the number of nodes in the kinetic heap. Thus, kinetic heaps are compact.

Efficiency
The efficiency of a kinetic heap in the general case is largely unknown. However, in the special case of affine motion ($$f(t) = at + b$$) of the values, kinetic heaps are known to be very efficient.

Affine motion, no insertions or deletions
In this special case, the maximum number of events processed by a kinetic heap can be shown to be exactly the number of edges in the transitive closure of the tree structure of the heap, which is $$O(n\log n)$$ for a tree of height $$O(\log n)$$.

Affine motion, with insertions and deletions
If $$n$$ insertions and deletions are made on a kinetic heap that starts empty, the maximum number of events processed is $$O(n \sqrt{n\log n})$$. However, this bound is not believed to be tight, and the only known lower bound is $$\Omega(n\log n)$$.

Applications
Kinetic heaps have been used as part of many algorithms such as dynamic planar convex hull, clustering moving points and continuous nearest neighbor queries, as well as for applications such as broadcast scheduling.