Class NaiveMax2SatSolver

java.lang.Object
org.ddolib.examples.layered.max2sat.NaiveMax2SatSolver

public class NaiveMax2SatSolver extends Object
A naive Max2Sat solver which enumerates all the solution to find the best one. Used for tests.
  • Constructor Details

    • NaiveMax2SatSolver

      public NaiveMax2SatSolver(Max2SatProblem problem)
      Creates a new naive solver for the given Max2Sat instance.
      Parameters:
      problem - the Max2Sat instance to solve
  • Method Details

    • best

      public int best()
      Returns the best value found so far.
      Returns:
      the best value found so far
    • bestSolution

      public int[] bestSolution()
      Returns the best solution found so far.
      Returns:
      the best solution found so far
    • maximize

      public void maximize()
      Enumerates all possible assignments and keeps track of the best one.