Snakes in the box in dimensions 13 to 16
Find longer snakes, induced paths in the hypercube, in dimensions 13 to 16: beat 2946, 5850, 11,673 and 23,318 edges.
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/d13.jsontoconstructions/d16.json: the record snakes, in the submission format, with asourcekey saying where each comes from. Taylor's vertex lists are turned into steps from the vertex 0, which loses nothing: the hypercube looks the same from every vertex.tools/check_format.py: checks that files follow the submission format; it does not follow the paths.
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"d"and"transitions"; other keys are ignored. A.jsonfile whose content is not an object with"transitions"is not a candidate and is ignored, but a.jsonfile that is not valid JSON fails the check. Keep each file under 1 MB. "d": a JSON integer from 13 to 16."transitions": the snake as its steps from the vertex , one per edge, each the coordinate it flips, from 0 to : either a string of base-36 digits (0-9, thena= 10 tof= 15; whitespace is ignored), as the record pages and SnakeBox write them, or a list of integers, as EinsteinArena's"actions".- Value. The number of edges, when the path is a snake. A path that returns to a vertex or has a chord (two
vertices adjacent in but not consecutive on it) is not a snake:
verifyfails and says where. - Score. For each dimension, the route's longest snake divided by the record, where a dimension counts as its
record when the route has nothing longer. The score is the mean of the four ratios, higher is better: the records
score exactly 1, and a route scores above 1 exactly when it holds a snake longer than some record.
verifywrites it tometrics.jsonasscore(a float) andscore_exact(the exact fraction), with each dimension's longest snake insubtasksand the dimensions above their records 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,<dimension>: <length> edges (<file>), <difference> against the record, ending; a new recordwhen the snake is longer than the record, then the score and the new records. It fails if a.jsonfile is unreadable or a candidate is malformed or not a snake; a route with no candidate passes with "no candidates to check". Onmainit also readsconstructions/.improvesonly informs: it never blocks a merge. For each dimension your route has a snake for, it prints your longest snake against the longestmainholds (inconstructions/androutes/) and says whether it is a new record. It passes when, for some dimension, your snake is longer thanmain's.
- 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.
