Searcharxiv⌕ Search

arXiv subjects

William Kuszmaul

Publications and source records attributed to William Kuszmaul.

71 records · Page 4Linked to original sources

In-Place Parallel-Partition Algorithms using Exclusive-Read-and-Write Memory

We present an in-place algorithm for the partition problem that has linear work and polylogarithmic span. The algorithm uses only exclusive read/write shared variables, and can be implemented using parallel-for-loops without any additional concurrency considerations (i.e., the algorithm is EREW). A key feature of the algorithm is that it exhibits provably optimal cache behavior, up to small-order factors. We also present a second in-place EREW algorithm for the partition problem that has linear work and span $O(\log n \cdot \log \log n)$, which is within an $O(\log\log n)$ factor of the optimal span. By using this low-span algorithm as a subroutine within the cache-friendly algorithm, we are able to obtain a single EREW algorithm that combines their theoretical guarantees: the algorithm achieves span $O(\log n \cdot \log \log n)$ and optimal cache behavior. As an immediate consequence, we also get an in-place EREW quicksort algorithm with work $O(n \log n)$, span $O(\log^2 n \cdot \log \log n)$. Whereas the standard EREW algorithm for parallel partitioning is memory-bandwidth bound on large numbers of cores, our cache-friendly algorithm is able to achieve near-ideal scaling in practice by avoiding the memory-bandwidth bottleneck. The algorithm's performance is comparable to that of the Blocked Strided Algorithm of Francis, Pannan, Frias, and Petit, which is the previous state-of-the art for parallel EREW sorting algorithms, but which lacks theoretical guarantees on its span and cache behavior.

cs.DS↗

Contention Resolution Without Collision Detection

This paper focuses on the contention resolution problem on a shared communication channel that does not support collision detection. A shared communication channel is a multiple access channel, which consists of a sequence of synchronized time slots. Players on the channel may attempt to broadcast a packet (message) in any time slot. A player's broadcast succeeds if no other player broadcasts during that slot. If two or more players broadcast in the same time slot, then the broadcasts collide and both broadcasts fail. The lack of collision detection means that a player monitoring the channel cannot differentiate between the case of two or more players broadcasting in the same slot (a collision) and zero players broadcasting. In the contention-resolution problem, players arrive on the channel over time, and each player has one packet to transmit. The goal is to coordinate the players so that each player is able to successfully transmit its packet within reasonable time. However, the players can only communicate via the shared channel by choosing to either broadcast or not. A contention-resolution protocol is measured in terms of its throughput (channel utilization). Previous work on contention resolution that achieved constant throughput assumed that either players could detect collisions, or the players' arrival pattern is generated by a memoryless (non-adversarial) process. The foundational question answered by this paper is whether collision detection is a luxury or necessity when the objective is to achieve constant throughput. We show that even without collision detection, one can solve contention resolution, achieving constant throughput, with high probability.

cs.DS↗

Achieving Optimal Backlog in the Vanilla Multi-Processor Cup Game

In each step of the $p$-processor cup game on $n$ cups, a filler distributes up to $p$ units of water among the cups, subject only to the constraint that no cup receives more than $1$ unit of water; an emptier then removes up to $1$ unit of water from each of $p$ cups. Designing strategies for the emptier that minimize backlog (i.e., the height of the fullest cup) is important for applications in processor scheduling, buffer management in networks, quality of service guarantees, and deamortization. We prove that the greedy algorithm (i.e., the empty-from-fullest-cups algorithm) achieves backlog $O(\log n)$ for any $p \ge 1$. This resolves a long-standing open problem for $p > 1$, and is asymptotically optimal as long as $n \ge 2p$. If the filler is an oblivious adversary, then we prove that there is a randomized emptying algorithm that achieve backlog $O(\log p + \log \log n)$ with probability $1 - 2^{-\operatorname{polylog}(n)}$ for $2^{\operatorname{polylog}(n)}$ steps. This is known to be asymptotically optimal when $n$ is sufficiently large relative to $p$. The analysis of the randomized algorithm can also be reinterpreted as a smoothed analysis of the deterministic greedy algorithm. Previously, the only known bound on backlog for $p > 1$, and the only known randomized guarantees for any $p$ (including when $p = 1$), required the use of resource augmentation, meaning that the filler can only distribute at most $p(1 - ε)$ units of water in each step, and that the emptier is then permitted to remove $1 + δ$ units of water from each of $p$ cups, for some $ε, δ> 0$.

cs.DS↗

Cilkmem: Algorithms for Analyzing the Memory High-Water Mark of Fork-Join Parallel Programs

