4,599 research outputs found

    Smooth heaps and a dual view of self-adjusting data structures

    Full text link
    We present a new connection between self-adjusting binary search trees (BSTs) and heaps, two fundamental, extensively studied, and practically relevant families of data structures. Roughly speaking, we map an arbitrary heap algorithm within a natural model, to a corresponding BST algorithm with the same cost on a dual sequence of operations (i.e. the same sequence with the roles of time and key-space switched). This is the first general transformation between the two families of data structures. There is a rich theory of dynamic optimality for BSTs (i.e. the theory of competitiveness between BST algorithms). The lack of an analogous theory for heaps has been noted in the literature. Through our connection, we transfer all instance-specific lower bounds known for BSTs to a general model of heaps, initiating a theory of dynamic optimality for heaps. On the algorithmic side, we obtain a new, simple and efficient heap algorithm, which we call the smooth heap. We show the smooth heap to be the heap-counterpart of Greedy, the BST algorithm with the strongest proven and conjectured properties from the literature, widely believed to be instance-optimal. Assuming the optimality of Greedy, the smooth heap is also optimal within our model of heap algorithms. As corollaries of results known for Greedy, we obtain instance-specific upper bounds for the smooth heap, with applications in adaptive sorting. Intriguingly, the smooth heap, although derived from a non-practical BST algorithm, is simple and easy to implement (e.g. it stores no auxiliary data besides the keys and tree pointers). It can be seen as a variation on the popular pairing heap data structure, extending it with a "power-of-two-choices" type of heuristic.Comment: Presented at STOC 2018, light revision, additional figure

    Carbon and nutrient losses during manure storage under traditional and improved practices in smallholder crop-livestock systems - evidence from Kenya

    Get PDF
    In the absence of mineral fertiliser, animal manure may be the only nutrient resource available to smallholder farmers in Africa, and manure is often the main input of C to the soil when crop residues are removed from the fields. Assessments of C and nutrient balances and cycling within agroecosystems or of greenhouse gas emissions often assume average C and nutrient mass fractions in manure, disregarding the impact that manure storage may have on C and nutrient losses from the system. To quantify such losses, in order to refine our models of C and nutrient cycling in smallholder (crop-livestock) farming systems, an experiment was conducted reproducing farmers’ practices: heaps vs. pits of a mix of cattle manure and maize stover (2:3 v/v) stored in the open air during 6 months. Heaps stored under a simple roof were also evaluated as an affordable improvement of the storage conditions. The results were used to derive empirical models and graphs for the estimation of C and nutrient losses. Heaps and pits were turned every month, weighed, and sampled to determine organic matter, total and mineral N, P and K mass fractions. Soils beneath heaps/pits were sampled to measure mineral N to a depth of 1 m, and leaching tube tests in the laboratory were used to estimate P leaching from manure. After 6 months, ca. 70% remained of the initial dry mass of manure stored in pits, but only half of or less of the manure stored in heaps. The stored manure lost 45% of its C in the open air and 69% under roof. The efficiencies of nutrient retention during storage varied between 24–38% for total N, 34–38% for P and 18–34% for K, with the heaps under a roof having greater efficiencies of retention of N and K. Laboratory tests indicated that up to 25% of the P contained in fresh manure could be lost by leaching. Results suggest that reducing the period of storage by, for example, more frequent application and incorporation of manure into the soil may have a larger impact on retaining C and nutrient within the farm system than improving storage condition

    Decrypting The Java Gene Pool: Predicting Objects' Lifetimes with Micro-patterns

    Get PDF
    Pretenuring long-lived and immortal objects into infrequently or never collected regions reduces garbage collection costs significantly. However, extant approaches either require computationally expensive, application-specific, off-line profiling, or consider only allocation sites common to all programs, i.e. invoked by the virtual machine rather than application programs. In contrast, we show how a simple program analysis, combined with an object lifetime knowledge bank, can be exploited to match both runtime system and application program structure with object lifetimes. The complexity of the analysis is linear in the size of the program, so need not be run ahead of time. We obtain performance gains between 6-77% in GC time against a generational copying collector for several SPEC jvm98 programs

    Q-systems, Heaps, Paths and Cluster Positivity

    Full text link
    We consider the cluster algebra associated to the QQ-system for ArA_r as a tool for relating QQ-system solutions to all possible sets of initial data. We show that the conserved quantities of the QQ-system are partition functions for hard particles on particular target graphs with weights, which are determined by the choice of initial data. This allows us to interpret the simplest solutions of the Q-system as generating functions for Viennot's heaps on these target graphs, and equivalently as generating functions of weighted paths on suitable dual target graphs. The generating functions take the form of finite continued fractions. In this setting, the cluster mutations correspond to local rearrangements of the fractions which leave their final value unchanged. Finally, the general solutions of the QQ-system are interpreted as partition functions for strongly non-intersecting families of lattice paths on target lattices. This expresses all cluster variables as manifestly positive Laurent polynomials of any initial data, thus proving the cluster positivity conjecture for the ArA_r QQ-system. We also give an alternative formulation in terms of domino tilings of deformed Aztec diamonds with defects.Comment: 106 pages, 38 figure

    Engineering Fused Lasso Solvers on Trees

    Get PDF
    The graph fused lasso optimization problem seeks, for a given input signal y=(y_i) on nodes i? V of a graph G=(V,E), a reconstructed signal x=(x_i) that is both element-wise close to y in quadratic error and also has bounded total variation (sum of absolute differences across edges), thereby favoring regionally constant solutions. An important application is denoising of spatially correlated data, especially for medical images. Currently, fused lasso solvers for general graph input reduce the problem to an iteration over a series of "one-dimensional" problems (on paths or line graphs), which can be solved in linear time. Recently, a direct fused lasso algorithm for tree graphs has been presented, but no implementation of it appears to be available. We here present a simplified exact algorithm and additionally a fast approximation scheme for trees, together with engineered implementations for both. We empirically evaluate their performance on different kinds of trees with distinct degree distributions (simulated trees; spanning trees of road networks, grid graphs of images, social networks). The exact algorithm is very efficient on trees with low node degrees, which covers many naturally arising graphs, while the approximation scheme can perform better on trees with several higher-degree nodes when limiting the desired accuracy to values that are useful in practice
    • 

    corecore