
In this paper, we provide a novel enumeration algorithm for the set of all walks of a given length within a directed graph. Our algorithm has worst-case constant delay between outputting succinct representations of such walks, after a preprocessing step requiring linear time relative to the size of the graph. We apply these results to the problem of enumerating succinct representations of the strings of a given length from a prefix-closed regular language (languages accepted by a finite automaton which has final states only).
A slab in d-dimensional space R d is the set of points enclosed by two parallel hyperplanes. We consider the problem of finding an optimal pair of parallel slabs, called a double-slab, that covers a given set P of n points in R d. We address two optimization problems in R d for any fixed dimension d ⩾ 3: the minimum-width double-slab problem, in which one wants to minimize the maximum width of the two slabs of the resulting double-slab, and the widest empty slab problem, in which one wants to maximize the gap between the two slabs. Our results include the first nontrivial exact algorithms that solve the former problem for d ⩾ 3 and the latter problem for d ⩾ 4.
Most algorithmic strategies for solving problems considering treewidth parameterization require that a tree decomposition is given. Given a graph G=(V,E) and denoting by 𝒞_𝒢 the family of chordal graphs (triangulations) G' such that V(G)=V(G') and E(G)⊆ E(G') , the treewidth of a graph G can be defined alternatively as the size of the smallest maximum clique of a graph in 𝒞_𝒢 , minus one. In addition, any tree decomposition 𝒯 of a graph G'∈𝒞_𝒢 is also a tree decomposition of G. In this paper, we are interested in the main subproblem to be solved by the most popular heuristics for treewidth computation, called Tree Decomposition Decoding. In such a problem, we are given a graph G=(V, E) and a permutation ρ of V(G) and asked to determine the width of the tree decomposition 𝒯 of G that is an optimum tree decomposition of the minimal triangulation G'∈𝒞_𝒢 having ρ as perfect elimination ordering. From (G,ρ ) , it is easy to find the solution to the problem by first constructing the triangulation G' arising from ρ . However, in the worst case, such constructions of G' require (|V(G)|^2) space. In this work, we propose two algorithms for solving the problem; both avoid the construction of triangulations G' . The first performers in 𝒪(|V(G)|·ℓ ) space and 𝒪(|V(G)|^2·ℓ ) time, where ℓ is the number of leaves of the tree decomposition encoded by ρ . The second is faster in practice and achieves a different trade-off, solving the problem within 𝒪(|E(G)| + |V(G)|) space and 𝒪(|E(G)|·log |V(G)|) time.
We present a mathematical setting for attack-defense trees, a classic graphical model to specify attacks and countermeasures. We equip attack-defense trees with (trace) language semantics allowing to have an original dynamic interpretation of countermeasures. Interestingly, the expressiveness of attack-defense trees coincides with star-free languages, and the nested countermeasures impact the expressiveness of attack-defense trees. With an adequate notion of countermeasure-depth, we exhibit a strict hierarchy of the star-free languages that does not coincides with the classic one. Additionally, driven by the use of attack-defense trees in practice, we address the decision problems of trace membership and of non-emptiness, and study their computational complexities parameterized by the countermeasure-depth.
A vertex cover of a graph is a set of vertices of the graph such that every edge has at least one endpoint in it. In this work, we study Weighted Vertex Cover with solution size as a parameter. Formally, in the (k,W) -Vertex Cover problem, given a graph G, an integer k, a positive rational W, and a weight function w:V(G) →ℚ^+ , the question is whether G has a vertex cover of size at most k of weight at most W, with k being the parameter. An (a, b)-bi-criteria approximation algorithm for (k,W) -Vertex Cover either produces a vertex cover S such that |S| ≤ a k and w(S) ≤ b W , or decides that there is no vertex cover of size at most k of weight at most W. We obtain the following results. Our algorithms (expectedly) do not improve upon the running times of the existing algorithms for the unweighted version of Vertex Cover. When compared to algorithms for the weighted version, our algorithms are the first ones to the best of our knowledge which work with arbitrary weights, and they perform well when the solution size is much smaller than the total weight of the desired solution.
Motivated by challenges in pangenomic read alignment, we propose a generalization of Wheeler graphs that we call Wheeler maps. A Wheeler map stores a text $T[1..n]$ and an assignment of tags to the characters of $T$ such that we can preprocess a pattern $P[1..m]$ and then, given $i$ and $j$, quickly return all the distinct tags labeling the first characters of the occurrences of $P[i..j]$ in $T$. For the applications that most interest us, characters with long common contexts are likely to have the same tag, so we consider the number $t$ of runs in the list of tags sorted by their characters' positions in the Burrows-Wheeler Transform (BWT) of $T$. We show how, given a straight-line program with $g$ rules for $T$, we can build an $O(g + r + t)$-space Wheeler map, where $r$ is the number of runs in the BWT of $T$, with which we can preprocess a pattern $P[1..m]$ in $O(m \log n)$ time and then return the $k$ distinct tags for $P[i..j]$ in optimal $O(k)$ time for any given $i$ and $j$. We show various further results related to prioritizing the most frequent tags.
A proper Helly circular-arc graph is an intersection graph of a set of arcs on a circle such that none of the arcs properly contains any other arc and every set of pairwise intersecting arcs has a common intersection. The Proper Helly Circular-arc Vertex Deletion problem takes as input a graph $G$ and an integer $k$, and the goal is to check if we can remove at most $k$ vertices from the graph to obtain a proper Helly circular-arc graph; the parameter is $k$. Recently, Cao et al.~[MFCS 2023] obtained an FPT algorithm for this (and related) problem. In this work, we obtain a polynomial kernel for the problem.
We prove that in any n-vertex complete graph there is a collection 𝒫 of (1 + o(1))n paths that strongly separates any pair of distinct edges e, f, meaning that there is a path in 𝒫 which contains e but not f. Furthermore, for certain classes of n-vertex α n -regular graphs we find a collection of (√(3 α + 1) - 1 + o(1))n paths that strongly separates any pair of edges. Both results are best-possible up to the o(1) term.
In the recent 30 years, Schnyder woods have become an invaluable asset in the study of planar graphs. We contribute to this research with a brief and comprehensible proof of a new structural feature: every Schnyder wood of a 3-connected planar graph on n vertices has a tree of depth at least ⌊ 1/6 log _2 n⌋ . As a simple implication, our result improves the previous hard-won lower bound on the length of an induced path in such a graph to 1/6 log _2 n .
In this paper, we study the graph induced by the $\textit{2-swap}$ permutation on words with a fixed Parikh vector. A $2$-swap is defined as a pair of positions $s = (i, j)$ where the word $w$ induced by the swap $s$ on $v$ is $v[1] v[2] \dots v[i - 1] v[j] v[i+1] \dots v[j - 1] v[i] v[j + 1] \dots v[n]$. With these permutations, we define the $\textit{Configuration Graph}$, $G(P)$ defined over a given Parikh vector. Each vertex in $G(P)$ corresponds to a unique word with the Parikh vector $P$, with an edge between any pair of words $v$ and $w$ if there exists a swap $s$ such that $v \circ s = w$. We provide several key combinatorial properties of this graph, including the exact diameter of this graph, the clique number of the graph, and the relationships between subgraphs within this graph. Additionally, we show that for every vertex in the graph, there exists a Hamiltonian path starting at this vertex. Finally, we provide an algorithm enumerating these paths from a given input word of length $n$ with a delay of at most $O(\log n)$ between outputting edges, requiring $O(n \log n)$ preprocessing.
We give algorithms that, given a straight-line program (SLP) with g rules that generates (only) a text T[1..n], build within O(g) space the Lempel-Ziv (LZ) parse of T (of z phrases) in time O(nlog ^2 n) or in time O(gzlog ^2(n/z)) . We also show how to build a locally consistent grammar (LCG) of optimal size g_lc = O(δlogn/δ) from the SLP within O(g+g_lc) space and in O(nlog g) time, where δ is the substring complexity measure of T. Finally, we show how to build the LZ parse of T from such an LCG within O(g_lc) space and in time O(zlog ^2 n log ^2(n/z)) . All our results hold with high probability.
We explore an extension to straight-line programs (SLPs) that outperforms, for some text families, the measure δ based on substring complexity, a lower bound for most measures and compressors exploiting repetitiveness (which are crucial in areas like Bioinformatics). The extension, called iterated SLPs (ISLPs), allows rules of the form A → _i=k_1^k_2 B_1^i^c_1⋯ B_t^i^c_t , for which we show how to extract any substring of length λ , from the represented text T[1. .n] , in time O(λ + log ^2 nloglog n) . This is the first compressed representation for repetitive texts breaking δ while, at the same time, supporting direct access to arbitrary text symbols in polylogarithmic time. As a byproduct, we extend Ganardi et al.’s technique to balance any SLP (so it has a derivation tree of logarithmic height) to a wide generalization of SLPs, including ISLPs.
Given an ordinal tree T on n nodes in which each node is assigned a color from {0,1,… ,C-1} , an approximate colored path counting query asks for an approximation of the number, , of distinct colors assigned to nodes in a query path. We first present data structures that can compute a 2-approximate answer, i.e., a number in [, 2] , and achieve three different time/space trade-offs: i) an O(n)-word structure with O( ^λ n) query time for any constant 0<λ <1 , ii) an O(n n) -word structure with O( n) query time and iii) an O(n ^λ n) -word structure with O(1) query time. The first trade-off beats the O( n/ n) query time of the linear-word 2-approximate structure in previous work. We then design an O(n)-word structure which can compute in O(ϵ ^-2 n) time a (1±ϵ ) -approximate answer, i.e, a number in [(1-ϵ ), (1+ϵ ) ] , for any ϵ∈ (0,1) . Previously, when the space cost is O(n) words, the only known solution computes a (1±ϵ ) -approximate answer in O(ϵ ^-4 ^2 n) time with success probability no less than 1-δ , where δ is an arbitrary constant in (0, 1); our solution not only has faster query time but also always returns a (1±ϵ ) -approximation. When designing (1±ϵ ) -approximate solutions, our techniques also yield an O(n)-word structure that can answer a colored type-2 path counting query in O() time; this query reports the number of occurrences of each distinct color in a query path. This result improves the best previous linear-word solution in which the query time is O( n) .
A binary de Bruijn sequence (dB sequence) of order k is a circular binary string that contains each k-length word exactly once as a substring. Most existing algorithms construct a specific dB sequence, or members of a specific class of dB sequences, representing only a tiny fraction of the complete set. The only algorithms capable of generating all dB sequences are based on finding Euler cycles in de Bruijn graphs. Here, we present an algorithm for constructing random binary dB sequences which uses the extended Burrows-Wheeler Transform. Our method is simple to implement (less than 120 lines of C++ code) and can produce random dB sequences of any order. Even though it does not output dB sequences uniformly at random, it provably outputs each dB sequence with positive probability. The algorithm runs in linear space and near-linear time in the length of the dB sequence and needs less than one second on a laptop computer for orders up to 23, including outputting the sequence. It can be straightforwardly extended to any constant-size alphabet. To the best of our knowledge, this is the first practical algorithm for generating random dB sequences which is capable of producing all dB sequences. Apart from its immediate usefulness in contexts where it is desirable to use a dB sequence that cannot be guessed easily, we also demonstrate our algorithm's potential in theoretical studies, giving hitherto unknown estimates of the average discrepancy of binary dB sequences. The code is available (in C++ and python) at https://github.com/lucaparmigiani/rnd_dbseq .
Sparse suffix sorting is the problem of sorting $b=o(n)$ suffixes of a string of length $n$. Efficient sparse suffix sorting algorithms have existed for more than a decade. Despite the multitude of works and their justified claims for applications in text indexing, the existing algorithms have not been employed by practitioners. Arguably this is because there are no simple, direct, and efficient algorithms for sparse suffix array construction. We provide two new algorithms for constructing the sparse suffix and LCP arrays that are simultaneously simple, direct, small, and fast. In particular, our algorithms are: simple in the sense that they can be implemented using only basic data structures; direct in the sense that the output arrays are not a byproduct of constructing the sparse suffix tree or an LCE data structure; fast in the sense that they run in $\mathcal{O}(n\log b)$ time, in the worst case, or in $\mathcal{O}(n)$ time, when the total number of suffixes with an LCP value greater than $2^{\lfloor \log \frac{n}{b} \rfloor + 1}-1$ is in $\mathcal{O}(b/\log b)$, matching the time of the optimal yet much more complicated algorithms [Gawrychowski and Kociumaka, SODA 2017; Birenzwige et al., SODA 2020]; and small in the sense that they can be implemented using only $8b+o(b)$ machine words. Our algorithms are simplified, yet non-trivial, space-efficient adaptations of the Monte Carlo algorithm by I et al. for constructing the sparse suffix tree in $\mathcal{O}(n\log b)$ time [STACS 2014]. We also provide proof-of-concept experiments to justify our claims on simplicity and efficiency.
We study the Art Gallery Problem under k-hop visibility in polyominoes. In this visibility model, two unit squares of a polyomino can see each other if and only if the shortest path between the respective vertices in the dual graph of the polyomino has length at most k. In this paper, we show that the VC dimension of this problem is 3 in simple polyominoes, and 4 in polyominoes with holes. Furthermore, we provide a reduction from Planar Monotone 3Sat, thereby showing that the problem is NP-complete even in thin polyominoes (i.e., polyominoes that do not a contain a 2× 2 block of cells). Complementarily, we present a linear-time 4-approximation algorithm for simple 2-thin polyominoes (which do not contain a 3× 3 block of cells) for all k∈ℕ.
We present an algorithm for computing upper bounds for the Online Bin Stretching Problem with a small number of bins and the resulting upper bounds for 4, 5 and 6 bins. This both demonstrates the possibility of using computer search for upper bounds on a fundamentally real-valued online problem and improves upon the best bounds know so far, some of which have remained unchanged since 2001.
In this paper, we construct a winning condition W over a finite set of colors such that, first, every finite arena has a strategy with 2 states of general memory which is optimal w.r.t. W, and second, there exists no k such that every finite arena has a strategy with k states of chromatic memory which is optimal w.r.t. W.
We define and study a new structural parameter for directed graphs, which we call ear anonymity. Our parameter aims to generalize the useful properties of funnels to larger digraph classes. In particular, funnels are exactly the acyclic digraphs with ear anonymity one. We prove that computing the ear anonymity of a digraph is NP-hard and that it can be solved in 𝒪(m(n + m)) -time on acyclic digraphs (where n is the number of vertices and m is the number of arcs in the input digraph). It remains open where exactly in the polynomial hierarchy the problem of computing ear anonymity lies, however for a related problem we manage to show _2^p -completeness.
Minimum sum vertex cover of an n-vertex graph G is a bijection ϕ : V(G) → [n] that minimizes the cost ∑ _{u,v}∈ E(G)min{ϕ (u), ϕ (v) } . Finding a minimum sum vertex cover of a graph (the MSVC problem) is NP-hard. MSVC is studied well in the realm of approximation algorithms. The best-known approximation factor in polynomial time for the problem is 16/9 [Bansal, Batra, Farhadi, and Tetali, SODA 2021]. Recently, Stankovic [APPROX/RANDOM 2022] proved that achieving an approximation ratio better than 1.014 for MSVC is NP-hard, assuming the Unique Games Conjecture. We study the MSVC problem from the perspective of parameterized algorithms. The parameters we consider are the size of a minimum vertex cover and the size of a minimum clique modulator of the input graph. We obtain the following results.