Software engineers designing recursive fork-join programs destined to run on massively parallel computing systems must be cognizant of how their program's memory requirements scale in a many-processor execution. Although tools exist for measuring memory usage during one particular execution of a parallel program, such tools cannot bound the worst-case memory usage over all possible parallel executions. This paper introduces Cilkmem, a tool that analyzes the execution of a deterministic Cilk program to determine its $p$-processor memory high-water mark (MHWM), which is the worst-case memory usage of the program over \emph{all possible} $p$-processor executions. Cilkmem employs two new algorithms for computing the $p$-processor MHWM. The first algorithm calculates the exact $p$-processor MHWM in $O(T_1 \cdot p)$ time, where $T_1$ is the total work of the program. The second algorithm solves, in $O(T_1)$ time, the approximate threshold problem, which asks, for a given memory threshold $M$, whether the $p$-processor MHWM exceeds $M/2$ or whether it is guaranteed to be less than $M$. Both algorithms are memory efficient, requiring $O(p \cdot D)$ and $O(D)$ space, respectively, where $D$ is the maximum call-stack depth of the program's execution on a single thread. Our empirical studies show that Cilkmem generally exhibits low overheads. Across ten application benchmarks from the Cilkbench suite, the exact algorithm incurs a geometric-mean multiplicative overhead of $1.54$ for $p=128$, whereas the approximation-threshold algorithm incurs an overhead of $1.36$ independent of $p$. In addition, we use Cilkmem to reveal and diagnose a previously unknown issue in a large image-alignment program contributing to unexpectedly high memory usage under parallel executions.

cs.DS↗

Dynamic Time Warping in Strongly Subquadratic Time: Algorithms for the Low-Distance Regime and Approximate Evaluation

Dynamic time warping distance (DTW) is a widely used distance measure between time series. The best known algorithms for computing DTW run in near quadratic time, and conditional lower bounds prohibit the existence of significantly faster algorithms. The lower bounds do not prevent a faster algorithm for the special case in which the DTW is small, however. For an arbitrary metric space $Σ$ with distances normalized so that the smallest non-zero distance is one, we present an algorithm which computes $\operatorname{dtw}(x, y)$ for two strings $x$ and $y$ over $Σ$ in time $O(n \cdot \operatorname{dtw}(x, y))$. We also present an approximation algorithm which computes $\operatorname{dtw}(x, y)$ within a factor of $O(n^ε)$ in time $\tilde{O}(n^{2 - ε})$ for $0 < ε< 1$. The algorithm allows for the strings $x$ and $y$ to be taken over an arbitrary well-separated tree metric with logarithmic depth and at most exponential aspect ratio. Extending our techniques further, we also obtain the first approximation algorithm for edit distance to work with characters taken from an arbitrary metric space, providing an $n^ε$-approximation in time $\tilde{O}(n^{2 - ε})$, with high probability. Additionally, we present a simple reduction from computing edit distance to computing DTW. Applying our reduction to a conditional lower bound of Bringmann and Künnemann pertaining to edit distance over $\{0, 1\}$, we obtain a conditional lower bound for computing DTW over a three letter alphabet (with distances of zero and one). This improves on a previous result of Abboud, Backurs, and Williams. With a similar approach, we prove a reduction from computing edit distance to computing longest LCS length. This means that one can recover conditional lower bounds for LCS directly from those for edit distance, which was not previously thought to be the case.

cs.DS↗

Achieving Optimal Backlog in Multi-Processor Cup Games

The single- and multi- processor cup games can be used to model natural problems in areas such as processor scheduling, deamortization, and buffer management. At the beginning of the single-processor cup game, $n$ cups are initially empty. In each step of the game, a filler distributes $1$ unit of water among the cups, and then an emptier selects a cup and removes $1 + ε$ units from that cup. The goal of the emptier is to minimize the amount of water in the fullest cup, also known as the backlog. It is known that the greedy algorithm (i.e., empty the fullest cup) achieves backlog $O(\log n)$, and that no deterministic algorithm can do better. We show that the performance of the greedy algorithm can be greatly improved with a small amount of randomization: After any step $i$, and for any $k \ge Ω(\log ε^{-1})$, the emptier achieves backlog at most $O(k)$ with probability at least $1 -O(2^{-2^k})$. Whereas bounds for the single-processor cup game have been known for more than fifteen years, proving nontrivial bounds on backlog for the multi-processor extension has remained open. We present a simple analysis of the greedy algorithm for the multi-processor cup game, establishing a backlog of $O(ε^{-1} \log n)$, as long as $δ$, the game's other speed-augmentation constant, is at least $1/poly(n)$. Turning to randomized algorithms, we encounter an unexpected phenomenon: When the number of processors $p$ is large, the backlog after each step drops to \emph{constant} with large probability. Specifically, we show that if $δ$ and $ε$ satisfy reasonable constraints, then there exists an algorithm that bounds the backlog after a given step by three or less with probability at least $1 - O(\exp(-Ω(ε^2 p))$. We further extend the guarantees of our randomized algorithm to consider larger backlogs.

