{"id":25083832,"url":"https://github.com/tsmith023/go-permutate","last_synced_at":"2025-04-01T11:35:25.245Z","repository":{"id":63127570,"uuid":"564491404","full_name":"tsmith023/go-permutate","owner":"tsmith023","description":"A repository containing methods to compute and generate generic permutations using Go","archived":false,"fork":false,"pushed_at":"2023-03-11T11:29:04.000Z","size":11,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-07T06:31:28.217Z","etag":null,"topics":["generics-in-golang","goroutines","permutation-algorithms"],"latest_commit_sha":null,"homepage":"","language":"Go","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/tsmith023.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}},"created_at":"2022-11-10T20:46:22.000Z","updated_at":"2023-03-10T13:19:40.000Z","dependencies_parsed_at":"2022-11-13T12:33:13.401Z","dependency_job_id":null,"html_url":"https://github.com/tsmith023/go-permutate","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tsmith023%2Fgo-permutate","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tsmith023%2Fgo-permutate/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tsmith023%2Fgo-permutate/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tsmith023%2Fgo-permutate/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tsmith023","download_url":"https://codeload.github.com/tsmith023/go-permutate/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246634710,"owners_count":20809289,"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":["generics-in-golang","goroutines","permutation-algorithms"],"created_at":"2025-02-07T06:29:23.677Z","updated_at":"2025-04-01T11:35:25.223Z","avatar_url":"https://github.com/tsmith023.png","language":"Go","readme":"# go-permutate\n\nThis repository hosts the beginnings of a Go package for computing the [permutations](https://en.wikipedia.org/wiki/Permutation) of generic slices as generator functions leveraging goroutines under-the-hood.\n\n\u003c!---\nThe package exposes a simple API containing a generator function and types that define the different available algorithms.\n\nTo use it, simply choose your applicable algorithm and pass it to `GeneratePermutations`. Then loop over the generator with `for perm := range GeneratePermutations` to retrieve all the possible permutations.\n---\u003e\n\nSo far implemented are [Heap's Algorithm](https://en.wikipedia.org/wiki/Heap's_algorithm), in both flat and recursive forms, for finding all possible permutations and [Fisher-Yates-Shuffling](https://en.wikipedia.org/wiki/Fisher%E2%80%93Yates_shuffle) \u0026 [Reservoir Sampling](https://en.wikipedia.org/wiki/Reservoir_sampling) for finding permutations randomly until a predefined number have been obtained.\n\nThe benefit of the latter type of generation over the former is if the permutated slice has a length greater than eleven such that finding all its possible permutations is unfeasible, since Heap's Algorithm has order ${\\cal O}(n!)$ so that finding (\u003e12)! permutations takes many minutes, if not hours. The latter technique can find a representative sample of the underlying permutations of a slice when the length of the slice is much greater than 12.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftsmith023%2Fgo-permutate","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftsmith023%2Fgo-permutate","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftsmith023%2Fgo-permutate/lists"}