LuckPicker

Tool

Gift Exchange with Exclusions

Secret Santa where couples, housemates, or teammates must not draw each other.

Gift Exchange with Exclusions

6 people, 4 exclusion rules. Exclusions apply both ways.

A gift exchange where named people must not draw each other. Couples who buy together, housemates who already exchange, colleagues who were paired last year — list the exclusions and the draw works around them.

The results are hidden behind a tap-to-reveal list, so one device can be passed around a room and nobody sees anybody else's assignment. The organiser does not have to see the full list either.

When your exclusions have no valid solution, the tool says so plainly. That is not a limitation of the search — some exclusion sets genuinely have no answer, and no amount of re-rolling will find one.

How the Gift Exchange with Exclusions works — and why it's fair

The draw is a constrained derangement. A derangement is a permutation where no element maps to itself, which is what stops anyone drawing their own name; the constraint layer additionally rejects any permutation that violates one of your exclusion rules. The search is randomised restart: shuffle, test every position against both conditions, and retry until a valid arrangement appears or the attempt budget runs out.

Exclusions are applied symmetrically. Listing Ben as an exclusion for Ana blocks the pairing in both directions, because that is what people mean when they name a partner — they do not mean that Ana may not buy for Ben while Ben may buy for Ana. Listing it once is enough.

Randomised restart is a genuinely good fit here even though it looks crude. For realistic exclusion sets a valid arrangement is common enough that a solution turns up within a handful of attempts, and the tool reports how many it took. A high attempt count is itself useful information: it means your constraints are nearly saturating, and the draw is close to having only one answer.

Unsolvable sets are real and worth understanding, because people assume the tool has failed. Couples alone almost never cause it — six people in three couples has plenty of valid arrangements, such as two three-cycles that skip every partner. What does cause it is a group of people who collectively have too few permissible recipients between them. Picture Ana, Ben and Cleo in a group of four, all barred from one another: every one of them can only draw Dev, and one person cannot receive three gifts.

That refusal is the important behaviour. A tool that dropped your least-recently-added exclusion to produce a result would return something that looks perfectly fine and violates a rule you set, and you would not find out until the gifts were opened.

Nothing is stored or transmitted. The assignments exist in the page, revealed one at a time, and vanish when the tab closes — which is the property the office hat had and most gift-exchange websites gave up in exchange for collecting email addresses.

When the Gift Exchange with Exclusions is fair — and when it is not

What it does guarantee

  • Nobody can draw themselves, and no excluded pairing can occur, ever — both are verified for every position before an arrangement is accepted.
  • Every valid arrangement is reachable, since the search starts from a fresh uniform shuffle each attempt.
  • Nothing is stored or sent anywhere; the pairings live in the page only.

What it does not

  • Constrained derangements are not perfectly uniform across valid arrangements — randomised restart favours arrangements that are easier to reach, very slightly.
  • Some exclusion sets have no solution at all, and no tool can fix that. Couples alone rarely do it; dense or one-sided exclusion lists do.
  • It cannot enforce anything about who buys what, or about budgets, which is where most gift exchanges actually go wrong.

Two worked examples

Six people, two couples excluded

  • Ana↔Ben and Cleo↔Dev are blocked in both directions; Elin and Frank are unconstrained.
  • A valid arrangement is usually found in one to three attempts.
  • The tool reports the attempt count, so an unusually high number flags a tight constraint set.

Four people, three of them mutually excluded

  • Ana, Ben and Cleo are each excluded from the other two; Dev is unconstrained.
  • All three can only draw Dev — three givers, one permissible recipient.
  • No assignment exists. The tool exhausts 5,000 attempts and says so rather than dropping a rule.

Exchanges the plain generator cannot run

Office exchanges where couples work together are the standard case, and the one where a plain derangement produces a result that everyone can see is wrong. Two people who share a household drawing each other defeats the entire point of the exercise.

Family exchanges have the same problem with more structure: parents excluded from children, siblings excluded from each other, and a grandparent who should not draw the four-year-old. Encoding those as exclusions turns an annual argument into a setting.

Recurring exchanges use it to encode last year's pairings, which is the single most requested feature and the one plain generators never have. Pasting last year's list as exclusions guarantees a genuinely different year rather than a coincidentally similar one.

For an exchange with no constraints at all, the Secret Santa generator is simpler and uses a plain derangement. For matching people to distinct prizes rather than to each other, the prize assignment randomizer handles that different shape, and the derangements guide explains the underlying mathematics.

Frequently asked questions

Do I need to list an exclusion on both people?

No. Exclusions are applied in both directions automatically, because that is what naming a partner means in practice.

Why did it say there is no valid answer?

Because there genuinely is not one. It happens when some group of people collectively has fewer permissible recipients than there are of them — three people who can all only draw the same fourth person, for instance.

What is the attempt count telling me?

How many shuffles it took to find a valid arrangement. A high number means your constraints are close to saturating and the draw has very few possible answers.

Is every valid arrangement equally likely?

Very nearly, but not exactly. Randomised restart slightly favours arrangements that are easier to reach. For a gift exchange this is immaterial.

Can the organiser avoid seeing the pairings?

Yes — that is what the tap-to-reveal list is for. Pass the device round and each person reveals only their own.

Is anything stored or emailed?

No. Nothing leaves the page and nothing is retained, which is exactly what the physical hat did and what most exchange sites gave up.

How do I exclude last year's pairings?

List each person's last-year recipient as their exclusion. Since exclusions are symmetric, that also prevents the reverse pairing.

What is the maximum group size?

There is no fixed cap, but very large groups with dense exclusions take longer to solve. The attempt count will show you when it is struggling.

Can it handle 'must draw' rules as well as 'must not'?

No, only exclusions. A must-draw rule is not really a draw — just assign that pair by hand and run the tool on everyone else.

← Back to all tools