Secret gift assignment
Assign distinct gift recipients while excluding self and forbidden pairs. If no complete assignment satisfies the constraints, the result says so explicitly.
The example value has been entered. Check it immediately or change the value.
Input is processed in the browser. Refreshing returns a sample value.
Instructions and example
Treat givers and recipients as a bipartite graph and use augmenting paths to find a complete matching.
Alex, Blair, Casey and Drew each receive 1 recipient; Alex is not assigned Blair.
Use 2–40 participants and up to 100 forbidden pairs. The organizer sees all assignments; private delivery and uniform random sampling are not guaranteed.
Frequently asked questions
Are forbidden gift pairs bidirectional?
No. Enter a separate row to forbid the reverse direction too.
Can a new seed fix an impossible gift assignment?
If no complete matching exists, change exclusions or participants rather than the seed.
Calculation criteria and reference materials
The calculation formula and scope of this tool are disclosed in the above description. Examples can be checked by substituting input values into the formula or following the specified string and calendar handling rules.
Verification of calculation criteria: · Calculation·verification principles · Report errors