{"id":28637356,"url":"https://github.com/strilanc/unionfind-.net","last_synced_at":"2025-06-12T18:10:36.641Z","repository":{"id":14480492,"uuid":"17192914","full_name":"Strilanc/UnionFind-.Net","owner":"Strilanc","description":"A simple implementation of a disjoint set data structure in C#.","archived":false,"fork":false,"pushed_at":"2014-02-26T06:45:39.000Z","size":136,"stargazers_count":6,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-04-14T23:21:38.731Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"unlicense","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Strilanc.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}},"created_at":"2014-02-26T00:07:48.000Z","updated_at":"2020-11-10T00:13:02.000Z","dependencies_parsed_at":"2022-09-23T03:10:36.639Z","dependency_job_id":null,"html_url":"https://github.com/Strilanc/UnionFind-.Net","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Strilanc/UnionFind-.Net","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Strilanc%2FUnionFind-.Net","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Strilanc%2FUnionFind-.Net/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Strilanc%2FUnionFind-.Net/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Strilanc%2FUnionFind-.Net/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Strilanc","download_url":"https://codeload.github.com/Strilanc/UnionFind-.Net/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Strilanc%2FUnionFind-.Net/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259518828,"owners_count":22870304,"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-06-12T18:10:35.755Z","updated_at":"2025-06-12T18:10:36.622Z","avatar_url":"https://github.com/Strilanc.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"Installation\n============\n\n1. Copy the source file `UnionFindNode.cs` into your project.\n\nAlgorithm\n=========\n\nThe algorithm is sourced from [wikipedia's disjoint set data structure article](http://en.wikipedia.org/wiki/Union_find). Operations take amortized nearly constant time.\n\nUsage\n=====\n\nIn the class that you want to union together, add a field of type `UnionFindNode`. Initialize the node, either eagerly when the class is constructed or lazily just before it is needed, then perform operations on it.\n\nFor example, suppose we have a `FancyGraphNode` to which edges can be added but not removed. We want to track if nodes are in the same connected component. We can:\n\n1. Add the field `private readonly UnionFindNode _connectedComponentNode = new UnionFindNode()` to `FancyGraphNode`.\n2. When adding an edge, call `edge.Node1._connectedComponentNode.Union(edge.Node2._connectedComponentNode)`.\n3. To determine if two nodes are in the same component, evaluate `edge.Node1._connectedComponentNode.IsUnionedWith(edge.Node2._connectedComponentNode)`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstrilanc%2Funionfind-.net","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstrilanc%2Funionfind-.net","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstrilanc%2Funionfind-.net/lists"}