Class KSAcsMain

java.lang.Object
org.ddolib.examples.knapsack.KSAcsMain

public class KSAcsMain extends Object
Knapsack Problem (KS) with Acs.

This class demonstrates how to solve an instance of the Knapsack Problem (KS) using the Anytime Column Search (ACS) algorithm.

The program performs the following steps:

  1. Loads a knapsack instance from a data file.
  2. Defines an AcsModel with a fast lower bound and dominance checker.
  3. Creates a Solvers and runs the ACS algorithm.
  4. Prints updates when a new incumbent solution is found.
  5. Outputs the final search statistics.

The ACS solver in this example is configured to stop after 10 iterations, and the column width for the ACS model is set to 10.

  • Constructor Details

    • KSAcsMain

      public KSAcsMain()
  • Method Details

    • main

      public static void main(String[] args) throws IOException
      Entry point of the ACS demonstration for the Knapsack Problem.
      Parameters:
      args - command-line arguments (not used)
      Throws:
      IOException - if the instance file cannot be read