Skip to content

Commit

Permalink
Fixes #30, remove obsolete parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
d-krupke committed Jun 2, 2024
1 parent e27ae84 commit 10b5ace
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 45 deletions.
2 changes: 1 addition & 1 deletion .mdbook/googlef189f87bd09b0f17.html
Original file line number Diff line number Diff line change
@@ -1 +1 @@
google-site-verification: googlef189f87bd09b0f17.html
google-site-verification: googlef189f87bd09b0f17.html
42 changes: 20 additions & 22 deletions 05_parameters.md
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ You can control the parallelization of CP-SAT by setting the number of search
workers.

```python
solver.parameters.num_search_workers = 8 # use 8 cores
solver.parameters.num_workers = 8 # use 8 cores
```

Here the solvers used by CP-SAT 9.9 on different parallelization levels for an
Expand All @@ -172,38 +172,38 @@ strategies). Note that some parameters/constraints/objectives can change the
parallelization strategy Also check
[the official documentation](https://github.com/google/or-tools/blob/main/ortools/sat/docs/troubleshooting.md#improving-performance-with-multiple-workers).

- `solver.parameters.num_search_workers = 1`: Single-threaded search with
- `solver.parameters.num_workers = 1`: Single-threaded search with
`[default_lp]`.
- 1 full problem subsolver: [default_lp]
- `solver.parameters.num_search_workers = 2`: Additional use of heuristics to
support the `default_lp` search.
- `solver.parameters.num_workers = 2`: Additional use of heuristics to support
the `default_lp` search.
- 1 full problem subsolver: [default_lp]
- 13 incomplete subsolvers: [feasibility_pump, graph_arc_lns, graph_cst_lns,
graph_dec_lns, graph_var_lns, packing_precedences_lns,
packing_rectangles_lns, packing_slice_lns, rins/rens, rnd_cst_lns,
rnd_var_lns, scheduling_precedences_lns, violation_ls]
- 3 helper subsolvers: [neighborhood_helper, synchronization_agent,
update_gap_integral]
- `solver.parameters.num_search_workers = 3`: Using a second full problem solver
that does not try to linearize the model.
- `solver.parameters.num_workers = 3`: Using a second full problem solver that
does not try to linearize the model.
- 2 full problem subsolvers: [default_lp, no_lp]
- 13 incomplete subsolvers: [feasibility_pump, graph_arc_lns, graph_cst_lns,
graph_dec_lns, graph_var_lns, packing_precedences_lns,
packing_rectangles_lns, packing_slice_lns, rins/rens, rnd_cst_lns,
rnd_var_lns, scheduling_precedences_lns, violation_ls]
- 3 helper subsolvers: [neighborhood_helper, synchronization_agent,
update_gap_integral]
- `solver.parameters.num_search_workers = 4`: Additionally using a third full
problem solver that tries to linearize the model as much as possible.
- `solver.parameters.num_workers = 4`: Additionally using a third full problem
solver that tries to linearize the model as much as possible.
- 3 full problem subsolvers: [default_lp, max_lp, no_lp]
- 13 incomplete subsolvers: [feasibility_pump, graph_arc_lns, graph_cst_lns,
graph_dec_lns, graph_var_lns, packing_precedences_lns,
packing_rectangles_lns, packing_slice_lns, rins/rens, rnd_cst_lns,
rnd_var_lns, scheduling_precedences_lns, violation_ls]
- 3 helper subsolvers: [neighborhood_helper, synchronization_agent,
update_gap_integral]
- `solver.parameters.num_search_workers = 5`: Additionally using a first
solution subsolver.
- `solver.parameters.num_workers = 5`: Additionally using a first solution
subsolver.
- 3 full problem subsolvers: [default_lp, max_lp, no_lp]
- 1 first solution subsolver: [fj_short_default]
- 13 incomplete subsolvers: [feasibility_pump, graph_arc_lns, graph_cst_lns,
Expand All @@ -212,7 +212,7 @@ parallelization strategy Also check
rnd_var_lns, scheduling_precedences_lns, violation_ls]
- 3 helper subsolvers: [neighborhood_helper, synchronization_agent,
update_gap_integral]
- `solver.parameters.num_search_workers = 6`: Using a fourth full problem solver
- `solver.parameters.num_workers = 6`: Using a fourth full problem solver
`quick_restart` that does more "probing".
- 4 full problem subsolvers: [default_lp, max_lp, no_lp, quick_restart]
- 1 first solution subsolver: [fj_short_default]
Expand All @@ -222,7 +222,7 @@ parallelization strategy Also check
rnd_var_lns, scheduling_precedences_lns, violation_ls]
- 3 helper subsolvers: [neighborhood_helper, synchronization_agent,
update_gap_integral]
- `solver.parameters.num_search_workers = 7`:
- `solver.parameters.num_workers = 7`:
- 5 full problem subsolvers: [default_lp, max_lp, no_lp, quick_restart,
reduced_costs]
- 1 first solution subsolver: [fj_short_default]
Expand All @@ -232,7 +232,7 @@ parallelization strategy Also check
rnd_var_lns, scheduling_precedences_lns, violation_ls]
- 3 helper subsolvers: [neighborhood_helper, synchronization_agent,
update_gap_integral]
- `solver.parameters.num_search_workers = 8`:
- `solver.parameters.num_workers = 8`:
- 6 full problem subsolvers: [default_lp, max_lp, no_lp, quick_restart,
quick_restart_no_lp, reduced_costs]
- 1 first solution subsolver: [fj_short_default]
Expand All @@ -242,7 +242,7 @@ parallelization strategy Also check
rnd_var_lns, scheduling_precedences_lns, violation_ls]
- 3 helper subsolvers: [neighborhood_helper, synchronization_agent,
update_gap_integral]
- `solver.parameters.num_search_workers = 12`:
- `solver.parameters.num_workers = 12`:
- 8 full problem subsolvers: [default_lp, lb_tree_search, max_lp, no_lp,
pseudo_costs, quick_restart, quick_restart_no_lp, reduced_costs]
- 3 first solution subsolvers: [fj_long_default, fj_short_default, fs_random]
Expand All @@ -252,7 +252,7 @@ parallelization strategy Also check
rnd_var_lns, scheduling_precedences_lns, violation_ls]
- 3 helper subsolvers: [neighborhood_helper, synchronization_agent,
update_gap_integral]
- `solver.parameters.num_search_workers = 16`:
- `solver.parameters.num_workers = 16`:
- 11 full problem subsolvers: [default_lp, lb_tree_search, max_lp, no_lp,
objective_lb_search, objective_shaving_search_no_lp, probing, pseudo_costs,
quick_restart, quick_restart_no_lp, reduced_costs]
Expand All @@ -264,7 +264,7 @@ parallelization strategy Also check
rnd_var_lns, scheduling_precedences_lns, violation_ls]
- 3 helper subsolvers: [neighborhood_helper, synchronization_agent,
update_gap_integral]
- `solver.parameters.num_search_workers = 20`:
- `solver.parameters.num_workers = 20`:
- 13 full problem subsolvers: [default_lp, lb_tree_search, max_lp, no_lp,
objective_lb_search, objective_shaving_search_max_lp,
objective_shaving_search_no_lp, probing, probing_max_lp, pseudo_costs,
Expand All @@ -277,7 +277,7 @@ parallelization strategy Also check
rnd_var_lns, scheduling_precedences_lns, violation_ls]
- 3 helper subsolvers: [neighborhood_helper, synchronization_agent,
update_gap_integral]
- `solver.parameters.num_search_workers = 32`:
- `solver.parameters.num_workers = 32`:
- 15 full problem subsolvers: [default_lp, lb_tree_search, max_lp, no_lp,
objective_lb_search, objective_lb_search_max_lp, objective_lb_search_no_lp,
objective_shaving_search_max_lp, objective_shaving_search_no_lp, probing,
Expand All @@ -293,7 +293,7 @@ parallelization strategy Also check
rnd_var_lns, scheduling_precedences_lns, violation_ls(3)]
- 3 helper subsolvers: [neighborhood_helper, synchronization_agent,
update_gap_integral]
- `solver.parameters.num_search_workers = 64`:
- `solver.parameters.num_workers = 64`:
- 15 full problem subsolvers: [default_lp, lb_tree_search, max_lp, no_lp,
objective_lb_search, objective_lb_search_max_lp, objective_lb_search_no_lp,
objective_shaving_search_max_lp, objective_shaving_search_no_lp, probing,
Expand Down Expand Up @@ -441,10 +441,8 @@ something. This log also includes the incomplete and first solution subsolvers.
but work heuristically. Notable strategies are large neighborhood search (LNS)
and feasibility pumps. The first one tries to find a better solution by changing
only a few variables, the second one tries to make infeasible/incomplete
solutions feasible. If you want to use more workers heuristically searching for
good solutions, you can specify `solver.parameters.min_num_lns_workers`. You can
also run only the incomplete subsolvers by setting
`solver.parameters.use_lns_only = True`, but this need to be combined with a
solutions feasible. You can also run only the incomplete subsolvers by setting
`solver.parameters.use_lns_only = True`, but this needs to be combined with a
time limit, as the incomplete subsolvers do not know when to stop.

**First solution subsolvers** are strategies that try to find a first solution
Expand Down
42 changes: 20 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1779,7 +1779,7 @@ You can control the parallelization of CP-SAT by setting the number of search
workers.

```python
solver.parameters.num_search_workers = 8 # use 8 cores
solver.parameters.num_workers = 8 # use 8 cores
```

Here the solvers used by CP-SAT 9.9 on different parallelization levels for an
Expand All @@ -1788,38 +1788,38 @@ strategies). Note that some parameters/constraints/objectives can change the
parallelization strategy Also check
[the official documentation](https://github.com/google/or-tools/blob/main/ortools/sat/docs/troubleshooting.md#improving-performance-with-multiple-workers).

- `solver.parameters.num_search_workers = 1`: Single-threaded search with
- `solver.parameters.num_workers = 1`: Single-threaded search with
`[default_lp]`.
- 1 full problem subsolver: [default_lp]
- `solver.parameters.num_search_workers = 2`: Additional use of heuristics to
support the `default_lp` search.
- `solver.parameters.num_workers = 2`: Additional use of heuristics to support
the `default_lp` search.
- 1 full problem subsolver: [default_lp]
- 13 incomplete subsolvers: [feasibility_pump, graph_arc_lns, graph_cst_lns,
graph_dec_lns, graph_var_lns, packing_precedences_lns,
packing_rectangles_lns, packing_slice_lns, rins/rens, rnd_cst_lns,
rnd_var_lns, scheduling_precedences_lns, violation_ls]
- 3 helper subsolvers: [neighborhood_helper, synchronization_agent,
update_gap_integral]
- `solver.parameters.num_search_workers = 3`: Using a second full problem solver
that does not try to linearize the model.
- `solver.parameters.num_workers = 3`: Using a second full problem solver that
does not try to linearize the model.
- 2 full problem subsolvers: [default_lp, no_lp]
- 13 incomplete subsolvers: [feasibility_pump, graph_arc_lns, graph_cst_lns,
graph_dec_lns, graph_var_lns, packing_precedences_lns,
packing_rectangles_lns, packing_slice_lns, rins/rens, rnd_cst_lns,
rnd_var_lns, scheduling_precedences_lns, violation_ls]
- 3 helper subsolvers: [neighborhood_helper, synchronization_agent,
update_gap_integral]
- `solver.parameters.num_search_workers = 4`: Additionally using a third full
problem solver that tries to linearize the model as much as possible.
- `solver.parameters.num_workers = 4`: Additionally using a third full problem
solver that tries to linearize the model as much as possible.
- 3 full problem subsolvers: [default_lp, max_lp, no_lp]
- 13 incomplete subsolvers: [feasibility_pump, graph_arc_lns, graph_cst_lns,
graph_dec_lns, graph_var_lns, packing_precedences_lns,
packing_rectangles_lns, packing_slice_lns, rins/rens, rnd_cst_lns,
rnd_var_lns, scheduling_precedences_lns, violation_ls]
- 3 helper subsolvers: [neighborhood_helper, synchronization_agent,
update_gap_integral]
- `solver.parameters.num_search_workers = 5`: Additionally using a first
solution subsolver.
- `solver.parameters.num_workers = 5`: Additionally using a first solution
subsolver.
- 3 full problem subsolvers: [default_lp, max_lp, no_lp]
- 1 first solution subsolver: [fj_short_default]
- 13 incomplete subsolvers: [feasibility_pump, graph_arc_lns, graph_cst_lns,
Expand All @@ -1828,7 +1828,7 @@ parallelization strategy Also check
rnd_var_lns, scheduling_precedences_lns, violation_ls]
- 3 helper subsolvers: [neighborhood_helper, synchronization_agent,
update_gap_integral]
- `solver.parameters.num_search_workers = 6`: Using a fourth full problem solver
- `solver.parameters.num_workers = 6`: Using a fourth full problem solver
`quick_restart` that does more "probing".
- 4 full problem subsolvers: [default_lp, max_lp, no_lp, quick_restart]
- 1 first solution subsolver: [fj_short_default]
Expand All @@ -1838,7 +1838,7 @@ parallelization strategy Also check
rnd_var_lns, scheduling_precedences_lns, violation_ls]
- 3 helper subsolvers: [neighborhood_helper, synchronization_agent,
update_gap_integral]
- `solver.parameters.num_search_workers = 7`:
- `solver.parameters.num_workers = 7`:
- 5 full problem subsolvers: [default_lp, max_lp, no_lp, quick_restart,
reduced_costs]
- 1 first solution subsolver: [fj_short_default]
Expand All @@ -1848,7 +1848,7 @@ parallelization strategy Also check
rnd_var_lns, scheduling_precedences_lns, violation_ls]
- 3 helper subsolvers: [neighborhood_helper, synchronization_agent,
update_gap_integral]
- `solver.parameters.num_search_workers = 8`:
- `solver.parameters.num_workers = 8`:
- 6 full problem subsolvers: [default_lp, max_lp, no_lp, quick_restart,
quick_restart_no_lp, reduced_costs]
- 1 first solution subsolver: [fj_short_default]
Expand All @@ -1858,7 +1858,7 @@ parallelization strategy Also check
rnd_var_lns, scheduling_precedences_lns, violation_ls]
- 3 helper subsolvers: [neighborhood_helper, synchronization_agent,
update_gap_integral]
- `solver.parameters.num_search_workers = 12`:
- `solver.parameters.num_workers = 12`:
- 8 full problem subsolvers: [default_lp, lb_tree_search, max_lp, no_lp,
pseudo_costs, quick_restart, quick_restart_no_lp, reduced_costs]
- 3 first solution subsolvers: [fj_long_default, fj_short_default, fs_random]
Expand All @@ -1868,7 +1868,7 @@ parallelization strategy Also check
rnd_var_lns, scheduling_precedences_lns, violation_ls]
- 3 helper subsolvers: [neighborhood_helper, synchronization_agent,
update_gap_integral]
- `solver.parameters.num_search_workers = 16`:
- `solver.parameters.num_workers = 16`:
- 11 full problem subsolvers: [default_lp, lb_tree_search, max_lp, no_lp,
objective_lb_search, objective_shaving_search_no_lp, probing, pseudo_costs,
quick_restart, quick_restart_no_lp, reduced_costs]
Expand All @@ -1880,7 +1880,7 @@ parallelization strategy Also check
rnd_var_lns, scheduling_precedences_lns, violation_ls]
- 3 helper subsolvers: [neighborhood_helper, synchronization_agent,
update_gap_integral]
- `solver.parameters.num_search_workers = 20`:
- `solver.parameters.num_workers = 20`:
- 13 full problem subsolvers: [default_lp, lb_tree_search, max_lp, no_lp,
objective_lb_search, objective_shaving_search_max_lp,
objective_shaving_search_no_lp, probing, probing_max_lp, pseudo_costs,
Expand All @@ -1893,7 +1893,7 @@ parallelization strategy Also check
rnd_var_lns, scheduling_precedences_lns, violation_ls]
- 3 helper subsolvers: [neighborhood_helper, synchronization_agent,
update_gap_integral]
- `solver.parameters.num_search_workers = 32`:
- `solver.parameters.num_workers = 32`:
- 15 full problem subsolvers: [default_lp, lb_tree_search, max_lp, no_lp,
objective_lb_search, objective_lb_search_max_lp, objective_lb_search_no_lp,
objective_shaving_search_max_lp, objective_shaving_search_no_lp, probing,
Expand All @@ -1909,7 +1909,7 @@ parallelization strategy Also check
rnd_var_lns, scheduling_precedences_lns, violation_ls(3)]
- 3 helper subsolvers: [neighborhood_helper, synchronization_agent,
update_gap_integral]
- `solver.parameters.num_search_workers = 64`:
- `solver.parameters.num_workers = 64`:
- 15 full problem subsolvers: [default_lp, lb_tree_search, max_lp, no_lp,
objective_lb_search, objective_lb_search_max_lp, objective_lb_search_no_lp,
objective_shaving_search_max_lp, objective_shaving_search_no_lp, probing,
Expand Down Expand Up @@ -2057,10 +2057,8 @@ something. This log also includes the incomplete and first solution subsolvers.
but work heuristically. Notable strategies are large neighborhood search (LNS)
and feasibility pumps. The first one tries to find a better solution by changing
only a few variables, the second one tries to make infeasible/incomplete
solutions feasible. If you want to use more workers heuristically searching for
good solutions, you can specify `solver.parameters.min_num_lns_workers`. You can
also run only the incomplete subsolvers by setting
`solver.parameters.use_lns_only = True`, but this need to be combined with a
solutions feasible. You can also run only the incomplete subsolvers by setting
`solver.parameters.use_lns_only = True`, but this needs to be combined with a
time limit, as the incomplete subsolvers do not know when to stop.

**First solution subsolvers** are strategies that try to find a first solution
Expand Down

0 comments on commit 10b5ace

Please sign in to comment.