DM841 - Heuristics and Constraint Programming for Discrete Optimization
Assignment 4, Fall 2016 [pdf format]

Submission deadline: Thursday, December 15, 2016 at 12:00.



Your Tasks

All the points below must be addressed in any order:

  1. Model the satisfiability problem in terms of local search
  2. Design a basic iterative improvement algorithm with a natural termination in a local optimum. Call this algorithm: sat_ii.
  3. Design speedups for the execution of sat_ii and call the new algorithm sat_ii_+.
  4. Design stochastic local search algorithms that go beyond local optima and that do not have a natural termination. Examples to consider are: (probabilistic iterative improvement, min conflict heuristic, simulated annealing, tabu search, variable neighborhood search, etc.) Call these algorithms sat_sls_*, where the star indicates a suffix of your choice.
  5. Implement sat_ii, sat_ii_+ and sat_sls_*. For this you can use the start package linked below based on EasyLocal.
  6. Execute the algorithm sat_ii 30 times and plot the distribution of running times and of solution quality.
  7. Show experimentally that sat_ii_+ is indeed more efficient than sat_ii.
  8. Compare experimentally your algorithms from point 4. on the given instances when run with a time limit of 20 seconds on a desktop computer equivalent to those in the IMADA terminal room. For each algorithm collect at least 10 runs per instance. Include in the comparison a baseline algorithm consisting in a random restart of your sat_ii_+.
  9. Describe in a short report (max 5 pages): Use proper mathematical formalism and computer science sketches to specify your algorithms. Use R for the analysis of results and the production of graphics and tables.

In addition, the submission system will execute your program and compare it against your peers on new unseen instances. Therefore you should submit your best algorithm early and eventually revise your submission. Before submitting, test your implementation on the IMADA machines.

You must upload your program and report at:

http://valkyrien.imada.sdu.dk/DOApp/

The web page will compile your files, run your program, store and verify the solution and provide an analysis of results for the assessment of your algorithm. You can continue to submit new results until the deadline and it is recommended to try early to submit in order to ensure the format is as required.

Before continuing reading download the SAT package.

Test Instances

Two sets of test instances will be used: satisfiable instances and unsatisfiable instances. The comparison of the sat_sls_* algorithms will be based, on the first class, on the computation time to find a model that satisfies the instance, and, on the second class, on the number of violated clauses that has to be minimized.

In the directory data from the SAT Start package nine instances are made available: three satisfiable instances of size 20, three satisfiable instances of size 250, three unsatisfiable instances of size 250. These instances are training instances and mustbe used for your local tests. On the submission page, your program will be tested on different but similar instances.

In the following it is described the format of these instances.

Instructions for the Submissions at the Web Page

Start early to test your submission. You can submit as many times as you wish within the deadline. Every new valid submission overwrites the previous submission.

Your archive must uncompress as follows:

Your program will be compiled calling make xyz. Hence make sure that your Makefile is present and that it has the task xyz. Use the same Makefile as the one that has been delivered in the Practice. In particular, make sure that there is the following include:

 include ./make.local

Use make.local to set the path to the EasyLocal library and to the Boost library. The executable file xyz generated in src will be used for the tests. Locally, you are recommended to have additionally the following content, which however you do not need to submit:

To prepare your submission create an archive as follows:

tar czvf sat.tgz src doc

Any other type of archive will not work.

The programs will run on a machine with ubuntu 14.04.

The executable xyz must run with the default arguments of easylocal. In particular, the instance, the output file and the seed will be specified.

xyz --main::instance ../data/uf20-010.cnf --main::output_file uf20-010.sol --main::seed 1

No other parameter can be specified. If you have any, then you will need to hard code them. You can do this as follows. For main parameters just add in the main file, for example:

method="SD";

For other parameters, pass them to the SearchEngine or Solvers. For example, you will need to set the time limit by passing it to the Parametrized instance of SimpleLocalSearch:

SAT_solver.SetParameter("timeout",20.0);

The program will be killed externally at the time limit if it did not terminate already. Hence make sure you hard code the time limit and that you output in time the best solution found during the search.

All output must go in the standard output and in the output file. Do not create other files. The files must be in ASCII format and the output file must contain the solution certificate in the format described above. The output class to produce the output is already implemented but you need to pass your solution to an object of this class. Your solutions will be verified by an external program. You find this program in your start package. You can compile (make verifier) and use it.

Make sure you report the following three result data:

For example:

xyz --main::instance ../data/uf20-010.cnf  --main::seed 1
v -1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 17 18 19 20 0

Cost: 10
Time: 0.00028879

It is important that you use this format and that Time: is the first word in a new line reporting the computation time. To achieve this you can make sure that in your main you have the following lines:

os << out << endl;
os << "Cost: " << result.cost << endl;
os << "Time: " << result.running_time << endl;

Note that the upload and analysis system is still under test and therefore it may have to be fine tuned, hence be patient and contact the teacher if something is not working as it should.