Class Max2SatGenerator

java.lang.Object
org.ddolib.examples.max2sat.Max2SatGenerator

public class Max2SatGenerator extends Object
Methods to generate random instance of the Max2Sat problem.
  • Constructor Details

    • Max2SatGenerator

      public Max2SatGenerator()
  • Method Details

    • generateRandomInstance

      public static void generateRandomInstance(String fileName, int numVar, int nbClauses, long seed) throws IOException
      Generates and writes a random instance of the Max2Sat.
      Parameters:
      fileName - The file to save the instance.
      numVar - The number of variables in the problem.
      nbClauses - The number of disjunctive clauses in the problem.
      seed - The seed of the random number generator.
      Throws:
      IOException - If something goes wrong while writing the file.
    • generateRandomInstance

      public static void generateRandomInstance(String fileName, int numVar, int nbClauses) throws IOException
      Generates and writes a random instance of the Max2Sat.
      Parameters:
      fileName - The file to save the instance.
      numVar - The number of variables in the problem.
      nbClauses - The number of disjunctive clauses in the problem.
      Throws:
      IOException - If something goes wrong while writing the file.
    • main

      public static void main(String[] args) throws IOException
      Throws:
      IOException