{"id":29358185,"url":"https://github.com/average-user/happy-ending","last_synced_at":"2025-07-09T06:09:08.336Z","repository":{"id":303191504,"uuid":"559024163","full_name":"Average-user/happy-ending","owner":"Average-user","description":"Implementation of the algorithm described in Computer solution to the 17-point Erdős-Szekeres problem","archived":false,"fork":false,"pushed_at":"2022-11-04T13:45:01.000Z","size":25,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-06T08:43:59.946Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Average-user.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2022-10-28T21:12:21.000Z","updated_at":"2022-12-15T17:18:49.000Z","dependencies_parsed_at":"2025-07-06T08:54:03.760Z","dependency_job_id":null,"html_url":"https://github.com/Average-user/happy-ending","commit_stats":null,"previous_names":["average-user/happy-ending"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Average-user/happy-ending","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Average-user%2Fhappy-ending","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Average-user%2Fhappy-ending/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Average-user%2Fhappy-ending/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Average-user%2Fhappy-ending/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Average-user","download_url":"https://codeload.github.com/Average-user/happy-ending/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Average-user%2Fhappy-ending/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264403827,"owners_count":23602623,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-07-09T06:08:58.666Z","updated_at":"2025-07-09T06:09:08.329Z","avatar_url":"https://github.com/Average-user.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"Implementation of the algorithm described in _Computer solution to the\n17-point Erdős-Szekeres problem_, to show that any set of 17 points in\nthe plane in general position has a convex hexagon. See [Happy ending\nproblem (Wikipedia)](https://en.wikipedia.org/wiki/Happy_ending_problem).\n\n## Explanation of the problem.\n\nTake an integer `k`. Does there exists another integer `n` such that\nany set of `n` points in the plane in general position (no three\npoints in the same line) contains a convex k-agon (a subset of `k`\npoints which forms a convex polygon)? \u003cbr\u003e The answer is _yes_, as can\nbe proven by an application of\n[Ramsey's theorem](https://en.wikipedia.org/wiki/Ramsey's_theorem). Define\n`f(k)` to be the least such `n`.\n\n`f(4) = 5`: clearly a triangle with a single point inside is a\nconfiguration in general position with `4` points and no convex\nquadrilateral, so `f(4) \u003e= 5`. Take any configuration of five points\nin general position, and draw all possible edges between two\npoints. Since [`K_5`](https://en.wikipedia.org/wiki/Complete_graph) is\nnot a planar graph, there are two edges that cross. Their endpoints\nform a convex quadrilateral, so `f(4) \u003c= 5`.\n\nErdős and Szekeres proved that `f(k) \u003e= 2^(k-2) + 1` for all `k \u003e= 3`\nand conjectured that equality holds always. `f(5) = 9` can be proved\nby brute search rather effortlessly, and the mentioned paper proves\n`f(6) = 17`. As time of writing, the conjecture is open and no values\nof `f` are known for `k \u003e 6`.\n\n## Results.\n\n(See section 4 of the paper to understand this)\n\nTo derive a contradiction from each of the `446` signatures in\n`omega*` (which we call simply omega) which start by `1` we do not\nperform the `U_13` check, but rather perform `one-`, `two-` and\n`three-bit-check`.\n\nThe number of assignments that survived the `one-`, `two-` and\n`three-bit-check` respectively are `63181`, `18` and `0` respectively,\nthus establishing the desired result. A table of all the information\ncan be found in [results.txt](https://github.com/Average-user/happy-ending/blob/main/results.txt),\nwhere each entry is of the form `idx\n1bc 2bc 3bc t`. `idx` is the signature's index, which is just the\ndecimal representation of the binary number obtained by replacing each\n`-1` in the signature by a `0` (recall that a signature is a vector of\n`1`s and `-1`s). `1bc` is the number of partial assignments\ninitialized with the given signature that survived the\n`one-bit-check`. Similarly for `2bc` and `3bc`. Finally `t` is the\ntime in hours that took to derive a contradiction from the particular\nsignature. There were only five signatures for which it was necessary\nto run the `three-bit-check` to derive a contradiction:\n\n``` text\n 820242    33  3  0   0.58\n 825179    27  3  0   0.55\n 983040  4554  6  0  16.86\n 983055  7664  3  0  18.39\n1015809    39  3  0   0.70\n```\nSo the first entry specifies that for the signature with index\n`820242`, there were `33` partial assignments that survived after\nthe `one-bit-check`, `3` after the `two-bit-check` and none survived\nafter the `three-bit-check`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faverage-user%2Fhappy-ending","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faverage-user%2Fhappy-ending","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faverage-user%2Fhappy-ending/lists"}