2 research outputs found
Exact and Approximate Range Mode Query Data Structures in Practice
We conduct an experimental study on the range mode problem. In the exact version of the problem, we preprocess an array A, such that given a query range [a, b], the most frequent element in A[a, b] can be found efficiently. For this problem, our most important finding is that the strategy of using succinct data structures to encode more precomputed information not only helped Chan et al. (Linear-space data structures for range mode query in arrays, Theory of Computing Systems, 2013) improve previous results in theory but also helps us achieve the best time/space tradeoff in practice; we even go a step further to replace more components in their solution with succinct data structures and improve the performance further.
In the approximate version of this problem, a (1+?)-approximate range mode query looks for an element whose occurrences in A[a,b] is at least F_{a,b}/(1+?), where F_{a,b} is the frequency of the mode in A[a,b]. We implement all previous solutions to this problems and find that, even when ? = 1/2, the average approximation ratio of these solutions is close to 1 in practice, and they provide much faster query time than the best exact solution. These solutions achieve different useful time-space tradeoffs, and among them, El-Zein et al. (On Approximate Range Mode and Range Selection, 30th International Symposium on Algorithms and Computation, 2019) provide us with one solution whose space usage is only 35.6% to 93.8% of the cost of storing the input array of 32-bit integers (in most cases, the space cost is closer to the lower end, and the average space cost is 20.2 bits per symbol among all datasets). Its non-succinct version also stands out with query support at least several times faster than other O(n/?)-word structures while using only slightly more space in practice
Path Query Data Structures in Practice
We perform experimental studies on data structures that answer path median,
path counting, and path reporting queries in weighted trees. These query
problems generalize the well-known range median query problem in arrays, as
well as the orthogonal range counting and reporting problems in planar
point sets, to tree structured data. We propose practical realizations of the
latest theoretical results on path queries. Our data structures, which use tree
extraction, heavy-path decomposition and wavelet trees, are implemented in both
succinct and pointer-based form. Our succinct data structures are further
specialized to be plain or entropy-compressed. Through experiments on large
sets, we show that succinct data structures for path queries may present a
viable alternative to standard pointer-based realizations, in practical
scenarios. Compared to na{\"i}ve approaches that compute the answer by explicit
traversal of the query path, our succinct data structures are several times
faster in path median queries and perform comparably in path counting and path
reporting queries, while being several times more space-efficient. Plain
pointer-based realizations of our data structures, requiring a few times more
space than the na{\"i}ve ones, yield up to -times speed-up over them