cs.DS↗

The One-Way Communication Complexity of Dynamic Time Warping Distance

We resolve the randomized one-way communication complexity of Dynamic Time Warping (DTW) distance. We show that there is an efficient one-way communication protocol using $\widetilde{O}(n/α)$ bits for the problem of computing an $α$-approximation for DTW between strings $x$ and $y$ of length $n$, and we prove a lower bound of $Ω(n / α)$ bits for the same problem. Our communication protocol works for strings over an arbitrary metric of polynomial size and aspect ratio, and we optimize the logarithmic factors depending on properties of the underlying metric, such as when the points are low-dimensional integer vectors equipped with various metrics or have bounded doubling dimension. We also consider linear sketches of DTW, showing that such sketches must have size $Ω(n)$.

cs.DS↗

Efficiently Approximating Edit Distance Between Pseudorandom Strings

We present an algorithm for approximating the edit distance $\operatorname{ed}(x, y)$ between two strings $x$ and $y$ in time parameterized by the degree to which one of the strings $x$ satisfies a natural pseudorandomness property. The pseudorandomness model is asymmetric in that no requirements are placed on the second string $y$, which may be constructed by an adversary with full knowledge of $x$. We say that $x$ is \emph{$(p, B)$-pseudorandom} if all pairs $a$ and $b$ of disjoint $B$-letter substrings of $x$ satisfy $\operatorname{ed}(a, b) \ge pB$. Given parameters $p$ and $B$, our algorithm computes the edit distance between a $(p, B)$-pseudorandom string $x$ and an arbitrary string $y$ within a factor of $O(1/p)$ in time $\tilde{O}(nB)$, with high probability. Our algorithm is robust in the sense that it can handle a small portion of $x$ being adversarial (i.e., not satisfying the pseudorandomness property). In this case, the algorithm incurs an additive approximation error proportional to the fraction of $x$ which behaves maliciously. The asymmetry of our pseudorandomness model has particular appeal for the case where $x$ is a \emph{source string}, meaning that $\operatorname{ed}(x, y)$ will be computed for many strings $y$. Suppose that one wishes to achieve an $O(α)$-approximation for each $\operatorname{ed}(x, y)$ computation, and that $B$ is the smallest block-size for which the string $x$ is $(1/α, B)$-pseudorandom. We show that without knowing $B$ beforehand, $x$ may be preprocessed in time $\tilde{O}(n^{1.5}\sqrt{B})$, so that all future computations of the form $\operatorname{ed}(x, y)$ may be $O(α)$-approximated in time $\tilde{O}(nB)$. Furthermore, for the special case where only a single $\operatorname{ed}(x, y)$ computation will be performed, we show how to achieve an $O(α)$-approximation in time $\tilde{O}(n^{4/3}B^{2/3})$.

cs.DS↗

On Estimating Edit Distance: Alignment, Dimension Reduction, and Embeddings

Edit distance is a fundamental measure of distance between strings and has been widely studied in computer science. While the problem of estimating edit distance has been studied extensively, the equally important question of actually producing an alignment (i.e., the sequence of edits) has received far less attention. Somewhat surprisingly, we show that any algorithm to estimate edit distance can be used in a black-box fashion to produce an approximate alignment of strings, with modest loss in approximation factor and small loss in run time. Plugging in the result of Andoni, Krauthgamer, and Onak, we obtain an alignment that is a $(\log n)^{O(1/\varepsilon^2)}$ approximation in time $\tilde{O}(n^{1 + \varepsilon})$. Closely related to the study of approximation algorithms is the study of metric embeddings for edit distance. We show that min-hash techniques can be useful in designing edit distance embeddings through three results: (1) An embedding from Ulam distance (edit distance over permutations) to Hamming space that matches the best known distortion of $O(\log n)$ and also implicitly encodes a sequence of edits between the strings; (2) In the case where the edit distance between the input strings is known to have an upper bound $K$, we show that embeddings of edit distance into Hamming space with distortion $f(n)$ can be modified in a black-box fashion to give distortion $O(f(\operatorname{poly}(K)))$ for a class of periodic-free strings; (3) A randomized dimension-reduction map with contraction $c$ and asymptotically optimal expected distortion $O(c)$, improving on the previous $\tilde{O}(c^{1 + 2 / \log \log \log n})$ distortion result of Batu, Ergun, and Sahinalp.

