Skip to content

Commit

Permalink
Adding some cover images to make it a little more fun... I chose the …
Browse files Browse the repository at this point in the history
…playpus because like CP-SAT combines many techniques, the platypus combines various animals.
  • Loading branch information
d-krupke committed May 9, 2024
1 parent 0140b77 commit c5b8f0c
Show file tree
Hide file tree
Showing 8 changed files with 21 additions and 3 deletions.
2 changes: 2 additions & 0 deletions 00_intro.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

# Using and Understanding OR-Tools' CP-SAT: A Primer and Cheat Sheet

![Cover Image](./images/logo_1.webp)

_By [Dominik Krupke](https://krupke.cc), TU Braunschweig_

Many [combinatorially difficult](https://en.wikipedia.org/wiki/NP-hardness)
Expand Down
2 changes: 2 additions & 0 deletions 04_modelling.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

## Modelling

![Cover Image Modelling](./images/logo_2.webp)

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
2 changes: 2 additions & 0 deletions 05_parameters.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

## Parameters

![Cover Image Parameters](./images/logo_3.webp)

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
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

# Using and Understanding OR-Tools' CP-SAT: A Primer and Cheat Sheet

![Cover Image](./images/logo_1.webp)

_By [Dominik Krupke](https://krupke.cc), TU Braunschweig_

Many [combinatorially difficult](https://en.wikipedia.org/wiki/NP-hardness)
Expand Down Expand Up @@ -570,6 +572,8 @@ in many - is remarkable for a tool that is both free and open-source.

## Modelling

![Cover Image Modelling](./images/logo_2.webp)

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 @@ -1768,6 +1772,8 @@ If you need more, you can check out the

## Parameters

![Cover Image Parameters](./images/logo_3.webp)

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
12 changes: 9 additions & 3 deletions build.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,7 @@ def convert_for_mdbook(content):
# you have to replace the `#` with `./` and `-` with `_`, and attach `.md` at the end.
def replace_relative(match):
md_path = match.group(1).replace("-", "_") + ".md"
if Path(md_path).exists():
return f"(./{md_path})"
return f"(#{match.group(1)})"
return f"(./{md_path})" if Path(md_path).exists() else f"(#{match.group(1)})"

content = re.sub(
r"\(#(.*?)\)",
Expand Down Expand Up @@ -67,6 +65,14 @@ def replace_relative(match):
),
content,
)
content = re.sub(
r"\((.*?\.webp)\)",
lambda match: match.group(0).replace(
"https://github.com/d-krupke/cpsat-primer/blob/main/",
"https://raw.githubusercontent.com/d-krupke/cpsat-primer/main/",
),
content,
)

content += footer
return content
Expand Down
Binary file added images/logo_1.webp
Binary file not shown.
Binary file added images/logo_2.webp
Binary file not shown.
Binary file added images/logo_3.webp
Binary file not shown.

0 comments on commit c5b8f0c

Please sign in to comment.