{"id":24482123,"url":"https://github.com/tylerbloom/cyclemap","last_synced_at":"2026-02-28T13:12:11.410Z","repository":{"id":62444348,"uuid":"460074434","full_name":"TylerBloom/CycleMap","owner":"TylerBloom","description":"A structure for mapping multiple hash sets together","archived":false,"fork":false,"pushed_at":"2025-01-04T18:36:03.000Z","size":264,"stargazers_count":6,"open_issues_count":3,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-10T08:11:56.832Z","etag":null,"topics":["hashmap","hashtable","rust","rust-lang","rust-library"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/TylerBloom.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}},"created_at":"2022-02-16T15:58:40.000Z","updated_at":"2024-12-11T02:11:20.000Z","dependencies_parsed_at":"2024-12-24T02:25:21.065Z","dependency_job_id":"d029a9c0-2353-43e9-a8dc-2694ab3d4d79","html_url":"https://github.com/TylerBloom/CycleMap","commit_stats":null,"previous_names":["tylerbloom/doublemap"],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TylerBloom%2FCycleMap","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TylerBloom%2FCycleMap/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TylerBloom%2FCycleMap/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TylerBloom%2FCycleMap/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TylerBloom","download_url":"https://codeload.github.com/TylerBloom/CycleMap/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248747427,"owners_count":21155448,"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":["hashmap","hashtable","rust","rust-lang","rust-library"],"created_at":"2025-01-21T12:12:29.648Z","updated_at":"2026-02-28T13:12:11.317Z","avatar_url":"https://github.com/TylerBloom.png","language":"Rust","readme":"[![Crates.io](https://img.shields.io/crates/v/cycle_map.svg)](https://crates.io/crates/cycle_map)\n[![Documentation](https://docs.rs/cycle_map/badge.svg)](https://docs.rs/cycle_map/)\n![GitHub Workflows](https://github.com/TylerBloom/CycleMap/actions/workflows/ci.yml/badge.svg)\n[![Coverage Status](https://codecov.io/gh/TylerBloom/CycleMap/branch/main/graph/badge.svg)](https://codecov.io/gh/TylerBloom/CycleMap)\n![Maintenance](https://img.shields.io/badge/Maintenance-Actively%20Developed-brightgreen.svg)\n\n## About\nCycleMap provides several \"double-sided\" hash maps that associate items\nbetween two sets. It does this without keep duplicate data and while\nmaintaining lookup speeds on par with the standard\n[HashMap](https://crates.io/crates/hashbrown).\n\nThere are many ways that you might want to map items between sets.\nCycleMap supports three.\n - Bijective maps: every item in both sets is paired, and paired with\n \t exactly one other item\n - Partial bijective maps: items in either set don't have to be paired,\n \t but any paired item is paired with exactly one other item\n - (Weakly) Surjective maps: every item in the left set is paired with\n \t exactly one right item, and items in the right set can be paired with\n \t multiple (or no) items from the left set\n\n## How it Works\nEach map contains two sets, a left set and a right set. When two items\nare paired, they form a cycle. That is, an item from either set can be\nused to uniquely lookup the item(s) it is paired with. This forms a\ncyclic lookup and is the core algorithm that underlies all cycle maps. \n\nInstead of holding self-referential pointers, all cycle maps pair an\nitem with the hash of its partner item (and an id). This prevents\npossible unforeseen memory bugs and makes map resizing faster since an\nitem doesn't need to \"know\" *where* its partner is but rather *how* to\nget there.\n\n## Why use \nCycle maps aren't meant to replace the standard hashmap. In fact, they\nare built on top of it. Rather, they provide a clean solution to fast,\nbi-direction lookups.\n\nIf you find yourself creating workarounds to these sorts of problems,\ngive a cycle map a try.\n\n## Contribution\nIf you want to contribute to or improve upon this library, please do so.\nFork this project or submit an issue or a pull request for a\nfeature/fix/change/etc. All that I ask is for derived/iterative\nlibraries to be open and free to use and ideally with the same license\n(LGPL v3). Any other application or library that uses this library can\nuse any license.\n\n## Future Plans\nThe `CycleMap` struct has a counterpart, `PartialCycleMap`. This struct\nlooses the requirements of the `CycleMap` by allowing unpaired items in\neither set. A similar `PartialGroupMap` struct is planned to mirror the\n`GroupMap` struct.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftylerbloom%2Fcyclemap","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftylerbloom%2Fcyclemap","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftylerbloom%2Fcyclemap/lists"}