Improved Approximation Ratios for the Shortest Common Superstring Problem with Reverse Complements
Abstract
The Shortest Common Superstring (SCS) problem asks for the shortest string that contains each of a given set of strings as a substring. Its reverse-complement variant, the Shortest Common Superstring problem with Reverse Complements (SCS-RC), naturally arises in bioinformatics applications, where for each input string, either the string itself or its reverse complement must appear as a substring of the superstring. The well-known MGREEDY algorithm for the standard SCS constructs a superstring by first computing an optimal cycle cover on the overlap graph and then concatenating the strings corresponding to the cycles, while its refined variant, TGREEDY, further improves the approximation ratio. Although the original 4- and 3-approximation bounds of these algorithms have been successively improved for the standard SCS, no such progress has been made for the reverse-complement setting. A previous study extended MGREEDY to SCS-RC with a 4-approximation guarantee and briefly suggested that extending TGREEDY to the reverse-complement setting could achieve a 3-approximation. In this work, we strengthen these results by proving that the extensions of MGREEDY and TGREEDY to the reverse-complement setting achieve 3.75- and 2.875-approximation ratios, respectively. Our analysis extends the classical proofs for the standard SCS to handle the bidirectional overlaps introduced by reverse complements. These results provide the first formal improvement of approximation guarantees for SCS-RC, with the 2.875-approximate algorithm currently representing the best known bound for this problem.
Keywords and phrases:
Shortest Common Superstring, Approximation Algorithms, DNA SequencingCopyright and License:
2012 ACM Subject Classification:
Theory of computation Approximation algorithms analysisFunding:
This work was supported by MEXT KAKENHI Grant Numbers 21H05052, 23H03345, and 23K18501.Editors:
Philip Bille and Nicola PrezzaSeries and Publisher:
Leibniz International Proceedings in Informatics, Schloss Dagstuhl – Leibniz-Zentrum für Informatik
1 Introduction
The Shortest Common Superstring (SCS) problem is a classical problem in string algorithms and combinatorial optimization. Given a set of strings, the goal is to find a shortest possible string that contains every string in as a substring. SCS has numerous applications in various fields [7], among which one of the most prominent is DNA sequencing. A DNA molecule consists of four nucleotides (Adenine, Thymine, Guanine, and Cytosine) and is assembled from short sequence reads. This process can be viewed as an instance of the SCS problem over a quaternary alphabet. However, unlike ordinary strings, DNA sequences are double-stranded, and sequencing technologies often produce reads whose orientation is not known, i.e., which of the two DNA-duplex strands they came from [9]. Consequently, for each read, either the read itself or its reverse complement may occur in the original genome. To capture this property, the Shortest Common Superstring problem with Reverse Complements (SCS-RC) extends the classical SCS problem by requiring the superstring to contain, for each input string, either the string or its reverse complement as a substring. This extension provides a more realistic abstraction of genomic sequence reconstruction, yet its algorithmic properties and approximation guarantees have been studied far less extensively than those of the standard SCS problem.
For the standard SCS problem, Blum et al. [2] showed that the GREEDY algorithm, which repeatedly merges two distinct strings with the maximum overlap, is 4-approximate. They also introduced two variants, MGREEDY and TGREEDY, and proved that these achieve 4- and 3-approximation ratios, respectively. Many subsequent works have further improved these approximation ratios [1, 3, 14, 11, 12, 4]. Englert et al. [5] established that the MGREEDY algorithm achieves a guarantee of , and by combining this with the -approximation algorithm for the maximum asymmetric traveling salesman problem [10, 13], they obtained the currently best-known approximation ratio for SCS, .
For the SCS-RC problem, Jiang et al. [8] extended the work of Blum et al. [2] to the reverse-complement setting. They proved that the extension of the MGREEDY algorithm, which we refer to as MGREEDY-RC (shown in Algorithm 1), is a 4-approximate algorithm for SCS-RC. They further noted that the TGREEDY algorithm can be similarly extended (the TGREEDY-RC algorithm shown in Algorithm 3) to achieve a 3-approximation, relying on the fact that the GREEDY-RC algorithm (shown in Algorithm 2) achieves a compression ratio, which was formally proved in [6].
However, no further improvements for SCS-RC have been reported since then, leaving a substantial gap compared to the standard SCS. Our analysis narrows this gap and provides new insights into greedy algorithms under the reverse-complement setting.
Our Contributions
We first establish Theorem 1, which provides a framework analogous to that used in the standard SCS problem [4, 5].
Theorem 1.
If MGREEDY-RC is a -approximation algorithm and there exists an algorithm that achieves a compression ratio of for SCS-RC, then one can construct a -approximation algorithm for SCS-RC. In particular, TGREEDY-RC corresponds to the case within this general framework, which immediately yields a -approximation guarantee.
We extend the work of Kaplan and Shafrir [11] to the reverse-complement setting, improving the approximation guarantee of MGREEDY-RC from 4 to 3.75. The presence of reverse complements prevents the direct application of their method, since it relies on the overlap rotation lemma (stated in Lemma 13), which no longer holds when the rotated string is reverse complemented. This highlights the additional structural challenges of the SCS-RC problem compared with the standard SCS problem. Nevertheless, we manage to adapt part of their improvement by exploiting the properties of reverse complements.
Theorem 2.
MGREEDY-RC is a -approximate algorithm.
Combining Theorem 1 and Theorem 2, we immediately obtain improved guarantees for TGREEDY-RC, tightening its approximation ratio from to , which currently represents the best-known bound for SCS-RC.
Theorem 3.
TGREEDY-RC is a -approximate algorithm.
2 Preliminaries
Over the alphabet , we define the complement mapping by
For a string , its reverse complement is defined as
In other words, is obtained by reversing and then replacing each character with its complement . Let be a set of strings over , and define . Without loss of generality, we assume that is substring-free, i.e., no string in is a substring of another. For a string , we use
to denote either or its reverse complement. We will use this notation consistently throughout the paper. Let us formally define the SCS-RC problem:
Definition 4 (Shortest Common Superstring with Reverse Complements (SCS-RC)).
- Input:
-
A set of strings over an alphabet .
- Output:
-
The shortest string such that for each , either or its reverse complement appears as a substring of .
We call a (not necessarily shortest) string that contains, for each , either or its reverse complement , an approximate solution for the SCS-RC instance .
There are two common ways to measure the quality of approximation algorithms.
Definition 5 (Length ratio and compression ratio).
Let denote the length of the approximate solution for the SCS-RC instance produced by an algorithm , and let denote the length of an optimal solution. We define the length ratio of the algorithm as , and the compression ratio as , where .
Since , we distinguish between two notions of approximation. When , a -approximation refers to the length ratio, and when , it refers to the compression ratio.
For two (not necessarily distinct) strings and , let be the longest string such that and for some nonempty strings and . We call the overlap between and , and denote its length by . For example, if and , then and . The string is called the prefix of with respect to , and is denoted by . We define the distance from to as
For a given sequence of strings , we define
If are substring-free, then this string is a shortest string containing as substrings in this order. As observed in [2], the optimal solution of SCS-RC must have the form for some permutation of .
The distance graph is the weighted complete directed graph constructed from the strings in . The vertex set is , and the edge set is . The weight of each edge is defined as . The overlap graph is defined analogously, except that the weight of each edge is given by . Each path in corresponds to the string . Let be a cycle in . We define the weight of the cycle as , where we set . A cycle cover of is a set of vertex-disjoint cycles such that, for each , exactly one of and is contained in the cycles. A cycle cover of is said to be optimal if it has the minimum total weight among all possible cycle covers. We denote an optimal cycle cover of by , and its total weight by . Since an optimal solution to SCS-RC corresponds to a single cycle that contains exactly one of and for each , it can be viewed as a special case of a cycle cover. Therefore, we have the following inequation
| (1) |
2.1 Greedy algorithms
Jiang et al. [8] introduced a greedy algorithm shown in Algorithm 1, which we refer to as MGREEDY-RC. Strictly speaking, they considered reversals rather than reverse complements, but their formulation and analysis can be adapted directly to our setting by interpreting their as . MGREEDY-RC disallows merging string pairs of the form for , since both (distinct) and need not be included simultaneously. As discussed in [8], the MGREEDY-RC algorithm can be viewed as constructing a cycle cover. When it merges two strings and , this corresponds to selecting an edge between and to create a new path . When it merges and , it first replaces the second path with , and then merges the paths to form . When MGREEDY-RC moves a string from to , it closes the corresponding path into a cycle . These operations together form a cycle cover of , and it has been shown that this cover is optimal.
Lemma 6 ([8]).
MGREEDY-RC creates an optimal cycle cover .
Fici et al. [6] proved that the GREEDY-RC algorithm, given in Algorithm 2, achieves a compression ratio of , and that this bound is tight for the algorithm. As in [8], they actually considered reversals rather than reverse complements, but the same analysis applies when interpreting as .
Lemma 7 ([6]).
GREEDY-RC achieves a compression ratio of .
The TGREEDY-RC algorithm, presented in Algorithm 3, is a refinement of MGREEDY-RC. Rather than concatenating the strings in directly, it merges them by executing GREEDY-RC.
2.2 Periodicity and the overlap rotation lemma
We adopt the notation from [3, 11]. A string is called a factor of a string if for some positive integer and some (possibly empty) prefix of . We denote by the shortest such string , and define the period of as . A semi-infinite string is called periodic if for some nonempty string . In this case, we denote the shortest such by and define .
Let and be strings that are either finite or periodic semi-infinite. We call and equivalent if is a cyclic shift of , i.e., there exist strings and such that and ; otherwise, we call them inequivalent. The following lemmas were proved in [2] and restated in [3].
Lemma 8 ([2]).
Let be a cycle in . Then
Lemma 9 ([2]).
The strings are all equivalent.
Lemma 10 ([2]).
Let and be two distinct cycles in . If is equivalent to Then there exists a third cycle with weight containing all the vertices in and .
Lemma 10 implies that strings taken from distinct cycles in an optimal cycle cover are inequivalent, and this property naturally extends to the reverse-complement setting.
Lemma 11.
Let and be two distinct cycles in . Then the strings and are inequivalent. Moreover, the pairs , , and are also inequivalent.
The following lemma was used to gain a 4-approximate bound in [8].
Lemma 12 ([2]).
If strings and are inequivalent, then .
Given a semi-infinite string , we denote the rotation . Breslauer et al. [3] proved the following overlap rotation lemma.
Lemma 13 (overlap rotation lemma [3]).
Let be a periodic semi-infinite string. There exists an integer , such that for any finite string that is inequivalent to ,
We denote a rotation that satisfies Lemma 13 as the critical rotation. The following lemma, originally proved in [3] and restated in [11], shows that it is possible to extract such a rotation from each cycle in . Property (4) relies on the fact that and are inequivalent, which follows from Property (3) together with Lemmas 9 and 11.
Lemma 14 ([3]).
Let be a cycle in . Then there exist a string and an index such that:
-
(1)
The string is a suffix of .
-
(2)
The string is contained in .
-
(3)
is equivalent to .
-
(4)
The semi-infinite string is the critical rotation of . Specifically, let be the string obtained by this lemma corresponding to a different cycle ; then .
3 Analysis
We begin by proving Theorem 1, which serves as the reverse-complement analogue of Theorem 3.1 in [4]. The argument follows the same ideas as the original proof.
3.1 Proof of Theorem 1
In MGREEDY-RC, we first compute the optimal cycle cover and obtain the set of strings corresponding to its cycles, denoted by (see Algorithm 1). We then observe that the optimal solution to the SCS-RC problem on this set is at most twice as long as the optimal solution to the original instance.
Lemma 15.
.
Proof.
For each cycle in , we select a single representative string . Let denote the set of these representatives, one per cycle. Let be an optimal solution to the SCS-RC problem on . Clearly, .
For each string , either or its reverse complement occurs in . If occurs, we replace one occurrence of it with
Otherwise, we replace with . Note that is both the prefix and the suffix of , and similarly is both the prefix and the suffix of . This ensures that the replacement operation is well-defined and produces a valid superstring.
This replacement increases the length of by , yielding an approximate solution for the SCS-RC instance .
In practice, we do not know the optimal solution for the instance . Instead, we can apply the given -approximation algorithm in terms of the compression ratio. Let denote the length of the solution produced by this -approximation algorithm on the set . By the definition of the compression ratio, we have
where denotes the total length of strings in . Note that is also the length of the superstring produced by MGREEDY-RC. Hence, the -approximation guarantee of MGREEDY implies
Combining these inequalities, we obtain
TGREEDY-RC corresponds to the case where we run GREEDY-RC on the set . From Lemma 7, GREEDY-RC is a -approximation algorithm in terms of compression ratio, that is, .
3.2 Proof of Theorem 2
For each cycle in , the existence of strings and satisfying the properties stated in Lemma 14 is guaranteed. We define
By property (1) of Lemma 14, provides an upper bound on .
Lemma 16.
.
Proof.
Consider a cycle in , and let be the index whose existence is guaranteed by Lemma 14. By property (1) of that lemma, we have
Since MGREEDY-RC greedily merges string pairs with the maximum overlap, the cycle-closing edge from to has the smallest overlap among edges in the cycle. Hence,
The string produced by MGREEDY-RC is , whose length can be computed as
On the other hand, for the rotated sequence starting at index , we have
Since , we conclude that
Summing over all cycles in yields .
From the previous lemma, we have established that . Our next goal is to obtain an upper bound on . To this end, consider the SCS-RC problem on , and let denote the maximal overlap in , defined as
where are the cycles in , ordered according to an optimal superstring for the SCS-RC instance on .
Lemma 17.
.
Proof.
Let . By property (2) of Lemma 14, each contains , which implies .
Let , and select as the representative of the cycle . Let denote the set of these representatives over all cycles .
Let be an optimal solution of SCS-RC for . Clearly, . For each string , either or its reverse complement occurs in . If occurs, replace once occurence of it with the original ; otherwise, replace with . This replacement increases the length of by , yielding an approximate solution for the SCS-RC instance . Hence, . Together with , we obtain .
For each cycle in , we can consider its reverse complement, . For this , there exists a string that satisfies the properties stated in Lemma 14. However, since and may differ, we cannot directly derive the upper bound from Lemmas 13 and 14.
Therefore, when the reverse complement appears in the optimal solution, we must apply Lemma 12 instead of Lemma 13. The key observation is that, by also considering the reverse complement of the entire optimal superstring, the proportion of such strings can be limited to at most half.
Lemma 18.
.
Proof.
Let be the cycles in , ordered according to an optimal solution for the SCS-RC instance on . Let denote this optimal superstring. Recall that for any , the strings and are inequivalent, as discussed in Section 2.2. Then,
Rearranging the terms gives
Next, consider the reverse complement of the optimal solution, , which is also an optimal superstring for the same instance. In this reversed solution, every occurrence of is replaced by , and vice versa. Hence, we also have
By adding the two inequalities and dividing by two, we obtain
4 Conclusion and Future Work
We have improved the approximation guarantees of MGREEDY-RC and TGREEDY-RC for the SCS-RC problem by leveraging the overlap rotation lemma and certain properties of reverse complements. The remaining gaps compared to the standard SCS problem are mainly in two aspects:
-
(1)
The approximation guarantee of MGREEDY-RC.
-
(2)
The compression ratio.
For the first aspect, we improved the approximation guarantee from to . However, for the standard SCS problem, the best known ratio of the corresponding MGREEDY algorithm is [5], so closing this gap remains an open research direction.
For the second aspect, we used the -approximation compression ratio algorithm in GREEDY-RC. In the case of the standard SCS, the problem can be reduced to the maximum asymmetric traveling salesman problem (MAX-ATSP), which is known to have a -approximation algorithm [10, 13]. However, for the SCS-RC problem, we must consider clusters containing two vertices each, which prevents the direct application of approximation algorithms for MAX-ATSP. Another research direction is to find a suitable reduction related to the MAX-ATSP problem, or to consider an entirely different approach to improve the compression ratio.
References
- [1] Chris Armen and Clifford Stein. A 2 2/3-approximation algorithm for the shortest superstring problem. In Dan Hirschberg and Gene Myers, editors, Combinatorial Pattern Matching, pages 87–101, Berlin, Heidelberg, 1996. Springer Berlin Heidelberg. doi:10.1007/3-540-61258-0_8.
- [2] Avrim Blum, Tao Jiang, Ming Li, John Tromp, and Mihalis Yannakakis. Linear approximation of shortest superstrings. J. ACM, 41(4):630–647, 1994. doi:10.1145/179812.179818.
- [3] Dany Breslauer, Tao Jiang, and Zhigen Jiang. Rotations of periodic strings and short superstrings. J. Algorithms, 24(2):340–353, 1997. doi:10.1006/jagm.1997.0861.
- [4] Matthias Englert, Nicolaos Matsakis, and Pavel Veselý. Improved approximation guarantees for shortest superstrings using cycle classification by overlap to length ratios. In Proceedings of the 54th Annual ACM SIGACT Symposium on Theory of Computing, STOC 2022, pages 317–330, New York, NY, USA, 2022. Association for Computing Machinery. doi:10.1145/3519935.3520001.
- [5] Matthias Englert, Nicolaos Matsakis, and Pavel Veselý. Approximation Guarantees for Shortest Superstrings: Simpler and Better. In Satoru Iwata and Naonori Kakimura, editors, 34th International Symposium on Algorithms and Computation (ISAAC 2023), volume 283 of Leibniz International Proceedings in Informatics (LIPIcs), pages 29:1–29:17, Dagstuhl, Germany, 2023. Schloss Dagstuhl – Leibniz-Zentrum für Informatik. doi:10.4230/LIPIcs.ISAAC.2023.29.
- [6] Gabriele Fici, Tomasz Kociumaka, Jakub Radoszewski, Wojciech Rytter, and Tomasz Waleń. On the greedy algorithm for the shortest common superstring problem with reversals. Information Processing Letters, 116(3):245–251, 2016. doi:10.1016/j.ipl.2015.11.015.
- [7] Theodoros P. Gevezes and Leonidas S. Pitsoulis. The Shortest Superstring Problem, pages 189–227. Springer New York, New York, NY, 2014. doi:10.1007/978-1-4939-0808-0_10.
- [8] Tao Jiang, Ming Li, and Ding-Zhu Du. A note on shortest superstrings with flipping. Information Processing Letters, 44(4):195–199, 1992. doi:10.1016/0020-0190(92)90084-9.
- [9] Eugene W. Myers Jr. A history of dna sequence assembly. it - Information Technology, 58(3):126–132, 2016. doi:10.1515/itit-2015-0047.
- [10] Haim Kaplan, Moshe Lewenstein, Nira Shafrir, and Maxim Sviridenko. Approximation algorithms for asymmetric tsp by decomposing directed regular multigraphs. J. ACM, 52(4):602–626, 2005. doi:10.1145/1082036.1082041.
- [11] Haim Kaplan and Nira Shafrir. The greedy algorithm for shortest superstrings. Information Processing Letters, 93(1):13–17, 2005. doi:10.1016/j.ipl.2004.09.012.
- [12] Marcin Mucha. Lyndon Words and Short Superstrings, pages 958–972. Proceedings of the 2013 Annual ACM-SIAM Symposium on Discrete Algorithms (SODA), 2013. doi:10.1137/1.9781611973105.69.
- [13] Katarzyna Paluch, Khaled Elbassioni, and Anke van Zuylen. Simpler Approximation of the Maximum Asymmetric Traveling Salesman Problem. In Christoph Dürr and Thomas Wilke, editors, 29th International Symposium on Theoretical Aspects of Computer Science (STACS 2012), volume 14 of Leibniz International Proceedings in Informatics (LIPIcs), pages 501–506, Dagstuhl, Germany, 2012. Schloss Dagstuhl – Leibniz-Zentrum für Informatik. doi:10.4230/LIPIcs.STACS.2012.501.
- [14] Z. Sweedyk. A 2-approximation algorithm for shortest superstring. SIAM Journal on Computing, 29(3):954–986, 2000. doi:10.1137/S0097539796324661.
