diff --git a/00_intro.md b/00_intro.md index 2ed4808..96a869e 100644 --- a/00_intro.md +++ b/00_intro.md @@ -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) diff --git a/04_modelling.md b/04_modelling.md index 41559ac..68fa1aa 100644 --- a/04_modelling.md +++ b/04_modelling.md @@ -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 diff --git a/05_parameters.md b/05_parameters.md index deff57e..d9fefcf 100644 --- a/05_parameters.md +++ b/05_parameters.md @@ -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 diff --git a/README.md b/README.md index 6717632..1ce5d5c 100644 --- a/README.md +++ b/README.md @@ -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) @@ -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 @@ -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 diff --git a/build.py b/build.py index 60e701f..b5528b1 100644 --- a/build.py +++ b/build.py @@ -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"\(#(.*?)\)", @@ -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 diff --git a/images/logo_1.webp b/images/logo_1.webp new file mode 100644 index 0000000..3c8d6f9 Binary files /dev/null and b/images/logo_1.webp differ diff --git a/images/logo_2.webp b/images/logo_2.webp new file mode 100644 index 0000000..2e6d20b Binary files /dev/null and b/images/logo_2.webp differ diff --git a/images/logo_3.webp b/images/logo_3.webp new file mode 100644 index 0000000..3145214 Binary files /dev/null and b/images/logo_3.webp differ