Papers
Topics
Authors
Recent
Search
2000 character limit reached

Longest Filled Common Subsequence (LFCS)

Updated 10 July 2026
  • LFCS is a string-optimization problem that maximizes the longest common subsequence by inserting a prescribed multiset into a base string under multiplicity constraints.
  • It features dual formulations—via insertions into B and deletions from A—enabling a range of methods from exact ILP models to heuristic approaches like random sampling, local search, and adaptive CMSA.
  • Empirical benchmarks, including applications in audio matching, demonstrate LFCS's practical relevance and the challenges of scaling solutions in NP-hard combinatorial search spaces.

Searching arXiv for LFCS papers and related benchmarks. The Longest Filled Common Subsequence (LFCS) problem is a variant of the Longest Common Subsequence (LCS) problem in which the input consists of two strings AA and BB over an alphabet Σ\Sigma, together with a multiset of characters M\mathcal{M}. The task is to insert the characters from M\mathcal{M} into BB, obtaining a new string BB^*, so that the LCS between AA and BB^* is maximized. An equivalent formulation deletes from AA a set of symbols that can be matched to BB0 under its multiplicity constraints, and then maximizes the sum of the number of deleted symbols and BB1, where BB2 is the residual subsequence of BB3. LFCS was introduced as a new string-optimization problem and studied first through hardness and approximation, then through heuristics, integer programming, and more recently scalable hybrid metaheuristics and application-driven benchmarks (Mincu et al., 2019, Djukanovic et al., 12 Sep 2025).

1. Formal definition and equivalent viewpoints

In its direct formulation, LFCS asks for an insertion of the multiset BB4 into BB5 such that the resulting string BB6 maximizes the LCS score against BB7. The multiset nature of BB8 is essential: only the symbol counts matter, not an intrinsic order. This distinguishes LFCS from ordinary LCS and from edit-distance variants in which all operations are freely chosen.

The alternative formulation is operationally important. One may select symbols in BB9 to be “matched” with Σ\Sigma0, subject to the condition that for each symbol the number selected does not exceed its multiplicity in Σ\Sigma1. If Σ\Sigma2 denotes the string obtained from Σ\Sigma3 after removing those selected symbols, then the objective is

Σ\Sigma4

or equivalently

Σ\Sigma5

where Σ\Sigma6 is the number of deleted symbols. This dual view underlies both the heuristic design of the 2019 study and the scalable CMSA framework introduced later (Mincu et al., 2019, Djukanovic et al., 12 Sep 2025).

LFCS is NP-hard, and the only guaranteed algorithm explicitly identified in the supplied literature is a Σ\Sigma7-approximation due to Castelli, Dondi, Mauro, and Zoppis, originally presented at CPM 2017 and discussed in subsequent work (Mincu et al., 2019). A plausible implication is that LFCS sits at the intersection of subsequence optimization and constrained augmentation, where combinatorial complexity derives not only from ordering constraints, as in LCS, but also from multiset-budget constraints induced by Σ\Sigma8.

2. Combinatorial structure and search-space reduction

The 2019 heuristic study emphasizes that the deletion-based formulation substantially sharpens the search perspective. Rather than exploring all possible insertions into Σ\Sigma9, it suffices to consider subsets of symbols in M\mathcal{M}0 whose per-symbol counts are feasible with respect to M\mathcal{M}1 (Mincu et al., 2019).

Let M\mathcal{M}2 and

M\mathcal{M}3

The resulting search-space size is expressed as

M\mathcal{M}4

This formulation makes explicit that the difficulty of LFCS depends on the interaction between symbol frequencies in M\mathcal{M}5 and the multiplicity profile of M\mathcal{M}6, not merely on M\mathcal{M}7 and M\mathcal{M}8.

This structural view also explains several empirical phenomena later reported. The 2019 experiments observed that random sampling can perform well when the search space is small, especially for larger alphabets and shorter strings (Mincu et al., 2019). The 2025 work, by contrast, reports that prior datasets lacked the discriminative power needed to assess scalability, suggesting that search-space compression alone is insufficient for large instances unless it is paired with mechanisms that focus computation on promising components (Djukanovic et al., 12 Sep 2025).

3. Integer linear programming formulations