cs.DS↗

Equivalence Classes in $S_n$ for Three Families of Pattern-Replacement Relations

We study a family of equivalence relations on $S_n$, the group of permutations on $n$ letters, created in a manner similar to that of the Knuth relation and the forgotten relation. For our purposes, two permutations are in the same equivalence class if one can be reached from the other through a series of pattern-replacements using patterns whose order permutations are in the same part of a predetermined partition of $S_c$. In particular, we are interested in the number of classes created in $S_n$ by each relation and in characterizing these classes. Imposing the condition that the partition of $S_c$ has one nontrivial part containing the cyclic shifts of a single permutation, we find enumerations for the number of nontrivial classes. When the permutation is the identity, we are able to compare the sizes of these classes and connect parts of the problem to Young tableaux and Catalan lattice paths. Imposing the condition that the partition has one nontrivial part containing all of the permutations in $S_c$ beginning with 1, we both enumerate and characterize the classes in $S_n$. We do the same for the partition that has two nontrivial parts, one containing all of the permutations in $S_c$ beginning with 1, and one containing all of the permutations in $S_c$ ending with 1.

math.CO↗

Fast Algorithms for Finding Pattern Avoiders and Counting Pattern Occurrences in Permutations

Given a set $Π$ of permutation patterns of length at most $k$, we present an algorithm for building $S_{\le n}(Π)$, the set of permutations of length at most $n$ avoiding the patterns in $Π$, in time $O(|S_{\le n - 1}(Π)| \cdot k + |S_{n}(Π)|)$. Additionally, we present an $O(n!k)$-time algorithm for counting the number of copies of patterns from $Π$ in each permutation in $S_n$. Surprisingly, when $|Π| = 1$, this runtime can be improved to $O(n!)$, spending only constant time per permutation. Whereas the previous best algorithms, based on generate-and-check, take exponential time per permutation analyzed, all of our algorithms take time at most polynomial per outputted permutation. If we want to solve only the enumerative variant of each problem, computing $|S_{\le n}(Π)|$ or tallying permutations according to $Π$-patterns, rather than to store information about every permutation, then all of our algorithms can be implemented in $O(n^{k+1}k)$ space. Using our algorithms, we generated $|S_5(Π)|, \ldots, |S_{16}(Π)|$ for each $Π\subseteq S_4$ with $|Π| > 4$, and analyzed OEIS matches. We obtained a number of potentially novel pattern-avoidance conjectures. Our algorithms extend to considering permutations in any set closed under standardization of subsequences. Our algorithms also partially adapt to considering vincular patterns.

cs.DM↗

Signed Enumeration of Upper-Right Corners in Path Shuffles

We resolve a conjecture of Albert and Bousquet-Melou enumerating quarter-plane walks with fixed horizontal and vertical projections according to their upper-right-corner count modulo 2. In doing this, we introduce a signed upper-right-corner count statistic. We find its distribution over planar walks with any choice of fixed horizontal and vertical projections. Additionally, we prove that the polynomial counting loops with a fixed horizontal and vertical projection according to the absolute value of their signed upper-right-corner count is $(x+1)$-positive. Finally, we conjecture an equivalence between $(x+1)$-positivity of the generating function for upper-right-corner count and signed upper-right-corner count.

math.CO↗

Fast Concurrent Cuckoo Kick-Out Eviction Schemes for High-Density Tables

Cuckoo hashing guarantees constant-time lookups regardless of table density, making it a viable candidate for high-density tables. Cuckoo hashing insertions perform poorly at high table densities, however. In this paper, we mitigate this problem through the introduction of novel kick-out eviction algorithms. Experimentally, our algorithms reduce the number of bins viewed per insertion for high-density tables by as much as a factor of ten. We also introduce an optimistic concurrency scheme for transactional multi-writer cuckoo hash tables (not using hardware transactional memory). For delete-light workloads, one of our kick-out algorithms avoids all competition between insertions with high probability, and significantly reduces transaction-abort frequency. This result is extended to arbitrary workloads using a new synchronization mechanism called a claim flag.

cs.DS↗

A New Approach to Enumerating Statistics Modulo $n$

