Class SolutionPrinter

java.lang.Object
org.ddolib.util.io.SolutionPrinter

public class SolutionPrinter extends Object
Utility class providing helper methods to display solutions found by a solver.

The SolutionPrinter is typically used as a callback or logging utility during the search process to print newly found incumbent (best so far) solutions, along with their associated search statistics.

  • Constructor Details

    • SolutionPrinter

      public SolutionPrinter()
  • Method Details

    • printSolution

      public static void printSolution(SearchStatistics stats, int[] solution)
      Prints a newly found solution and its associated statistics to the standard output.

      This method is usually invoked each time a better solution is found during the solving process, displaying both the solver's performance information and the variable assignment.

      Parameters:
      stats - the SearchStatistics object containing information about the current search state
      solution - an array of integers representing the variable assignments of the new incumbent solution