1,024 research outputs found

    Faster deterministic sorting and priority queues in linear space

    No full text
    The RAM complexity of deterministic linear space sorting of integers in words is improved from O(nlogn)O(n\sqrt{\log n}) to O(n(loglogn)2)O(n(\log\log n)^2). No better bounds are known for polynomial space. In fact, the techniques give a deterministic linear space priority queue supporting insert and delete in O((loglogn)2)O((\log\log n)^2) amortized time and find-min in constant time. The priority queue can be implemented using addition, shift, and bit-wise boolean operations

    Four Soviets Walk the Dog-Improved Bounds for Computing the Fr\'echet Distance

    Get PDF
    Given two polygonal curves in the plane, there are many ways to define a notion of similarity between them. One popular measure is the Fr\'echet distance. Since it was proposed by Alt and Godau in 1992, many variants and extensions have been studied. Nonetheless, even more than 20 years later, the original O(n2logn)O(n^2 \log n) algorithm by Alt and Godau for computing the Fr\'echet distance remains the state of the art (here, nn denotes the number of edges on each curve). This has led Helmut Alt to conjecture that the associated decision problem is 3SUM-hard. In recent work, Agarwal et al. show how to break the quadratic barrier for the discrete version of the Fr\'echet distance, where one considers sequences of points instead of polygonal curves. Building on their work, we give a randomized algorithm to compute the Fr\'echet distance between two polygonal curves in time O(n2logn(loglogn)3/2)O(n^2 \sqrt{\log n}(\log\log n)^{3/2}) on a pointer machine and in time O(n2(loglogn)2)O(n^2(\log\log n)^2) on a word RAM. Furthermore, we show that there exists an algebraic decision tree for the decision problem of depth O(n2ε)O(n^{2-\varepsilon}), for some ε>0\varepsilon > 0. We believe that this reveals an intriguing new aspect of this well-studied problem. Finally, we show how to obtain the first subquadratic algorithm for computing the weak Fr\'echet distance on a word RAM.Comment: 34 pages, 15 figures. A preliminary version appeared in SODA 201

    Can We Overcome the nlognn \log n Barrier for Oblivious Sorting?

    Get PDF
    It is well-known that non-comparison-based techniques can allow us to sort nn elements in o(nlogn)o(n \log n) time on a Random-Access Machine (RAM). On the other hand, it is a long-standing open question whether (non-comparison-based) circuits can sort nn elements from the domain [1..2k][1..2^k] with o(knlogn)o(k n \log n) boolean gates. We consider weakened forms of this question: first, we consider a restricted class of sorting where the number of distinct keys is much smaller than the input length; and second, we explore Oblivious RAMs and probabilistic circuit families, i.e., computational models that are somewhat more powerful than circuits but much weaker than RAM. We show that Oblivious RAMs and probabilistic circuit families can sort o(logn)o(\log n)-bit keys in o(nlogn)o(n \log n) time or o(knlogn)o(k n \log n) circuit complexity where nn is the input length. Our algorithms work in the balls-and-bins model, i.e., not only can they sort an array of numerical keys --- if each key additionally carries an opaque ball, our algorithms can also move the balls into the correct order. We further show that in such a balls-and-bins model, it is impossible to sort Ω(logn)\Omega(\log n)-bit keys in o(nlogn)o(n \log n) time, and thus the o(logn)o(\log n)-bit-key assumption is necessary for overcoming the nlognn \log n barrier. Finally, we optimize the IO efficiency of our oblivious algorithms for RAMs --- we show that even the 11-bit special case of our algorithm can solve open questions regarding whether there exist oblivious algorithms for tight compaction and selection in linear IO

    A subquadratic algorithm for 3XOR

    Get PDF
    Given a set XX of nn binary words of equal length ww, the 3XOR problem asks for three elements a,b,cXa, b, c \in X such that ab=ca \oplus b=c, where \oplus denotes the bitwise XOR operation. The problem can be easily solved on a word RAM with word length ww in time O(n2logn)O(n^2 \log{n}). Using Han's fast integer sorting algorithm (2002/2004) this can be reduced to O(n2loglogn)O(n^2 \log{\log{n}}). With randomization or a sophisticated deterministic dictionary construction, creating a hash table for XX with constant lookup time leads to an algorithm with (expected) running time O(n2)O(n^2). At present, seemingly no faster algorithms are known. We present a surprisingly simple deterministic, quadratic time algorithm for 3XOR. Its core is a version of the Patricia trie for XX, which makes it possible to traverse the set aXa \oplus X in ascending order for arbitrary a{0,1}wa\in \{0, 1\}^{w} in linear time. Furthermore, we describe a randomized algorithm for 3XOR with expected running time O(n2min{log3w/w,(loglogn)2/log2n})O(n^2\cdot\min\{\log^3{w}/w, (\log\log{n})^2/\log^2 n\}). The algorithm transfers techniques to our setting that were used by Baran, Demaine, and P\u{a}tra\c{s}cu (2005/2008) for solving the related int3SUM problem (the same problem with integer addition in place of binary XOR) in expected time o(n2)o(n^2). As suggested by Jafargholi and Viola (2016), linear hash functions are employed. The latter authors also showed that assuming 3XOR needs expected running time n2o(1)n^{2-o(1)} one can prove conditional lower bounds for triangle enumeration just as with 3SUM. We demonstrate that 3XOR can be reduced to other problems as well, treating the examples offline SetDisjointness and offline SetIntersection, which were studied for 3SUM by Kopelowitz, Pettie, and Porat (2016)

    Algorithms and Data Structures for In-Memory Text Search Engines

    Get PDF

    Compressed Subsequence Matching and Packed Tree Coloring

    Get PDF
    We present a new algorithm for subsequence matching in grammar compressed strings. Given a grammar of size nn compressing a string of size NN and a pattern string of size mm over an alphabet of size σ\sigma, our algorithm uses O(n+nσw)O(n+\frac{n\sigma}{w}) space and O(n+nσw+mlogNlogwocc)O(n+\frac{n\sigma}{w}+m\log N\log w\cdot occ) or O(n+nσwlogw+mlogNocc)O(n+\frac{n\sigma}{w}\log w+m\log N\cdot occ) time. Here ww is the word size and occocc is the number of occurrences of the pattern. Our algorithm uses less space than previous algorithms and is also faster for occ=o(nlogN)occ=o(\frac{n}{\log N}) occurrences. The algorithm uses a new data structure that allows us to efficiently find the next occurrence of a given character after a given position in a compressed string. This data structure in turn is based on a new data structure for the tree color problem, where the node colors are packed in bit strings.Comment: To appear at CPM '1
    corecore