• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..14-Dec-2021-

csharp/H03-May-2022-2,4502,055

doc/H14-Dec-2021-5,3334,151

java/H03-May-2022-162109

python/H03-May-2022-2,7832,193

samples/H03-May-2022-10,7285,798

BUILD.bazelH A D14-Dec-202137.6 KiB1,4941,413

README.mdH A D14-Dec-20215.7 KiB148118

__init__.pyH A D14-Dec-2021734 163

all_different.ccH A D14-Dec-202124.8 KiB667487

all_different.hH A D14-Dec-20219.5 KiB23093

boolean_problem.ccH A D14-Dec-202135.3 KiB887685

boolean_problem.hH A D14-Dec-20216.5 KiB14660

boolean_problem.protoH A D14-Dec-20214.6 KiB11496

circuit.ccH A D14-Dec-202119.7 KiB554430

circuit.hH A D14-Dec-20218.1 KiB217110

clause.ccH A D14-Dec-202173.2 KiB2,0371,466

clause.hH A D14-Dec-202135.2 KiB835338

cp_constraints.ccH A D14-Dec-20215.1 KiB147107

cp_constraints.hH A D14-Dec-20216.5 KiB182117

cp_model.ccH A D14-Dec-202146.1 KiB1,3841,192

cp_model.hH A D14-Dec-202143.5 KiB1,302516

cp_model.protoH A D14-Dec-202133.1 KiB807708

cp_model_checker.ccH A D14-Dec-202161.1 KiB1,5991,380

cp_model_checker.hH A D14-Dec-20212 KiB5217

cp_model_expand.ccH A D14-Dec-202159 KiB1,5941,196

cp_model_expand.hH A D14-Dec-20211.2 KiB3310

cp_model_lns.ccH A D14-Dec-202158.4 KiB1,5451,160

cp_model_lns.hH A D14-Dec-202128.7 KiB682333

cp_model_loader.ccH A D14-Dec-202151.4 KiB1,3171,045

cp_model_loader.hH A D14-Dec-20215.1 KiB11653

cp_model_mapping.hH A D14-Dec-20218.8 KiB242155

cp_model_objective.ccH A D14-Dec-20213.7 KiB9964

cp_model_objective.hH A D14-Dec-20211.6 KiB419

cp_model_postsolve.ccH A D14-Dec-202114.3 KiB378280

cp_model_postsolve.hH A D14-Dec-20212.1 KiB5315

cp_model_presolve.ccH A D14-Dec-2021297.5 KiB7,9416,056

cp_model_presolve.hH A D14-Dec-202112.3 KiB303136

cp_model_search.ccH A D14-Dec-202122.6 KiB621478

cp_model_search.hH A D14-Dec-20214.1 KiB10345

cp_model_service.protoH A D14-Dec-20211.3 KiB4133

cp_model_solver.ccH A D14-Dec-2021140.4 KiB3,4742,703

cp_model_solver.hH A D14-Dec-20214.1 KiB11033

cp_model_symmetries.ccH A D14-Dec-202141.3 KiB1,047672

cp_model_symmetries.hH A D14-Dec-20212.5 KiB6422

cp_model_utils.ccH A D14-Dec-202120.6 KiB571530

cp_model_utils.hH A D14-Dec-20217.6 KiB195116

cumulative.ccH A D14-Dec-202113.7 KiB334211

cumulative.hH A D14-Dec-20212.8 KiB7024

cumulative_energy.ccH A D14-Dec-202115.7 KiB408312

cumulative_energy.hH A D14-Dec-20214.4 KiB11359

cuts.ccH A D14-Dec-202186.2 KiB2,1751,564

cuts.hH A D14-Dec-202122.1 KiB504185

diffn.ccH A D14-Dec-202121.2 KiB583436

diffn.hH A D14-Dec-20218.1 KiB205141

diffn_util.ccH A D14-Dec-202117.9 KiB478357

diffn_util.hH A D14-Dec-20216.5 KiB16382

disjunctive.ccH A D14-Dec-202154.7 KiB1,406977

disjunctive.hH A D14-Dec-202111.1 KiB313174

drat_checker.ccH A D14-Dec-202122.3 KiB612502

drat_checker.hH A D14-Dec-202115.3 KiB342105

drat_proof_handler.ccH A D14-Dec-20213.9 KiB12087

drat_proof_handler.hH A D14-Dec-20214.7 KiB11536

drat_writer.ccH A D14-Dec-20211.8 KiB6139

drat_writer.hH A D14-Dec-20212.1 KiB6528

encoding.ccH A D14-Dec-202117.3 KiB507399

encoding.hH A D14-Dec-20219.2 KiB21593

feasibility_pump.ccH A D14-Dec-202127.4 KiB723559

feasibility_pump.hH A D14-Dec-20219.1 KiB239109

implied_bounds.ccH A D14-Dec-202117.5 KiB468334

implied_bounds.hH A D14-Dec-20219.6 KiB23394

integer.ccH A D14-Dec-202179.8 KiB2,0891,518

integer.hH A D14-Dec-202175.1 KiB1,796952

integer_expr.ccH A D14-Dec-202155.3 KiB1,5131,202

integer_expr.hH A D14-Dec-202134.9 KiB906619

