## Abstract

Let Substrk(X) denote the set of length-k substrings of a given string X for a given integer k > 0. We study the following basic string problem, called z-Shortest Sk-Equivalent Strings: Given a set Sk of n length-k strings and an integer z > 0, list z shortest distinct strings T1,..., Tz such that Substrk(Ti) = Sk, for all i ∈ [1, z]. The z-Shortest Sk-Equivalent Strings problem arises naturally as an encoding problem in many real-world applications; e.g., in data privacy, in data compression, and in bioinformatics. The 1-Shortest Sk-Equivalent Strings, referred to as Shortest Sk-Equivalent String, asks for a shortest string X such that Substrk(X) = Sk. Our main contributions are summarized below: Given a directed graph G(V, E), the Directed Chinese Postman (DCP) problem asks for a shortest closed walk that visits every edge of G at least once. DCP can be solved in Õ(|E||V |) time using an algorithm for min-cost flow. We show, via a non-trivial reduction, that if Shortest Sk-Equivalent String over a binary alphabet has a near-linear-time solution then so does DCP. We show that the length of a shortest string output by Shortest Sk-Equivalent String is in O(k + n^{2}). We generalize this bound by showing that the total length of z shortest strings is in O(zk + zn^{2} + z^{2}n). We derive these upper bounds by showing (asymptotically tight) bounds on the total length of z shortest Eulerian walks in general directed graphs. We present an algorithm for solving z-Shortest Sk-Equivalent Strings in O(nk + n^{2} log^{2} n + zn^{2} log n + |output|) time. If z = 1, the time becomes O(nk + n^{2} log^{2} n) by the fact that the size of the input is Θ(nk) and the size of the output is O(k + n^{2}).

Original language | English |
---|---|

Title of host publication | 33rd Annual Symposium on Combinatorial Pattern Matching, CPM 2022 |

Editors | Hideo Bannai, Jan Holub |

Publisher | Schloss Dagstuhl- Leibniz-Zentrum fur Informatik GmbH, Dagstuhl Publishing |

ISBN (Electronic) | 9783959772341 |

DOIs | |

Publication status | Published - 1 Jun 2022 |

Event | 33rd Annual Symposium on Combinatorial Pattern Matching, CPM 2022 - Prague, Czech Republic Duration: 27 Jun 2022 → 29 Jun 2022 |

### Publication series

Name | Leibniz International Proceedings in Informatics, LIPIcs |
---|---|

Volume | 223 |

ISSN (Print) | 1868-8969 |

### Conference

Conference | 33rd Annual Symposium on Combinatorial Pattern Matching, CPM 2022 |
---|---|

Country/Territory | Czech Republic |

City | Prague |

Period | 27/06/2022 → 29/06/2022 |

## Keywords

- Chinese Postman
- combinatorics on words
- de Bruijn graph
- string algorithms