-
Jory Anderson (V00843894)
-
Note: My original team of 3 disbanded due to the challenges presented by CoViD-19. I have decided to complete the project regardless.
- JDK 11 (Cannot guarantee successful compilation on other versions)
- minisat (Available on UVic Linux machines)
-
After extracting the contents of the tarball, compile all java files in the archive by performing the following in command line / terminal
javac *.java- Ensure your working directory in terminal/cmd is set to the 'subid' folder of the submission (i.e., 'jba')
-
Once completed, take a properly formatted puzzle.txt file (see project.pdf), and perform the following command:
java sud2sat < puzzles/puzzle.txt > puzzle.cnf- Note: sud2satextended can be used in a manner identical to sud2sat. Simply substitute the command.
This will use "puzzle.txt" as the input (i.e., the file containing the incomplete sudoku puzzle), and create a new file called "puzzle.cnf" as the output. This file contains the DIMACs-formatted file used with
minisat -
Using the newly created "puzzle.cnf" file, perform the following:
minisat puzzle.cnf assign.txt > stat.txtAfter executing the above, you will receive two files, "assign.txt" and "stat.txt"
- "assign.txt": A file generated by minisat. Contains one or two lines determining satisfiability.
- "stat.txt": The output of minisat. Will contain statistics pertaining to solving.
-
To solve, run the provided "sat2sud" command like so:
java sat2sud < assign.txt > solution.txtsat2sud takes the file generated by minisat, formats the completed sudoku problem, and outputs it into solution.txt
javac *.java
java sud2sat < puzzles/puzzle.txt > puzzle.cnf
minisat puzzle.cnf assign.txt > stat.txt
java sat2sud < assign.txt > solution.txt
javac *.java
java sud2satextended < puzzles/hardPuzzle2.txt > puzzle.cnf
minisat puzzle.cnf assign.txt > stat.txt
java sat2sud < assign.txt > solution.txt

