{"id":16646638,"url":"https://github.com/alexdelorenzo/disjoint_set","last_synced_at":"2025-04-09T16:05:58.710Z","repository":{"id":11999296,"uuid":"14577483","full_name":"alexdelorenzo/disjoint_set","owner":"alexdelorenzo","description":"Union find / disjoint union set","archived":false,"fork":false,"pushed_at":"2022-04-17T00:41:53.000Z","size":65,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-09T16:05:35.508Z","etag":null,"topics":["algorithms","data-structures","disjoint-set","disjoint-sets","disjoint-unions","python"],"latest_commit_sha":null,"homepage":"","language":"Python","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/alexdelorenzo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"github":["alexdelorenzo"]}},"created_at":"2013-11-21T04:11:46.000Z","updated_at":"2024-10-11T07:44:43.000Z","dependencies_parsed_at":"2022-09-11T21:51:13.598Z","dependency_job_id":null,"html_url":"https://github.com/alexdelorenzo/disjoint_set","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexdelorenzo%2Fdisjoint_set","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexdelorenzo%2Fdisjoint_set/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexdelorenzo%2Fdisjoint_set/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexdelorenzo%2Fdisjoint_set/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alexdelorenzo","download_url":"https://codeload.github.com/alexdelorenzo/disjoint_set/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248065289,"owners_count":21041871,"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":["algorithms","data-structures","disjoint-set","disjoint-sets","disjoint-unions","python"],"created_at":"2024-10-12T08:42:42.444Z","updated_at":"2025-04-09T16:05:58.689Z","avatar_url":"https://github.com/alexdelorenzo.png","language":"Python","funding_links":["https://github.com/sponsors/alexdelorenzo"],"categories":[],"sub_categories":[],"readme":"# Disjoint Union\n\nImplementation of the union find algorithm. This library will work with all hashable objects.\n\n# Installation\n\n## PyPI\n\n```bash\npython3 -m pip install disjoint_union\n```\n\n# Usage\n`DisjointUnion` is a subclass of `list` and can be instantiated by passing it an iterable. \n\nYou can use the `|` and `+` operators on a `DisjointUnion` to create a new `DisjointUnion`, or you can mutate the original union using the `|=` and `+=` assignment operators, or the `union(x, y)` and `unions(*iterable)` methods. \n\n```python3\nIn [1]: from disjoint_union import DisjointUnion\nIn [2]: d = DisjointUnion(range(5))\nIn [3]: d\nOut[3]: [{0, 1, 2, 3, 4}]\n\nIn [4]: d | range(6, 10)\nOut[4]: [{0, 1, 2, 3, 4}, {6, 7, 8, 9}]\n\nIn [5]: d |= range(6, 10)\nIn [6]: d\nOut[6]: [{0, 1, 2, 3, 4}, {6, 7, 8, 9}]\n\nIn [7]: d.union(2, 5)\nOut[7]: [{0, 1, 2, 3, 4, 5}, {6, 7, 8, 9}]\n\nIn [8]: d |= (5, 6)\nIn [9]: d\nOut[9]: [{0, 1, 2, 3, 4, 5, 6, 7, 8, 9}]\n\nIn [10]: d |= range(10, 15)\nIn [11]: d\nOut[11]: [{0, 1, 2, 3, 4, 5, 6, 7, 8, 9}, {10, 11, 12, 13, 14}]\n\nIn [12]: d | (9, 10, 15)\nOut[12]: [{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15}]\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falexdelorenzo%2Fdisjoint_set","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falexdelorenzo%2Fdisjoint_set","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falexdelorenzo%2Fdisjoint_set/lists"}