|
Name |
|
Date |
Size |
#Lines |
LOC |
| .. | | 14-Dec-2021 | - |
| csharp/ | H | 03-May-2022 | - | 2,450 | 2,055 |
| doc/ | H | 14-Dec-2021 | - | 5,333 | 4,151 |
| java/ | H | 03-May-2022 | - | 162 | 109 |
| python/ | H | 03-May-2022 | - | 2,783 | 2,193 |
| samples/ | H | 03-May-2022 | - | 10,728 | 5,798 |
| BUILD.bazel | H A D | 14-Dec-2021 | 37.6 KiB | 1,494 | 1,413 |
| README.md | H A D | 14-Dec-2021 | 5.7 KiB | 148 | 118 |
| __init__.py | H A D | 14-Dec-2021 | 734 | 16 | 3 |
| all_different.cc | H A D | 14-Dec-2021 | 24.8 KiB | 667 | 487 |
| all_different.h | H A D | 14-Dec-2021 | 9.5 KiB | 230 | 93 |
| boolean_problem.cc | H A D | 14-Dec-2021 | 35.3 KiB | 887 | 685 |
| boolean_problem.h | H A D | 14-Dec-2021 | 6.5 KiB | 146 | 60 |
| boolean_problem.proto | H A D | 14-Dec-2021 | 4.6 KiB | 114 | 96 |
| circuit.cc | H A D | 14-Dec-2021 | 19.7 KiB | 554 | 430 |
| circuit.h | H A D | 14-Dec-2021 | 8.1 KiB | 217 | 110 |
| clause.cc | H A D | 14-Dec-2021 | 73.2 KiB | 2,037 | 1,466 |
| clause.h | H A D | 14-Dec-2021 | 35.2 KiB | 835 | 338 |
| cp_constraints.cc | H A D | 14-Dec-2021 | 5.1 KiB | 147 | 107 |
| cp_constraints.h | H A D | 14-Dec-2021 | 6.5 KiB | 182 | 117 |
| cp_model.cc | H A D | 14-Dec-2021 | 46.1 KiB | 1,384 | 1,192 |
| cp_model.h | H A D | 14-Dec-2021 | 43.5 KiB | 1,302 | 516 |
| cp_model.proto | H A D | 14-Dec-2021 | 33.1 KiB | 807 | 708 |
| cp_model_checker.cc | H A D | 14-Dec-2021 | 61.1 KiB | 1,599 | 1,380 |
| cp_model_checker.h | H A D | 14-Dec-2021 | 2 KiB | 52 | 17 |
| cp_model_expand.cc | H A D | 14-Dec-2021 | 59 KiB | 1,594 | 1,196 |
| cp_model_expand.h | H A D | 14-Dec-2021 | 1.2 KiB | 33 | 10 |
| cp_model_lns.cc | H A D | 14-Dec-2021 | 58.4 KiB | 1,545 | 1,160 |
| cp_model_lns.h | H A D | 14-Dec-2021 | 28.7 KiB | 682 | 333 |
| cp_model_loader.cc | H A D | 14-Dec-2021 | 51.4 KiB | 1,317 | 1,045 |
| cp_model_loader.h | H A D | 14-Dec-2021 | 5.1 KiB | 116 | 53 |
| cp_model_mapping.h | H A D | 14-Dec-2021 | 8.8 KiB | 242 | 155 |
| cp_model_objective.cc | H A D | 14-Dec-2021 | 3.7 KiB | 99 | 64 |
| cp_model_objective.h | H A D | 14-Dec-2021 | 1.6 KiB | 41 | 9 |
| cp_model_postsolve.cc | H A D | 14-Dec-2021 | 14.3 KiB | 378 | 280 |
| cp_model_postsolve.h | H A D | 14-Dec-2021 | 2.1 KiB | 53 | 15 |
| cp_model_presolve.cc | H A D | 14-Dec-2021 | 297.5 KiB | 7,941 | 6,056 |
| cp_model_presolve.h | H A D | 14-Dec-2021 | 12.3 KiB | 303 | 136 |
| cp_model_search.cc | H A D | 14-Dec-2021 | 22.6 KiB | 621 | 478 |
| cp_model_search.h | H A D | 14-Dec-2021 | 4.1 KiB | 103 | 45 |
| cp_model_service.proto | H A D | 14-Dec-2021 | 1.3 KiB | 41 | 33 |
| cp_model_solver.cc | H A D | 14-Dec-2021 | 140.4 KiB | 3,474 | 2,703 |
| cp_model_solver.h | H A D | 14-Dec-2021 | 4.1 KiB | 110 | 33 |
| cp_model_symmetries.cc | H A D | 14-Dec-2021 | 41.3 KiB | 1,047 | 672 |
| cp_model_symmetries.h | H A D | 14-Dec-2021 | 2.5 KiB | 64 | 22 |
| cp_model_utils.cc | H A D | 14-Dec-2021 | 20.6 KiB | 571 | 530 |
| cp_model_utils.h | H A D | 14-Dec-2021 | 7.6 KiB | 195 | 116 |
| cumulative.cc | H A D | 14-Dec-2021 | 13.7 KiB | 334 | 211 |
| cumulative.h | H A D | 14-Dec-2021 | 2.8 KiB | 70 | 24 |
| cumulative_energy.cc | H A D | 14-Dec-2021 | 15.7 KiB | 408 | 312 |
| cumulative_energy.h | H A D | 14-Dec-2021 | 4.4 KiB | 113 | 59 |
| cuts.cc | H A D | 14-Dec-2021 | 86.2 KiB | 2,175 | 1,564 |
| cuts.h | H A D | 14-Dec-2021 | 22.1 KiB | 504 | 185 |
| diffn.cc | H A D | 14-Dec-2021 | 21.2 KiB | 583 | 436 |
| diffn.h | H A D | 14-Dec-2021 | 8.1 KiB | 205 | 141 |
| diffn_util.cc | H A D | 14-Dec-2021 | 17.9 KiB | 478 | 357 |
| diffn_util.h | H A D | 14-Dec-2021 | 6.5 KiB | 163 | 82 |
| disjunctive.cc | H A D | 14-Dec-2021 | 54.7 KiB | 1,406 | 977 |
| disjunctive.h | H A D | 14-Dec-2021 | 11.1 KiB | 313 | 174 |
| drat_checker.cc | H A D | 14-Dec-2021 | 22.3 KiB | 612 | 502 |
| drat_checker.h | H A D | 14-Dec-2021 | 15.3 KiB | 342 | 105 |
| drat_proof_handler.cc | H A D | 14-Dec-2021 | 3.9 KiB | 120 | 87 |
| drat_proof_handler.h | H A D | 14-Dec-2021 | 4.7 KiB | 115 | 36 |
| drat_writer.cc | H A D | 14-Dec-2021 | 1.8 KiB | 61 | 39 |
| drat_writer.h | H A D | 14-Dec-2021 | 2.1 KiB | 65 | 28 |
| encoding.cc | H A D | 14-Dec-2021 | 17.3 KiB | 507 | 399 |
| encoding.h | H A D | 14-Dec-2021 | 9.2 KiB | 215 | 93 |
| feasibility_pump.cc | H A D | 14-Dec-2021 | 27.4 KiB | 723 | 559 |
| feasibility_pump.h | H A D | 14-Dec-2021 | 9.1 KiB | 239 | 109 |
| implied_bounds.cc | H A D | 14-Dec-2021 | 17.5 KiB | 468 | 334 |
| implied_bounds.h | H A D | 14-Dec-2021 | 9.6 KiB | 233 | 94 |
| integer.cc | H A D | 14-Dec-2021 | 79.8 KiB | 2,089 | 1,518 |
| integer.h | H A D | 14-Dec-2021 | 75.1 KiB | 1,796 | 952 |
| integer_expr.cc | H A D | 14-Dec-2021 | 55.3 KiB | 1,513 | 1,202 |
| integer_expr.h | H A D | 14-Dec-2021 | 34.9 KiB | 906 | 619 |
| integer_search.cc | H A D | 14-Dec-2021 | 47.1 KiB | 1,194 | 890 |
| integer_search.h | H A D | 14-Dec-2021 | 11.6 KiB | 268 | 104 |
| intervals.cc | H A D | 14-Dec-2021 | 20.3 KiB | 568 | 461 |
| intervals.h | H A D | 14-Dec-2021 | 31.2 KiB | 802 | 524 |
| lb_tree_search.cc | H A D | 14-Dec-2021 | 18 KiB | 464 | 303 |
| lb_tree_search.h | H A D | 14-Dec-2021 | 4.6 KiB | 133 | 63 |
| linear_constraint.cc | H A D | 14-Dec-2021 | 13.6 KiB | 427 | 350 |
| linear_constraint.h | H A D | 14-Dec-2021 | 11.4 KiB | 303 | 146 |
| linear_constraint_manager.cc | H A D | 14-Dec-2021 | 27.7 KiB | 737 | 563 |
| linear_constraint_manager.h | H A D | 14-Dec-2021 | 12.1 KiB | 319 | 148 |
| linear_programming_constraint.cc | H A D | 14-Dec-2021 | 113.2 KiB | 2,915 | 2,101 |
| linear_programming_constraint.h | H A D | 14-Dec-2021 | 24.4 KiB | 590 | 250 |
| linear_relaxation.cc | H A D | 14-Dec-2021 | 61.8 KiB | 1,562 | 1,206 |
| linear_relaxation.h | H A D | 14-Dec-2021 | 8.6 KiB | 193 | 79 |
| lp_utils.cc | H A D | 14-Dec-2021 | 54.5 KiB | 1,436 | 1,102 |
| lp_utils.h | H A D | 14-Dec-2021 | 7.8 KiB | 161 | 49 |
| model.h | H A D | 14-Dec-2021 | 6.6 KiB | 224 | 98 |
| optimization.cc | H A D | 14-Dec-2021 | 78.1 KiB | 1,977 | 1,297 |
| optimization.h | H A D | 14-Dec-2021 | 10.3 KiB | 236 | 83 |
| parameters_validation.cc | H A D | 14-Dec-2021 | 930 | 28 | 11 |
| parameters_validation.h | H A D | 14-Dec-2021 | 1.1 KiB | 32 | 10 |
| pb_constraint.cc | H A D | 14-Dec-2021 | 40.7 KiB | 1,137 | 872 |
| pb_constraint.h | H A D | 14-Dec-2021 | 29.7 KiB | 727 | 320 |
| precedences.cc | H A D | 14-Dec-2021 | 38.8 KiB | 952 | 654 |
| precedences.h | H A D | 14-Dec-2021 | 22.2 KiB | 512 | 286 |
| presolve_context.cc | H A D | 14-Dec-2021 | 73.6 KiB | 2,064 | 1,572 |
| presolve_context.h | H A D | 14-Dec-2021 | 27.9 KiB | 667 | 266 |
| presolve_util.cc | H A D | 14-Dec-2021 | 6.6 KiB | 212 | 159 |
| presolve_util.h | H A D | 14-Dec-2021 | 3.5 KiB | 96 | 40 |
| probing.cc | H A D | 14-Dec-2021 | 29.2 KiB | 752 | 509 |
| probing.h | H A D | 14-Dec-2021 | 9.7 KiB | 223 | 56 |
| pseudo_costs.cc | H A D | 14-Dec-2021 | 4.3 KiB | 122 | 86 |
| pseudo_costs.h | H A D | 14-Dec-2021 | 2.6 KiB | 79 | 37 |
| restart.cc | H A D | 14-Dec-2021 | 7.1 KiB | 194 | 154 |
| restart.h | H A D | 14-Dec-2021 | 3.4 KiB | 102 | 52 |
| rins.cc | H A D | 14-Dec-2021 | 6.3 KiB | 179 | 127 |
| rins.h | H A D | 14-Dec-2021 | 3.3 KiB | 92 | 43 |
| sat_base.h | H A D | 14-Dec-2021 | 23.1 KiB | 608 | 339 |
| sat_decision.cc | H A D | 14-Dec-2021 | 17.1 KiB | 477 | 347 |
| sat_decision.h | H A D | 14-Dec-2021 | 10 KiB | 240 | 88 |
| sat_inprocessing.cc | H A D | 14-Dec-2021 | 57.1 KiB | 1,576 | 1,098 |
| sat_inprocessing.h | H A D | 14-Dec-2021 | 14.4 KiB | 382 | 196 |
| sat_parameters.proto | H A D | 14-Dec-2021 | 54.1 KiB | 1,114 | 924 |
| sat_solver.cc | H A D | 14-Dec-2021 | 99.7 KiB | 2,586 | 1,828 |
| sat_solver.h | H A D | 14-Dec-2021 | 42.8 KiB | 1,046 | 454 |
| scheduling_constraints.cc | H A D | 14-Dec-2021 | 13.9 KiB | 381 | 300 |
| scheduling_constraints.h | H A D | 14-Dec-2021 | 2.7 KiB | 70 | 28 |
| scheduling_cuts.cc | H A D | 14-Dec-2021 | 51.8 KiB | 1,314 | 1,006 |
| scheduling_cuts.h | H A D | 14-Dec-2021 | 5.7 KiB | 137 | 50 |
| simplification.cc | H A D | 14-Dec-2021 | 51.4 KiB | 1,412 | 1,066 |
| simplification.h | H A D | 14-Dec-2021 | 18.8 KiB | 450 | 179 |
| subsolver.cc | H A D | 14-Dec-2021 | 6.1 KiB | 194 | 128 |
| subsolver.h | H A D | 14-Dec-2021 | 5.5 KiB | 146 | 49 |
| swig_helper.h | H A D | 14-Dec-2021 | 7.1 KiB | 222 | 140 |
| symmetry.cc | H A D | 14-Dec-2021 | 8.6 KiB | 232 | 171 |
| symmetry.h | H A D | 14-Dec-2021 | 6.7 KiB | 163 | 57 |
| symmetry_util.cc | H A D | 14-Dec-2021 | 6.3 KiB | 192 | 140 |
| symmetry_util.h | H A D | 14-Dec-2021 | 3.6 KiB | 83 | 17 |
| synchronization.cc | H A D | 14-Dec-2021 | 31.7 KiB | 841 | 645 |
| synchronization.h | H A D | 14-Dec-2021 | 22.4 KiB | 583 | 294 |
| table.cc | H A D | 14-Dec-2021 | 2.9 KiB | 88 | 60 |
| table.h | H A D | 14-Dec-2021 | 1.4 KiB | 42 | 18 |
| theta_tree.cc | H A D | 14-Dec-2021 | 11 KiB | 306 | 252 |
| theta_tree.h | H A D | 14-Dec-2021 | 10.6 KiB | 255 | 71 |
| timetable.cc | H A D | 14-Dec-2021 | 22.6 KiB | 628 | 420 |
| timetable.h | H A D | 14-Dec-2021 | 8 KiB | 224 | 106 |
| timetable_edgefinding.cc | H A D | 14-Dec-2021 | 13.4 KiB | 359 | 212 |
| timetable_edgefinding.h | H A D | 14-Dec-2021 | 4.9 KiB | 130 | 45 |
| util.cc | H A D | 14-Dec-2021 | 10.1 KiB | 297 | 196 |
| util.h | H A D | 14-Dec-2021 | 9.2 KiB | 239 | 90 |
| var_domination.cc | H A D | 14-Dec-2021 | 46.8 KiB | 1,235 | 957 |
| var_domination.h | H A D | 14-Dec-2021 | 12.2 KiB | 286 | 114 |
| zero_half_cuts.cc | H A D | 14-Dec-2021 | 9.6 KiB | 278 | 201 |
| zero_half_cuts.h | H A D | 14-Dec-2021 | 5.1 KiB | 133 | 49 |
README.md
1# CP/SAT
2
3This directory contains a next-gen Constraint Programming (CP) solver with
4clause learning. It is built on top of an efficient SAT/max-SAT solver whose
5code is also in this directory.
6
7The technology started in 2009. A complete presentation is available
8[here](https://people.eng.unimelb.edu.au/pstuckey/PPDP2013.pdf).
9
10CP-SAT was described during the CPAIOR 2020 masterclass. The recording is
11available [here](https://www.youtube.com/watch?v=lmy1ddn4cyw).
12
13To begin, skim
14[cp_model.proto](../cp_model.proto) to
15understand how optimization problems can be modeled using the solver. You can
16then solve a model with the functions in
17[cp_model_solver.h](../sat/cp_model_solver.h).
18
19
20## Parameters
21
22* [sat_parameters.proto](../sat/sat_parameters.proto):
23 The SAT solver parameters. Also contains max-SAT and CP parameters.
24
25## Model
26
27The optimization model description and related utilities:
28
29* [cp_model.proto](../cp_model.proto):
30 Proto describing a general Constraint Programming model.
31* [cp_model_utils.h](../sat/cp_model_utils.h):
32 Utilities to manipulate and create a cp_model.proto.
33* [cp_model_checker.h](../sat/cp_model_checker.h):
34 Tools to validate cp_model.proto and test a solution feasibility.
35* [cp_model_solver.h](../sat/cp_model_solver.h):
36 The solver API.
37* [cp_model_presolve.h](../sat/cp_model_presolve.h):
38 Presolve a cp_model.proto by applying simple rules to simplify a subsequent
39 solve.
40
41## SAT solver
42
43Stand-alone SAT solver and related files. Note that this is more than a basic
44SAT solver as it already includes non-clause constraints. However, these do not
45work on the general integer problems that the CP solver handles.
46
47Pure SAT solver:
48
49* [sat_base.h](../sat/sat_base.h): SAT
50 core classes.
51* [clause.h](../sat/clause.h): SAT clause
52 propagator with the two-watcher mechanism. Also contains propagators for
53 binary clauses.
54* [sat_solver.h](../sat/sat_solver.h):
55 The SatSolver code.
56* [simplification.h](../sat/simplification.h):
57 SAT postsolver and presolver.
58* [symmetry.h](../sat/symmetry.h):
59 Dynamic symmetry breaking constraint in SAT. Not used by default.
60
61Extension:
62
63* [pb_constraint.h](../sat/pb_constraint.h):
64 Implementation of a Pseudo-Boolean constraint propagator for SAT.
65 Pseudo-Boolean constraints are simply another name used in the SAT community
66 for linear constraints on Booleans.
67* [no_cycle.h](../sat/no_cycle.h):
68 Implementation of a no-cycle constraint on a graph whose arc presences are
69 controlled by Boolean. This is a SAT propagator, not used in CP.
70* [encoding.h](../sat/encoding.h): Basic
71 algorithm to encode integer variables into a binary representation. This is
72 not used by the CP solver, just by the max-SAT core based algorithm in
73 optimization.h.
74
75Input/output:
76
77* [drat_writer.h](../sat/drat_writer.h):
78 Write UNSAT proof in the DRAT format. This allows to check the correctness
79 of an UNSAT proof with the third party program DRAT-trim.
80* [opb_reader.h](../sat/opb_reader.h):
81 Parser for the .opb format for Pseudo-Boolean optimization problems.
82* [sat_cnf_reader.h](../sat/sat_cnf_reader.h):
83 Parser for the classic SAT .cnf format. Also parses max-SAT files.
84* [boolean_problem.proto](../sat/boolean_problem.proto):
85 Deprecated by cp_model.proto.
86
87## CP solver
88
89CP solver built on top of the SAT solver:
90
91* [integer.h](../sat/integer.h): The
92 entry point, which defines the core of the solver.
93
94Basic constraints:
95
96* [all_different.h](../sat/all_different.h):
97 Propagation algorithms for the AllDifferent constraint.
98* [integer_expr.h](../sat/integer_expr.h):
99 Propagation algorithms for integer expression (linear, max, min, div, mod,
100 ...).
101* [table.h](../sat/table.h): Propagation
102 algorithms for the table and automaton constraints.
103* [precedences.h](../sat/precedences.h):
104 Propagation algorithms for integer inequalities (integer difference logic
105 theory).
106* [cp_constraints.h](../sat/cp_constraints.h):
107 Propagation algorithms for other classic CP constraints (XOR, circuit,
108 non-overlapping rectangles, ...)
109* [linear_programming_constraint.h](../sat/linear_programming_constraint.h):
110 Constraint that solves an LP relaxation of a set of constraints and uses the
111 dual-ray to explain an eventual infeasibility. Also implements reduced-cost
112 fixing.
113* [flow_costs.h](../sat/flow_costs.h):
114 Deprecated. Network flow constraint. We use the generic
115 linear_programming_constraint instead.
116
117Scheduling constraints:
118
119* [intervals.h](../sat/intervals.h):
120 Definition and utility for manipulating "interval" variables (a.k.a. task or
121 activities). This is the basic CP variable type used in scheduling problems.
122* [disjunctive.h](../sat/disjunctive.h):
123 Propagation algorithms for the disjunctive scheduling constraint.
124* [cumulative.h](../sat/cumulative.h),
125 [timetable.h](../sat/timetable.h),
126 [timetable_edgefinding.h](../sat/timetable_edgefinding.h):
127 Propagation algorithms for the cumulative scheduling constraint.
128* [cumulative_energy.h](../sat/cumulative_energy.h):
129 Propagation algorithms for a more general cumulative constraint.
130* [theta_tree.h](../sat/theta_tree.h):
131 Data structure used in the cumulative/disjunctive propagation algorithm.
132
133## Other
134
135* [model.h](../sat/model.h): Generic
136 class that implements a basic dependency injection framework for singleton
137 objects and manages the memory ownership of all the solver classes.
138* [optimization.h](../sat/optimization.h):
139 Algorithms to solve an optimization problem using a satisfiability solver as
140 a black box.
141* [lp_utils.h](../sat/lp_utils.h):
142 Utility to scale and convert a MIP model into CP.
143
144## Recipes
145
146You can find a set a code recipes in
147[the documentation directory](doc/README.md).
148