| Crates.io | derangements |
| lib.rs | derangements |
| version | 0.2.0 |
| created_at | 2025-01-06 14:59:20.878177+00 |
| updated_at | 2025-01-20 22:57:02.904032+00 |
| description | Generate derangements of an iterable |
| homepage | |
| repository | https://github.com/debruijn/derangements |
| max_upload_size | |
| id | 1505691 |
| size | 53,282 |
Generate derangements and variants in line with permutations in the itertools crate.
To get started:
derangements = 0.2.0 to your Cargo.tomluse derangements::derangements or one of the other functions to your Rust fileFor more options, including more derangement variants and also other restricted permutations, see https://docs.rs/derangements
There will be three main algorithms included in this package:
rust-itertools project.itertools::permutations (but with different requirements)Note that (except the above-mentioned range-specific derangements) the derangements in this package are generated by filtering permutations to keep only the items that meet the restriction.
Ideally the following would be added or explored:
derangements_by_value here as well to keep naming consistent with Python's more_itertools
more_itertools with that naming in it as wellIf you have more ideas, let me know!
Licensed under either of Apache License, Version 2.0 or MIT license at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in this crate by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.