Class LCSLnsMain

java.lang.Object
org.ddolib.examples.lcs.LCSLnsMain

public class LCSLnsMain extends Object
Entry point for solving the Longest Common Subsequence (LCS) problem using a Large Neighborhood Search (LNS) approach combined with Decision Diagram Optimization (DDO).

The Longest Common Subsequence problem consists in finding the longest sequence of symbols that appears in the same relative order (not necessarily contiguous) in a set of input sequences.

This class demonstrates how to:

  • Load an LCS instance from a file
  • Define a LnsModel with problem-specific components
  • Use a lower bound heuristic to guide the search
  • Run a Large Neighborhood Search (LNS) optimization
  • Print intermediate and final solutions

Execution

The program accepts an optional command-line argument specifying the path to an LCS instance file. If not provided, a default test instance is loaded from:

 src/test/resources/LCS/LCS_3_3_10_test.txt
 

Model Components

Search Configuration

  • Search strategy: Large Neighborhood Search (LNS)
  • Time limit: 100 milliseconds

Note that no dominance rule or width heuristic is explicitly defined here, meaning default behaviors (if any) from the underlying framework are used.

Output

The program prints:

  • Intermediate solutions during the search
  • Final solution statistics
  • The best subsequence found
See Also:
  • Constructor Details

    • LCSLnsMain

      public LCSLnsMain()
  • Method Details

    • main

      public static void main(String[] args) throws IOException
      Main entry point of the program.

      Loads an LCS instance, configures the LNS model with problem-specific heuristics, and runs the optimization process.

      Parameters:
      args - optional command-line arguments:
      • args[0] – path to the LCS instance file
      Throws:
      IOException - if the instance file cannot be read