82 research outputs found

    Optimal Union-Find in Constraint Handling Rules

    Full text link
    Constraint Handling Rules (CHR) is a committed-choice rule-based language that was originally intended for writing constraint solvers. In this paper we show that it is also possible to write the classic union-find algorithm and variants in CHR. The programs neither compromise in declarativeness nor efficiency. We study the time complexity of our programs: they match the almost-linear complexity of the best known imperative implementations. This fact is illustrated with experimental results.Comment: 12 pages, 3 figures, to appear in Theory and Practice of Logic Programming (TPLP

    Faster Longest Common Extension Queries in Strings over General Alphabets

    Get PDF
    Longest common extension queries (often called longest common prefix queries) constitute a fundamental building block in multiple string algorithms, for example computing runs and approximate pattern matching. We show that a sequence of qq LCE queries for a string of size nn over a general ordered alphabet can be realized in O(qloglogn+nlogn)O(q \log \log n+n\log^*n) time making only O(q+n)O(q+n) symbol comparisons. Consequently, all runs in a string over a general ordered alphabet can be computed in O(nloglogn)O(n \log \log n) time making O(n)O(n) symbol comparisons. Our results improve upon a solution by Kosolobov (Information Processing Letters, 2016), who gave an algorithm with O(nlog2/3n)O(n \log^{2/3} n) running time and conjectured that O(n)O(n) time is possible. We make a significant progress towards resolving this conjecture. Our techniques extend to the case of general unordered alphabets, when the time increases to O(qlogn+nlogn)O(q\log n + n\log^*n). The main tools are difference covers and the disjoint-sets data structure.Comment: Accepted to CPM 201

    PACE Solver Description: Sallow: A Heuristic Algorithm for Treedepth Decompositions

    Get PDF
    We describe a heuristic algorithm for computing treedepth decompositions, submitted for the https://pacechallenge.org/2020 challenge. It relies on a variety of greedy algorithms computing elimination orderings, as well as a Divide & Conquer approach on balanced cuts obtained using a from-scratch reimplementation of the 2016 FlowCutter algorithm by Hamann & Strasser [Michael Hamann and Ben Strasser, 2018]

    Sources of Superlinearity in Davenport-Schinzel Sequences

    Get PDF
    A generalized Davenport-Schinzel sequence is one over a finite alphabet that contains no subsequences isomorphic to a fixed forbidden subsequence. One of the fundamental problems in this area is bounding (asymptotically) the maximum length of such sequences. Following Klazar, let Ex(\sigma,n) be the maximum length of a sequence over an alphabet of size n avoiding subsequences isomorphic to \sigma. It has been proved that for every \sigma, Ex(\sigma,n) is either linear or very close to linear; in particular it is O(n 2^{\alpha(n)^{O(1)}}), where \alpha is the inverse-Ackermann function and O(1) depends on \sigma. However, very little is known about the properties of \sigma that induce superlinearity of \Ex(\sigma,n). In this paper we exhibit an infinite family of independent superlinear forbidden subsequences. To be specific, we show that there are 17 prototypical superlinear forbidden subsequences, some of which can be made arbitrarily long through a simple padding operation. Perhaps the most novel part of our constructions is a new succinct code for representing superlinear forbidden subsequences

    Incremental 22-Edge-Connectivity in Directed Graphs

    Get PDF
    In this paper, we initiate the study of the dynamic maintenance of 22-edge-connectivity relationships in directed graphs. We present an algorithm that can update the 22-edge-connected blocks of a directed graph with nn vertices through a sequence of mm edge insertions in a total of O(mn)O(mn) time. After each insertion, we can answer the following queries in asymptotically optimal time: (i) Test in constant time if two query vertices vv and ww are 22-edge-connected. Moreover, if vv and ww are not 22-edge-connected, we can produce in constant time a "witness" of this property, by exhibiting an edge that is contained in all paths from vv to ww or in all paths from ww to vv. (ii) Report in O(n)O(n) time all the 22-edge-connected blocks of GG. To the best of our knowledge, this is the first dynamic algorithm for 22-connectivity problems on directed graphs, and it matches the best known bounds for simpler problems, such as incremental transitive closure.Comment: Full version of paper presented at ICALP 201
    corecore