Skip to content
Snippets Groups Projects
Commit 61117f0c authored by Gabriel Gehrke's avatar Gabriel Gehrke
Browse files

improved clarity of task 1, 5

parent d8e40014
No related branches found
No related tags found
No related merge requests found
......@@ -137,11 +137,11 @@ Both problems are NP-hard and solutions often look similar, but they can differ
Your task in this sheet is to solve the problem with CP-SAT.
1. Model the BTSP as a Constraint Program (on paper / using latex) by stating the necessary variables, the objective function, and the constraints. This should be similiar to the DBST example.
1. Model the BTSP as a Constraint Program (on paper / using latex) by stating the necessary variables, the objective function, and the constraints. This should be similiar to the DBST example (use depth variables with $x_{vw}=1 \Rightarrow index(w)=index(v)+1$ to enforce a single tour (except for the origin)).
2. Implement this model using CP-SAT. You can reuse code from the DBST-solver.
3. Create some tests based on handcrafted instances for which you can argue the optimal value.
4. Create a benchmark with at least 100 instances of various sizes to evaluate the performance of your solver and to allow comparisons with other solver implementations (by checking, which solver can solve more instances with a timelimit of one minute per instance). You can use random positions but adding some structure and symmetry can yield more difficult instances.
5. Create a version of your solver that enforces a single tour via assigning vertices the corresponing index as variable, with $x_{vw}=1 \Rightarrow index(w)=index(v)+1$ (except for the origin), and one that uses CP-SAT's [`AddCircuit` constraint](https://google.github.io/or-tools/python/ortools/sat/python/cp_model.html#CpModel.AddCircuit). Compare both versions with your benchmark.
5. Take a look at CP-SAT's [`AddCircuit` constraint](https://google.github.io/or-tools/python/ortools/sat/python/cp_model.html#CpModel.AddCircuit). Use it to implement a second BTSP solver which only uses this constraint to enforce a tour. Compare both versions with your benchmark.
6. Give a sound estimate on how well this problem can be solved with CP-SAT based on your experiments. Up to which size would you consider this problem to be easily solvable?
7. (Optional, will be mandatory on next sheet) Develop and implement an efficient greedy algorithm for the BTSP problem. Evaluate its performance (speed, solution quality) on some instances. How does the performance compare to the exact solver? How could a greedy solution be used in order to reduce the runtime of the exact solver? (Hint: try to reduce the model's size)
7. (Optional, will be mandatory on next sheet) Develop and implement an efficient heuristic algorithm for the BTSP problem. Evaluate its performance (speed, solution quality) on some instances. How does the performance compare to the exact solver? How could a greedy solution be used in order to reduce the runtime of the exact solver? (Hint: try to reduce the model's size)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment