{"id":22366706,"url":"https://github.com/vaeth/hamming","last_synced_at":"2025-06-14T09:06:39.129Z","repository":{"id":141994195,"uuid":"413556373","full_name":"vaeth/hamming","owner":"vaeth","description":null,"archived":false,"fork":false,"pushed_at":"2021-10-10T19:59:42.000Z","size":297,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-06-14T09:06:28.334Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/vaeth.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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}},"created_at":"2021-10-04T19:25:20.000Z","updated_at":"2021-10-10T19:58:40.000Z","dependencies_parsed_at":null,"dependency_job_id":"c13300a9-f5d1-4ce3-b8a6-8bba665136b6","html_url":"https://github.com/vaeth/hamming","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/vaeth/hamming","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vaeth%2Fhamming","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vaeth%2Fhamming/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vaeth%2Fhamming/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vaeth%2Fhamming/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vaeth","download_url":"https://codeload.github.com/vaeth/hamming/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vaeth%2Fhamming/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259790455,"owners_count":22911547,"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":"2024-12-04T18:15:16.925Z","updated_at":"2025-06-14T09:06:39.124Z","avatar_url":"https://github.com/vaeth.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# hamming\n\n(C) Martin Väth (martin at mvath.de)\n\nThis project is under the Creative Commons CC-BY-4.0 license.\nSPDX-License-Identifier: CC-BY-4.0\n\n## Find a minimal covering of a Hamming hypercube with a given Hamming distance\n\nThe reason for this project is a challenge from\nRainer Rosenthal \u003cr.rosenthal at web.de\u003e in de.sci.mathematik:\n\nTo find a minimal set of binary lists of length 11 such that the Hamming\ndistance to every other binary list of length 11 is at most 3.\n\nIn other words: The challenge is to find a minimal covering of the hypercube\n(of dimension 11) with “balls” of Hamming distance 3.\n\nThis is a backtracking algorithm for the problem with some heuristics.\n\nThe constants 11 and 3 above are hardcoded java constants which can easily be\nmodified in the source code.\n\nTo compile the code just call\n```\njavac Hamming.java\n```\nwith a java 8 compiler. No dependencies are needed.\n\nAfter that the usage is\n```\njava Hamming maxSize overlap stopOverlapLevel showLevel [point...] [LevelX=Y...]\n```\nor\n```\n```\nExplanations of the parameters:\n\n1. `maxSize` denotes the maximal list sizes to output. After this size the\n    backtracking is pruned. For the given problem (of dimension 11 and\n    Hamming distance 8) it is known that there are solutions of size 16,\n    so any larger results than 16 are probably uninteresting and you should\n    therefore use 16 (or 15 if you are coutageous and want to risk to see no\n    output).\n2. `overlap` is a heuristic used to prune the backtracking further:\n   First, only points are considered whose Hamming balls of radius 3 have the\n   *minimal* intersection with the Hamming neighborhood of distance 3 of the\n   previous points. If `overlap` is n \u003e 0, then as next heuristic pruning steps\n   only points are considered whose Hamming balls of radius 3+1 ... 3+n\n   (starting with 3+1) have *maximal* intersection with the Hamming\n   neighborhood of distance 3 of the previous points. The intuition is that\n   these balls are as disjoint of the previous balls but “share maximal sides”\n   or “form maximal clusters” with the previous balls. If `overlap` is n = 0,\n   then only the first heuristic is used. It does probably not make sense to\n   specify any value larger than 3 - 1 = 2.\n3. `stopOverlapLevel` is the solution size at which only the first heuristic\n   is used.\n4. `showLevel` is an indicator how much progress information you want to see:\n   After that the solution size that backtracking algorithm works without any\n   progress information output. Otherwise, at each step in each level a\n   progress indicator is printed (incl. how many steps will be contained in\n   the main loop of this level.)\n5. `point` can be specified to pre-fill certain solution data. By default, the\n   point `000...0` is always auto-included in the list of points to be used,\n   but you can add more to force a specific type of solution:\n   You can simply add other “solution” points in binary notation.\n6. The `Level` arguments describe where the algorithm should start. If not\n   specified, every level starts at attempt 1, but you can specify a higher\n   number to skip some attempts at this level. For instance, the arguments\n   `Level5=2 Level6=5` mean that the algorithm should start in levels 1-4\n   with the first attempt, but in level 5 with the second attempt and inside\n   this second attempt in level 6 with the 5th attempt.\n\nA good call for trying is\n```\njava Hamming 16 1 9 9\n```\nor\n```\njava Hamming 16 2 9 9\n```\nwhich will soon output a lot of solutions of size 16.\n\nPlease inform the author, if you manage to find a smaller solution.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvaeth%2Fhamming","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvaeth%2Fhamming","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvaeth%2Fhamming/lists"}