rusty-santa 0.1.0

Resolve Secret Santa assignments with additional constraints.
Documentation
  • Coverage
  • 81.82%
    9 out of 11 items documented0 out of 8 items with examples
  • Size
  • Source code size: 17.72 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 1.96 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 15s Average build duration of successful builds.
  • all releases: 15s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • dbrgn/rusty-santa
    5 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • dbrgn

Rusty Santa

A small Rust library (and command-line tool) for resolving Secret Santa assignments with additional constraints.

It is possible to add the following constraints to the random assignments:

  • Person A and B should not draw each other (e.g. for couples)
  • Person A should not draw person B (e.g. if person B already received a gift from person A the previous year, or if person A dislikes person B)

While this is an interesting mathematical problem and can be solved with bipartite graphs and the hungarian algorithm, this library sticks to a simpler approach and tries to emulate the real name drawing from a basket. Up to 1000 attempts are made at resolving the name assignments without conflict until the algorithm fails.