Package org.ddolib.examples.max2sat
Class Max2SatGenerator
java.lang.Object
org.ddolib.examples.max2sat.Max2SatGenerator
Methods to generate random instance of the Max2Sat problem.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidgenerateRandomInstance(String fileName, int numVar, int nbClauses) Generates and writes a random instance of the Max2Sat.static voidgenerateRandomInstance(String fileName, int numVar, int nbClauses, long seed) Generates and writes a random instance of the Max2Sat.static void
-
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
- Throws:
IOException
-