integer_search.ccH A D14-Dec-202147.1 KiB1,194890

integer_search.hH A D14-Dec-202111.6 KiB268104

intervals.ccH A D14-Dec-202120.3 KiB568461

intervals.hH A D14-Dec-202131.2 KiB802524

lb_tree_search.ccH A D14-Dec-202118 KiB464303

lb_tree_search.hH A D14-Dec-20214.6 KiB13363

linear_constraint.ccH A D14-Dec-202113.6 KiB427350

linear_constraint.hH A D14-Dec-202111.4 KiB303146

linear_constraint_manager.ccH A D14-Dec-202127.7 KiB737563

linear_constraint_manager.hH A D14-Dec-202112.1 KiB319148

linear_programming_constraint.ccH A D14-Dec-2021113.2 KiB2,9152,101

linear_programming_constraint.hH A D14-Dec-202124.4 KiB590250

linear_relaxation.ccH A D14-Dec-202161.8 KiB1,5621,206

linear_relaxation.hH A D14-Dec-20218.6 KiB19379

lp_utils.ccH A D14-Dec-202154.5 KiB1,4361,102

lp_utils.hH A D14-Dec-20217.8 KiB16149

model.hH A D14-Dec-20216.6 KiB22498

optimization.ccH A D14-Dec-202178.1 KiB1,9771,297

optimization.hH A D14-Dec-202110.3 KiB23683

parameters_validation.ccH A D14-Dec-2021930 2811

parameters_validation.hH A D14-Dec-20211.1 KiB3210

pb_constraint.ccH A D14-Dec-202140.7 KiB1,137872

pb_constraint.hH A D14-Dec-202129.7 KiB727320

precedences.ccH A D14-Dec-202138.8 KiB952654

precedences.hH A D14-Dec-202122.2 KiB512286

presolve_context.ccH A D14-Dec-202173.6 KiB2,0641,572

presolve_context.hH A D14-Dec-202127.9 KiB667266

presolve_util.ccH A D14-Dec-20216.6 KiB212159

presolve_util.hH A D14-Dec-20213.5 KiB9640

probing.ccH A D14-Dec-202129.2 KiB752509

probing.hH A D14-Dec-20219.7 KiB22356

pseudo_costs.ccH A D14-Dec-20214.3 KiB12286

pseudo_costs.hH A D14-Dec-20212.6 KiB7937

restart.ccH A D14-Dec-20217.1 KiB194154

restart.hH A D14-Dec-20213.4 KiB10252

rins.ccH A D14-Dec-20216.3 KiB179127

rins.hH A D14-Dec-20213.3 KiB9243

sat_base.hH A D14-Dec-202123.1 KiB608339

sat_decision.ccH A D14-Dec-202117.1 KiB477347

sat_decision.hH A D14-Dec-202110 KiB24088

sat_inprocessing.ccH A D14-Dec-202157.1 KiB1,5761,098

sat_inprocessing.hH A D14-Dec-202114.4 KiB382196

sat_parameters.protoH A D14-Dec-202154.1 KiB1,114924

sat_solver.ccH A D14-Dec-202199.7 KiB2,5861,828

sat_solver.hH A D14-Dec-202142.8 KiB1,046454

scheduling_constraints.ccH A D14-Dec-202113.9 KiB381300

scheduling_constraints.hH A D14-Dec-20212.7 KiB7028

scheduling_cuts.ccH A D14-Dec-202151.8 KiB1,3141,006

scheduling_cuts.hH A D14-Dec-20215.7 KiB13750

simplification.ccH A D14-Dec-202151.4 KiB1,4121,066

simplification.hH A D14-Dec-202118.8 KiB450179

subsolver.ccH A D14-Dec-20216.1 KiB194128

subsolver.hH A D14-Dec-20215.5 KiB14649

swig_helper.hH A D14-Dec-20217.1 KiB222140

symmetry.ccH A D14-Dec-20218.6 KiB232171

symmetry.hH A D14-Dec-20216.7 KiB16357

symmetry_util.ccH A D14-Dec-20216.3 KiB192140

symmetry_util.hH A D14-Dec-20213.6 KiB8317

synchronization.ccH A D14-Dec-202131.7 KiB841645

synchronization.hH A D14-Dec-202122.4 KiB583294

table.ccH A D14-Dec-20212.9 KiB8860

table.hH A D14-Dec-20211.4 KiB4218

theta_tree.ccH A D14-Dec-202111 KiB306252

theta_tree.hH A D14-Dec-202110.6 KiB25571

timetable.ccH A D14-Dec-202122.6 KiB628420

timetable.hH A D14-Dec-20218 KiB224106

timetable_edgefinding.ccH A D14-Dec-202113.4 KiB359212

timetable_edgefinding.hH A D14-Dec-20214.9 KiB13045

util.ccH A D14-Dec-202110.1 KiB297196

util.hH A D14-Dec-20219.2 KiB23990

var_domination.ccH A D14-Dec-202146.8 KiB1,235957

var_domination.hH A D14-Dec-202112.2 KiB286114

zero_half_cuts.ccH A D14-Dec-20219.6 KiB278201

zero_half_cuts.hH A D14-Dec-20215.1 KiB13349

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