Abstract

An efficient algorithm is presented that solves a generalization of the Longest Common Subsequence problem, in which both of the input strings consists of sets of symbols which may be permuted. 1. Introduction. The Longest Common Subsequence (LCS) problem can be described as follows: given two sequences a = {ai}l_<i<_m and fl = {bj}l_<j_<n, find a longest sequence which is a subsequence of both a and ft. The reader is referred to (M) and (S) for a thorough background of the LCS problem. In this paper we discuss a generalization of the LCS problem which we call the Set-Set LCS problem. Given a sequence of sets A = {Ai}l_<~_<p, we say that a sequence a = {ak}~<_k<_,n is a flattening of A if a is the concatenation of strings, the ith of which is some permutation of Ai. An instance of the Set-Set LCS problem of size m x n consists of two sequences of subsets of some alphabet ~, A = {A~}~<_~<p and B = {Bj}~<j<q, where the sum of the cardinalities of the A~ is m, and the sum of the cardinalities of the Bj is n. We define the Set-Set LCS problem to be the problem of finding a longest common subsequence of a and fl, where a ranges over all possible flatten- ings of A, and fl ranges over all possible flattenings of B. As an example, if A = ({comp}, {uter}, {science}, {degree}) and B = ({greedy}, {algorithm}, {cou}, {rse}) then a Set-Set LCS of A and B is (morticser). The case where all the sets of both A and B are singletons is that of the LCS problem. The LCS problem has been solved in time O(mn) and linear space (H), and there is known a subquadratic-time algorithm (MP). The case where all the sets of just B are singletons was solved in O(mn) time in a previous paper (HL). That case arose from the problem of computer-driven music accompaniment, matching polyphonic performances against a solo score (BD). In this paper we present an O(mn)-time algorithm which solves the general Set-Set LCS problem. This problem corresponds to the generalization of the problem of computer-driven music accompaniment, where now the score, as well as the live performance, may have embedded chords. Note that, in accordance with the meaning of chords, the sets are simple sets. However, as detailed at the end of Section 3, the algorithm can handle multisets.

Full Text
Paper version not known

Talk to us

Join us for a 30 min session where you can share your feedback and ask us any queries you have

Schedule a call

Disclaimer: All third-party content on this website/platform is and will remain the property of their respective owners and is provided on "as is" basis without any warranties, express or implied. Use of third-party content does not indicate any affiliation, sponsorship with or endorsement by them. Any references to third-party content is to identify the corresponding services and shall be considered fair use under The CopyrightLaw.