# Longest common subsequence with at most one swap

Is there a good algorithm for calculating the longest common subsequence where we consider two sequences identical if they can be transformed to one another with at most 1 swapping of subsequences (i.e. taking two non-overlapping subsequences of the same length and substituting them for each other)? For example ABCDEFGHIJ would be considered identical to EFGHABCDIJ but not to ABCDEHFGIJ. Or is there such an algorithm for subsequences of length one?

• Have you tried extending the dynamic programming algorithm for LCS? – Yuval Filmus May 1 '18 at 14:21