Skip to content

Commit

Permalink
CHORES: pre-commit
Browse files Browse the repository at this point in the history
  • Loading branch information
d-krupke committed Apr 29, 2024
1 parent a240b5f commit bce6727
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 21 deletions.
48 changes: 28 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,14 +122,15 @@ awaits you in this primer:
---


<!-- This file was generated by the `build.py` script. Do not edit it manually. -->
<!-- 01_installation.md -->
<!-- EDIT THIS PART VIA 01_installation.md -->

## Installation

<a name="01-installation"></a>

## Installation

We are using Python 3 in this primer and assume that you have a working Python 3
installation as well as the basic knowledge to use it. There are also interfaces
for other languages, but Python 3 is, in my opinion, the most convenient one, as
Expand Down Expand Up @@ -190,14 +191,15 @@ For further guidance, consider the
which are likely to be similar. Since we frequently use Gurobi in addition to
CP-SAT, our hardware choices were also influenced by their recommendations.


<!-- This file was generated by the `build.py` script. Do not edit it manually. -->
<!-- 02_example.md -->
<!-- EDIT THIS PART VIA 02_example.md -->

## Example

<a name="02-example"></a>

## Example

Before we dive into any internals, let us take a quick look at a simple
application of CP-SAT. This example is so simple that you could solve it by
hand, but know that CP-SAT would (probably) be fine with you adding a thousand
Expand Down Expand Up @@ -390,16 +392,15 @@ very good at that).

---


<!-- This file was generated by the `build.py` script. Do not edit it manually. -->
<!-- 03_big_picture.md -->
<!-- EDIT THIS PART VIA 03_big_picture.md -->

<a name="section-alternatives"></a>
<a name="section-alternatives"></a> <a name="03-big-picture"></a>

## Alternatives: CP-SAT's Place in the World of Optimization

<a name="03-big-picture"></a>

When you begin exploring optimization, you will encounter a plethora of tools,
techniques, and communities. It can be overwhelming, as these groups, while
sharing many similarities, also differ significantly. They might use the same
Expand Down Expand Up @@ -563,14 +564,15 @@ open-source tool.

---


<!-- This file was generated by the `build.py` script. Do not edit it manually. -->
<!-- 04_modelling.md -->
<!--EDIT THIS PART VIA 04_modelling.md -->

## Modelling

<a name="04-modelling"></a>

## Modelling

CP-SAT provides us with much more modelling options than the classical
MIP-solver. Instead of just the classical linear constraints (<=, ==, >=), we
have various advanced constraints such as `AllDifferent` or
Expand Down Expand Up @@ -1714,14 +1716,15 @@ If you need more, you can check out the

---


<!-- This file was generated by the `build.py` script. Do not edit it manually. -->
<!-- 05_parameters.md -->
<!-- EDIT THIS PART VIA 05_parameters.md -->

## Parameters

<a name="05-parameters"></a>

## Parameters

The CP-SAT solver has a lot of parameters to control its behavior. They are
implemented via
[Protocol Buffer](https://developers.google.com/protocol-buffers) and can be
Expand Down Expand Up @@ -2234,15 +2237,15 @@ some conflicts.
---


<!-- This file was generated by the `build.py` script. Do not edit it manually. -->
<!-- 06_coding_patterns.md -->

<!-- EDIT THIS PART VIA 06_coding_patterns.md -->

## Coding Patterns for Optimization Problems

<a name="06-coding-patterns"></a>

## Coding Patterns for Optimization Problems

In this section, we will explore various coding patterns that are essential for
structuring implementations for optimization problems using CP-SAT. While we
will not delve into the modeling of specific problems, our focus will be on
Expand Down Expand Up @@ -2906,14 +2909,15 @@ class KnapsackSolver:

---


<!-- This file was generated by the `build.py` script. Do not edit it manually. -->
<!-- 07_under_the_hood.md -->
<!-- EDIT THIS PART VIA 07_under_the_hood.md -->

## How does it work?

<a name="07-under-the-hood"></a>

## How does it work?

CP-SAT is a versatile _portfolio_ solver, centered around a _Lazy Clause
Generation (LCG)_ based Constraint Programming Solver, although it encompasses a
broader spectrum of technologies.
Expand Down Expand Up @@ -3093,14 +3097,15 @@ At times, NP-hard problems inherently pose formidable challenges, leaving us
with no alternative but to seek more manageable modeling approaches instead of
looking for better solvers.


<!-- This file was generated by the `build.py` script. Do not edit it manually. -->
<!-- 08_benchmarking.md -->
<!-- EDIT THIS PART VIA 08_benchmarking.md -->

## Benchmarking your Model

<a name="08-benchmarking"></a>

## Benchmarking your Model

Benchmarking is an essential step if your model is not yet meeting the
performance standards of your application or if you are aiming for an academic
publication. This process involves analyzing your model's performance,
Expand Down Expand Up @@ -3506,14 +3511,15 @@ and nice plots on which we can base our decisions.
> [Algorithm Selection](https://en.wikipedia.org/wiki/Algorithm_selection)
> problem and can be surprisingly complex, too.

<!-- This file was generated by the `build.py` script. Do not edit it manually. -->
<!-- 09_lns.md -->
<!-- EDIT THIS PART VIA 08_lns.md -->

## Using CP-SAT for Bigger Problems with Large Neighborhood Search

<a name="09-lns"></a>

## Using CP-SAT for Bigger Problems with Large Neighborhood Search

CP-SAT is great at solving small and medium-sized problems. But what if you have
a really big problem on your hands? One option might be to use a special kind of
algorithm known as a "meta-heuristic", like a
Expand Down Expand Up @@ -3790,3 +3796,5 @@ aware of the exploration vs. exploitation dilemma and that many smart people
have already thought about it.

> TODO: Continue...

2 changes: 1 addition & 1 deletion build.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ def convert_for_mdbook(content):
with open(file, "r") as current_file:
content = current_file.read()
f.write(disclaimer)
f.write(f"<!-- {file}" + " -->\n")
f.write(f"<!-- {file} -->\n")
f.write(content)
f.write("\n\n")
Path("./.mdbook/").mkdir(parents=True, exist_ok=True)
Expand Down

0 comments on commit bce6727

Please sign in to comment.