We find a new approach to computing the remainder of a polynomial modulo $x^n-1$; such a computation is called modular enumeration. Given a polynomial with coefficients from a commutative $\mathbb{Q}$-algebra, our first main result constructs the remainder simply from the coefficients of residues of the polynomial modulo $Φ_d(x)$ for each $d\mid n$. Since such residues can often be found to have nice values, this simplifies a number of modular enumeration problems; indeed in some cases, such residues are already known while the related modular enumeration problem has remained unsolved. We list six such cases which our technique makes easy to solve. Our second main result is a formula for the unique polynomial $a$ such that $a \equiv f \mod Φ_n(x)$ and $a\equiv 0 \mod x^d-1$ for each proper divisor $d$ of $n$. We find a formula for remainders of $q$-multinomial coefficients and for remainders of $q$-Catalan numbers modulo $q^n-1$, reducing each problem to a finite number of cases for any fixed $n$. In the prior case, we solve an open problem posed by Hartke and Radcliffe. In considering $q$-Catalan numbers modulo $q^n-1$, we discover a cyclic group operation on certain lattice paths which behaves predictably with regard to major index. We also make progress on a problem in modular enumeration on subset sums posed by Kitchloo and Pachter.

math.CO↗

Counting Permutations Modulo Pattern-Replacement Equivalences for Three-Letter Patterns

We study a family of equivalence relations on $S_n$, the group of permutations on $n$ letters, created in a manner similar to that of the Knuth relation and the forgotten relation. For our purposes, two permutations are in the same equivalence class if one can be reached from the other through a series of pattern-replacements using patterns whose order permutations are in the same part of a predetermined partition of $S_c$. When the partition is of $S_3$ and has one nontrivial part and that part is of size greater than two, we provide formulas for the number of classes created in each previously unsolved case. When the partition is of $S_3$ and has two nontrivial parts, each of size two (as do the Knuth and forgotten relations), we enumerate the classes for $13$ of the $14$ unresolved cases. In two of these cases, enumerations arise which are the same as those yielded by the Knuth and forgotten relations. The reasons for this phenomenon are still largely a mystery.

math.CO↗

New Results on Doubly Adjacent Pattern-Replacement Equivalences

In this paper, we consider the family of pattern-replacement equivalence relations referred to as the "indices and values adjacent" case. Each such equivalence is determined by a partition $P$ of a subset of $S_c$ for some $c$. In 2010, Linton, Propp, Roby, and West posed a number of open problems in the area of pattern-replacement equivalences. Five, in particular, have remained unsolved until now, the enumeration of equivalence classes under the $\{123, 132\}$-equivalence, under the $\{123, 321\}$-equivalence, under the $\{123, 132, 213\}$ equivalence, and under the $\{123, 132, 213, 321\}$-equivalence. We find formulas for three of the five equivalences and systems of representatives for the equivalence classes of the other two. We generalize our results to hold for all replacement partitions of $S_3$, as well as for an infinite family of other replacement partitions. In addition, we characterize the equivalence classes in $S_n$ under the $S_c$-equivalence, finding a generalization of Stanley's results on the $\{12, 21\}$-equivalence. To do this, we introduce a notion of confluence that often allows one to find a representative element in each equivalence class under a given equivalence relation. Using an inclusion-exclusion argument, we are able to use this to count the equivalence classes under equivalence relations satisfying certain conditions.

math.CO↗

Lower central series of a free associative algebra over the integers and finite fields

Consider the free algebra A_n generated over Q by n generators x_1, ..., x_n. Interesting objects attached to A = A_n are members of its lower central series, L_i = L_i(A), defined inductively by L_1 = A, L_{i+1} = [A,L_{i}], and their associated graded components B_i = B_i(A) defined as B_i=L_i/L_{i+1}. These quotients B_i, for i at least 2, as well as the reduced quotient \bar{B}_1=A/(L_2+A L_3), exhibit a rich geometric structure, as shown by Feigin and Shoikhet and later authors, (Dobrovolska-Kim-Ma,Dobrovolska-Etingof,Arbesfeld-Jordan,Bapat-Jordan). We study the same problem over the integers Z and finite fields F_p. New phenomena arise, namely, torsion in B_i over Z, and jumps in dimension over F_p. We describe the torsion in the reduced quotient RB_1 and B_2 geometrically in terms of the De Rham cohomology of Z^n. As a corollary we obtain a complete description of \bar{B}_1(A_n(Z)) and \bar{B}_1(A_n(F_p)), as well as of B_2(A_n(Z[1/2])) and B_2(A_n(F_p)), p>2. We also give theoretical and experimental results for B_i with i>2, formulating a number of conjectures and questions based on them. Finally, we discuss the supercase, when some of the generators are odd (fermionic) and some are even (bosonic), and provide some theoretical results and experimental data in this case.

math.RA↗