A central methodological step in the 2019 paper is the introduction of an ILP model for LFCS, solved in experiments with Gurobi to obtain exact solutions for moderate-sized instances (Mincu et al., 2019). The model uses binary variables M\mathcal{M}9 and M\mathcal{M}0:

  • M\mathcal{M}1 if M\mathcal{M}2 and this pairing appears in the LCS of M\mathcal{M}3 and M\mathcal{M}4;
  • M\mathcal{M}5 if the symbol M\mathcal{M}6 in M\mathcal{M}7 is matched with M\mathcal{M}8.

The objective is

M\mathcal{M}9

The constraints encode the subsequence structure and multiset feasibility: BB0

BB1

BB2

BB3

The first family enforces non-crossing LCS matches, the second ensures that each position of BB4 is used at most once, the third ensures that each position of BB5 is matched at most once, and the fourth enforces the multiplicity budget of BB6.

The 2025 CMSA paper presents a summarized ILP in essentially the same spirit, but adapted to subproblems restricted to variables corresponding only to matches observed in a maintained solution pool. In that framework, an external black-box solver—specifically CPLEX—is used to solve the reduced ILP (Djukanovic et al., 12 Sep 2025). This suggests a methodological continuity: exact ILP remains central, but scalability is sought by aggressively shrinking the active variable set rather than by solving the full formulation on large instances.

4. Heuristic algorithms and approximation behavior

The 2019 experimental study introduces two classes of heuristics and compares them with the earlier BB7-approximation algorithm (Mincu et al., 2019).

The first is uniform random sampling. It randomly matches as many occurrences of each symbol in BB8 as exist in BB9, forms BB^*0, evaluates BB^*1 plus the number matched with BB^*2, and repeats this process 10,000 times by default. The method is simple, but the experiments indicate that it can find the optimum in a significant fraction of small instances when the search space is small.

The second is a local search algorithm denoted BB^*3. Starting from a current solution BB^*4, it iteratively explores all possible matchings in a window of length BB^*5, effectively “matching” up to BB^*6 consecutive symbols in BB^*7 at a time, and then updates to the best neighboring solution. The paper reports variants BB^*8, BB^*9, and AA0 for AA1, respectively. The process continues until no further improvement is possible.

The reported behavior is nuanced. All algorithms reach within 97% of the optimum on average. The AA2-approximation is described as robust, but local search can beat it in cases with small alphabets and larger strings. Random sampling can outperform others in some settings but worsens as the search space grows. Increasing the window size AA3 does not always increase effectiveness, because irreversibility can induce local optima (Mincu et al., 2019). This last observation is important: larger neighborhoods are not automatically more useful when a move can destroy structure that later iterations cannot efficiently reconstruct.

5. Experimental benchmarks and empirical performance

The 2019 study evaluates heuristics on procedurally generated random instances with string lengths AA4 and alphabet sizes AA5, AA6, and AA7, with 100 instances generated for each parameter set. Optima are computed by ILP with Gurobi (Mincu et al., 2019). A representative excerpt from the reported optimum-hit counts is shown below.

Alphabet AA8 Optimum hits
AA9 64 3/5 approx: 50; rand: 22; S1: 57; S2: 60; S4: 51
BB^*0 80 3/5 approx: 71; rand: 36; S1: 78; S2: 79; S4: 67
BB^*1 48 3/5 approx: 85; rand: 100; S1: 82; S2: 86; S4: 85

These results show that performance is strongly instance-dependent. In particular, random sampling can be extremely competitive on some large-alphabet configurations, whereas local search dominates in others.

The 2025 study argues that previously used datasets were too small or too synthetic to reveal scalability differences, and introduces a large synthetic benchmark of 1,620 instances, including cases up to BB^*2, with alphabet sizes BB^*3, as well as a realistic audio benchmark based on discretized per-second energy profiles from popular songs (Djukanovic et al., 12 Sep 2025). On 1,510 problem instances with known optimal solutions, the proposed adaptive CMSA solves 1,486 and achieves over 99.9% optimal solution quality. The paper further states that previous approaches, including ILP, fail to return non-trivial solutions as size increases, especially for RNA-sized alphabets, while Adapt-CMSA outperforms all other methods in solution quality on all 12 large benchmark groups (Djukanovic et al., 12 Sep 2025).

