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.
README.md
The checks and how to submit
The checks run the judge in checks/judge/ at the project's approved version, with your pushed commit as input, so a
route cannot change how it is judged. The judge is plain Python 3 with no dependencies: run it yourself before you push,
python3 checks/judge/check.py routes/<branch>, and rerun its own tests with python3 -I checks/test_judge.py.
Files
constructions/<instance>.json: the record configuration of each instance, in the submission format, with asourcekey saying where it comes from.tools/check_format.py: checks that files follow the submission format; it computes no areas.
Submission format
- Files. A candidate is a file whose name ends in
.json, anywhere in your route's folderroutes/<branch>/, whose content is a JSON object with the keys"container","n"and"points"; other keys are ignored. A.jsonfile whose content is not an object with"points"is not a candidate and is ignored, but a.jsonfile that is not valid JSON fails the check. Keep each file under 1 MB. "container":"square"or"triangle"."n": a JSON integer from 20 to 36."points": a list of exactlynpoints. Each point is a list[x, y]of two strings, each a plain decimal as the tables accept coordinates: an optional sign, at most 6 digits before the point and 200 after, no exponent ("0","0.125","0.041156363310095543088824043693"). It is read as the exact rational it denotes. JSON numbers, fractions and exponents are not accepted. Every point must lie in its container, exactly. To round a coordinate, truncate it toward zero: that keeps a point inside.- Value. As in the problem, computed exactly over all triples of points.
- Score. For each instance, the route's best value divided by its record; an instance where the route has nothing
better than the record counts as 1. The score is the mean of the 34 ratios, higher is better: the records score
exactly 1, and a route scores above 1 exactly when it holds a value above some record.
verifywrites it tometrics.jsonasscore(a float) andscore_exact(the exact fraction), with each instance's best value insubtasksand the instances above their records by more than the threshold innew_records.
How to check and submit
- Check a folder before you push:
python3 tools/check_format.py routes/<branch>. - Push your work to your route. Two checks run on every push:
verifychecks every candidate in your route's folder exactly. It prints one line per candidate,<instance>: <value> (<file>), <gain> against the record, ending; a new recordwhen the value exceeds the record by more than the threshold, then the score and the new records. It fails if a.jsonfile is unreadable or a candidate is malformed; a route with no candidate passes with "no candidates to check". Onmainit also readsconstructions/.improvesonly informs: it never blocks a merge. For each instance your route has, it prints your best against the bestmainholds (inconstructions/androutes/) and says whether it is a new record. It passes when, for some instance, your best exceedsmain's by more than a relative .
- Open a pull request into
mainwhenimprovespasses: the site's maintainer takes improvements in. Any other result, such as a method that others can reuse or a negative result, is judged by review: say in your route's notes exactly what you claim and how to check it.
