Heilbronn's triangle problem: record configurations
Place n points in a square or triangle so the smallest triangle they form is as large as possible; beat a record or prove one optimal.
| 1 | # The checks and how to submit |
| 2 | |
| 3 | The checks run the judge in `checks/judge/` at the project's approved version, with your pushed commit as input, so a |
| 4 | route cannot change how it is judged. The judge is plain Python 3 with no dependencies: run it yourself before you push, |
| 5 | `python3 checks/judge/check.py routes/<branch>`, and rerun its own tests with `python3 -I checks/test_judge.py`. |
| 6 | |
| 7 | ## Files |
| 8 | |
| 9 | - `constructions/<instance>.json`: the record configuration of each instance, in the submission format, with a |
| 10 | `source` key saying where it comes from. |
| 11 | - `tools/check_format.py`: checks that files follow the submission format; it computes no areas. |
| 12 | |
| 13 | ## Submission format |
| 14 | |
| 15 | - **Files.** A candidate is a file whose name ends in `.json`, anywhere in your route's folder `routes/<branch>/`, whose |
| 16 | content is a JSON object with the keys `"container"`, `"n"` and `"points"`; other keys are ignored. A `.json` file |
| 17 | whose content is not an object with `"points"` is not a candidate and is ignored, but a `.json` file that is not valid |
| 18 | JSON fails the check. Keep each file under 1 MB. |
| 19 | - **`"container"`**: `"square"` or `"triangle"`. |
| 20 | - **`"n"`**: a JSON integer from 20 to 36. |
| 21 | - **`"points"`**: a list of exactly `n` points. Each point is a list `[x, y]` of two strings, each a plain decimal as |
| 22 | the tables accept coordinates: an optional sign, at most 6 digits before the point and 200 after, no exponent |
| 23 | (`"0"`, `"0.125"`, `"0.041156363310095543088824043693"`). It is read as the exact rational it denotes. JSON numbers, |
| 24 | fractions and exponents are not accepted. Every point must lie in its container, exactly. To round a coordinate, |
| 25 | truncate it toward zero: that keeps a point inside. |
| 26 | - **Value.** As in the problem, computed exactly over all triples of points. |
| 27 | - **Score.** For each instance, the route's best value divided by its record; an instance where the route has nothing |
| 28 | better than the record counts as 1. The score is the mean of the 34 ratios, higher is better: the records score |
| 29 | exactly 1, and a route scores above 1 exactly when it holds a value above some record. `verify` writes it to |
| 30 | `metrics.json` as `score` (a float) and `score_exact` (the exact fraction), with each instance's best value in |
| 31 | `subtasks` and the instances above their records by more than the threshold in `new_records`. |
| 32 | |
| 33 | ## How to check and submit |
| 34 | |
| 35 | - Check a folder before you push: `python3 tools/check_format.py routes/<branch>`. |
| 36 | - Push your work to your route. Two checks run on every push: |
| 37 | - **`verify`** checks every candidate in your route's folder exactly. It prints one line per candidate, |
| 38 | `<instance>: <value> (<file>), <gain> against the record`, ending `; a new record` when the value exceeds the |
| 39 | record by more than the threshold, then the score and the new records. It fails if a `.json` file is unreadable or |
| 40 | a candidate is malformed; a route with no candidate passes with "no candidates to check". On `main` it also reads |
| 41 | `constructions/`. |
| 42 | - **`improves`** only informs: it never blocks a merge. For each instance your route has, it prints your best |
| 43 | against the best `main` holds (in `constructions/` and `routes/`) and says whether it is a new record. It passes |
| 44 | when, for some instance, your best exceeds `main`'s by more than a relative $10^{-9}$. |
| 45 | - Open a pull request into `main` when `improves` passes: the site's maintainer takes improvements in. Any other |
| 46 | result, such as a method that others can reuse or a negative result, is judged by review: say in your route's notes |
| 47 | exactly what you claim and how to check it. |
