Pruning a level along a Hausdorff decomposition #
Arvind, Köbler and Mundhenk's procedure PRUNE [Arvind, Köbler and Mundhenk, Theorem 3.4]
[AKM92], on an abstract list of nodes. Let N be a level whose members of a
set L are exactly its first h + 1 nodes, and let L have a Hausdorff decomposition on N:
there are sets C 0 ⊇ C 1 ⊇ ⋯ such that a node is in L exactly when it is in C (2 d) but not
in C (2 d + 1) for some d < D. If each C j with j < 2 D reduces conjunctively to a set with
at most s members on N, the queries Q j of a node all lying in it exactly when the node is
in C j, then PRUNE keeps the node at position h (Cslib.Complexity.BTT.getElem_mem_prune)
and keeps at most 2 D (s + 2) ^ (2 D) nodes (Cslib.Complexity.BTT.length_prune_le).
PRUNE works with positions in N. At depth d it runs SEARCH-RIGHT with the queries
Q (2 d) from each start position (Cslib.Complexity.BTT.searchRightFrom), and SEARCH-LEFT
with the queries Q (2 d + 1) from each position that SEARCH-RIGHT keeps
(Cslib.Complexity.BTT.searchLeftFrom). SEARCH-LEFT is SEARCH-RIGHT on the positions up to
its start in decreasing order. The positions kept by SEARCH-LEFT are the start positions of the
next depth.
Why the node at position h is kept, following the source. At depth d, some start position
l ≤ h begins a run of nodes in C (2 d) reaching h. Let r ≥ h end the longest such run.
SEARCH-RIGHT keeps r, since the next node, if any, is outside C (2 d)
(Cslib.Complexity.BTT.mem_searchRightFrom). The nodes after h up to r are in C (2 d) but
not in L, so they are in C (2 d + 1). Let m start the longest run of nodes in C (2 d + 1)
ending at r; SEARCH-LEFT keeps m (Cslib.Complexity.BTT.mem_searchLeftFrom). If the node at
h is outside C (2 d + 1), then m = h + 1, and h is collected as r when r = h or as
m - 1 otherwise. If it is in C (2 d + 1), then m ≤ h, and the nodes from m to h are in
L and in C (2 d + 1), hence in C (2 d + 2): the argument repeats at depth d + 1 from m.
At depth D that would put the node at h in every C j, so outside L; the recursion collects
h before.
The source's SEARCH-RIGHT and SEARCH-LEFT stop once more than s distinct queries have been
collected, and its PRUNE returns the nodes before those that SEARCH-LEFT keeps. Here both scans
are Cslib.Complexity.BTT.searchRight, which reads the whole list and does not test its
first node against the empty set of queries, so SEARCH-LEFT from r never keeps r + 1. The
positions kept by SEARCH-RIGHT are collected as well, which covers the case r = h, where the
source's SEARCH-LEFT keeps r + 1, possibly past the end of the level.
Main definitions #
Cslib.Complexity.BTT.hasNewQuery,Cslib.Complexity.BTT.searchRight: the baseSEARCH-RIGHTscan on an arbitrary list.Cslib.Complexity.BTT.queriesAt: the queries of the node at a position.Cslib.Complexity.BTT.searchRightFrom,Cslib.Complexity.BTT.searchLeftFrom:SEARCH-RIGHTandSEARCH-LEFTon positions.Cslib.Complexity.BTT.prunePositions,Cslib.Complexity.BTT.prune:PRUNE, on positions and on nodes.
Main results #
Cslib.Complexity.BTT.searchRight_sublist,Cslib.Complexity.BTT.length_searchRight_le,Cslib.Complexity.BTT.mem_searchRight:SEARCH-RIGHTkeeps at mosts + 2nodes and retains the end of every initial run of nodes whose queries lie in a set of at mostsmembers.Cslib.Complexity.BTT.mem_searchRightFrom,Cslib.Complexity.BTT.mem_searchLeftFrom: the searches keep the ends of runs of nodes of a set with conjunctive queries (the source's Claims 1 and 2).Cslib.Complexity.BTT.getElem_mem_prune:PRUNEkeeps the last node of the level inL(the source's Claim 3).Cslib.Complexity.BTT.prune_sublist,Cslib.Complexity.BTT.length_prune_le:PRUNEkeeps at most2 D (s + 2) ^ (2 D)nodes of its level, in order.Cslib.Complexity.BTT.computableInPolyTime_prune:PRUNEwith a fixed number of depths is polynomial-time.
References #
SEARCH-RIGHT #
The test of SEARCH-RIGHT at the node z after the nodes pre, with the queries Q and the
bound s: the queries of the nodes pre have at most s distinct values, and z has a query that
is not among them.
SEARCH-RIGHT with the queries Q and the bound s, on a level in increasing order: keep
each node whose successor z passes hasNewQuery with the nodes up to the node, and keep the
last node.
SEARCH-RIGHT keeps a sublist of its level.
SEARCH-RIGHT keeps at most s + 2 nodes: the last one, and at most s + 1 others,
since each raises the number of distinct queries seen, which is at most s when it is kept.
SEARCH-RIGHT keeps the end of a run of nodes whose queries lie in a small set. If every
query of the nodes A and of y lies in a set K whose finite subsets have at most s members,
and the node after y, if any, has a query outside K, then SEARCH-RIGHT keeps y.
SEARCH-RIGHT and SEARCH-LEFT on positions #
SEARCH-RIGHT from the position l, with the queries Q and the bound s: the
positions of N kept by Cslib.Complexity.BTT.searchRight on the positions from l on,
in increasing order.
SEARCH-LEFT from the position r, with the queries Q and the bound s: the positions
kept by Cslib.Complexity.BTT.searchRight on the positions up to r, in decreasing
order.
SEARCH-RIGHT keeps the end of a run (the source's Claim 1). If the nodes at the positions
from l to r are in a set C whose members are the nodes with all their queries in K, which
has at most s members, and the node after r, if any, is not in C, then SEARCH-RIGHT from
l keeps r.
SEARCH-LEFT keeps the start of a run (the source's Claim 2). If the nodes at the
positions from m to r are in a set C whose members are the nodes with all their queries in
K, which has at most s members, and the node before m, if any, is not in C, then
SEARCH-LEFT from r keeps m.
PRUNE #
PRUNE on positions: the positions of N collected at the depths d, …, d + n - 1 from
the start positions starts, with the queries Q and the bound s. At depth d, SEARCH-RIGHT
with the queries Q (2 d) runs from every start position, and SEARCH-LEFT with the queries
Q (2 d + 1) from every position it keeps. The positions kept by SEARCH-RIGHT, the positions
before those kept by SEARCH-LEFT, and the positions collected from the latter at the next depths
are collected.
PRUNE with the queries Q, the bound s and D depths: the nodes of N at the
positions collected from the first position, in their order in N.
PRUNE keeps the last node of the level in L (the source's Claim 3). Let the sets
C j decrease along N, and let L be ⋃ d < D, C (2 d) \ C (2 d + 1) on N, whose members in
N are exactly the nodes at positions i ≤ h. If, for each j < 2 D, the nodes of N in C j
are those with all their queries Q j in a set K j with at most s members, then PRUNE keeps
the node at position h.
Polynomial time #
The test of SEARCH-RIGHT is polynomial-time.
SEARCH-RIGHT is polynomial-time, for polynomial-time queries, bound and level.
The queries at a position are polynomial-time.
SEARCH-RIGHT from a computed position is polynomial-time.
SEARCH-LEFT from a computed position is polynomial-time.
PRUNE on positions with a fixed number n of depths from a fixed depth d is
polynomial-time, uniformly in the start positions.
PRUNE with a fixed number D of depths is polynomial-time, for polynomial-time
queries, bound and level.