A plausible implication is that the empirical regime of LFCS has shifted from moderate-size exact optimization and small-instance heuristic comparison to genuinely large-scale combinatorial search, where benchmark design itself materially affects conclusions about algorithm quality.

6. Adaptive CMSA, explainability, and application domains

The principal algorithmic contribution of the 2025 work is an adaptive Construct, Merge, Solve, Adapt (CMSA) framework specialized for LFCS (Djukanovic et al., 12 Sep 2025). CMSA iteratively constructs a pool of promising solutions, merges their components to define a restricted subproblem, solves that subproblem optimally with an external solver, and adapts the component pool by rewarding successful and penalizing unsuccessful components.

In the LFCS-specific representation, each solution BB^*4 consists of positions in BB^*5 matched to BB^*6, denoted BB^*7, and positions selected for LCS in BB^*8, denoted BB^*9. The subproblem ILP includes only variables corresponding to component matches observed in the current pool AA0. The framework includes self-adaptive features: dynamic adjustment of the number of constructed solutions and of diversity through the parameter AA1, mutation from the current best via random local edits, and early termination in CPLEX as soon as a new better solution is found (Djukanovic et al., 12 Sep 2025).

The same paper also reports an empirical explainability analysis using SHAP with XGBoost regression. The features are string length AA2, alphabet size AA3, query length AA4, and multiset size AA5. For Adapt-Cmsa and other heuristics, the most important features are AA6 and AA7; larger AA8 and larger AA9 are associated with higher quality, while BB00 and BB01 have lesser positive or sometimes negative impact. For ILP, the paper states that for small sizes it behaves like heuristics, whereas for large sizes performance is explained by input size and alphabet size limiting practical tractability (Djukanovic et al., 12 Sep 2025).

An application-driven extension is the use of LFCS for song identification from degraded audio excerpts. Songs are mapped to per-second energy profiles discretized to 10 levels, candidate songs are represented as strings BB02, the degraded query is represented as BB03, and BB04 captures non-ordered energy evidence. The reported setup uses 8 popular songs and degradation levels BB05. The study states that the correct song is identified robustly at low to high degradation, and that Adapt-Cmsa consistently outperforms classic ILP and prior heuristics in this setting (Djukanovic et al., 12 Sep 2025). This suggests that LFCS is not merely a theoretical variant of LCS, but a model for sequence matching in which partial order is retained in one channel and lost in another.

7. Position within the LFCS literature

The literature reflected in the supplied arXiv record presents a clear progression. First, LFCS is defined, shown NP-hard, and accompanied by a BB06-approximation algorithm as the foundational worst-case guarantee, as discussed in later work (Mincu et al., 2019). Second, the problem is reformulated in deletion space, equipped with a first ILP model, and investigated experimentally via random sampling and local search, demonstrating that practical performance can substantially exceed the worst-case guarantee on moderate-size instances (Mincu et al., 2019). Third, the scope expands to large-scale benchmarks, adaptive CMSA, empirical explainability, and an engineering application in audio querying, with the claim of state-of-the-art performance on both standard and newly introduced benchmarks (Djukanovic et al., 12 Sep 2025).

One recurring misconception would be to treat LFCS as merely “LCS plus insertions.” The supplied formulations show that the problem is more constrained and more structured: the inserted material is restricted to a prescribed multiset, and the optimization can be equivalently viewed as selecting deletions from BB07 under multiplicity budgets. Another possible misconception is that exact ILP supersedes heuristics; the later results instead indicate a division of labor in which full ILP is effective for small and moderate instances, while large instances require hybrid frameworks that use ILP only on dynamically constructed subproblems (Mincu et al., 2019, Djukanovic et al., 12 Sep 2025).

An open question explicitly stated in the 2019 study is whether there exists a provably better-than-BB08-approximation algorithm for LFCS (Mincu et al., 2019). The subsequent progress reported in 2025 concerns empirical dominance and scalability rather than improved approximation guarantees, so that question remains central in the problem’s theoretical profile.

Topic to Video (Beta)

No one has generated a video about this topic yet.

Whiteboard

No one has generated a whiteboard explanation for this topic yet.

Follow Topic

Get notified by email when new papers are published related to Longest Filled Common Subsequence (LFCS).