Constrained Gift Exchange Assignment
Count complete self-free gift exchanges with directed exclusions and draw one using exact uniform rank selection.
Loading tool…
How to use Constrained Gift Exchange Assignment
List participants and forbidden giver-to-receiver pairs. Count every admissible complete exchange with a bounded exact subset model, then either inspect feasibility or draw an exact rank with Web Crypto and decode its assignment.
- Use the example as the schema; replace its labels and entered model assumptions.
- List participants and forbidden giver-to-receiver pairs. Count every admissible complete exchange with a bounded exact subset model, then either inspect feasibility or draw an exact rank with Web Crypto and decode its assignment.
- Calculate, inspect the complete witnesses and limitations, then copy or download the JSON report.
Good to know
- 2–14 distinct participant labels and at most 196 distinct directed exclusions. Every person gives once and receives once; self assignment is always disallowed. Exclusion rows must reference known participants. Reciprocal pairs and disconnected exchange cycles are allowed.
- The subset model has at most 2^14 receiver masks. Feasible counts and rank branches use exact BigInt arithmetic; random ranks use browser Web Crypto with a 128-attempt rejection cap and no Math.random fallback. A failed random source refuses a draw.
- The complete mapping is visible to the host in this tab and JSON download. No secret individual views, email, messages, persistence, participant identity verification, prize drawing or guarantee about the browser’s entropy source.
- Local calculation with no upload, input persistence or outside lookup. Model JSON is limited to 30,000 characters and 10,000 values. Decimal quantities are strings with up to six places; count fields use plain JSON integers. Exact fractions are capped at 8,192 bits. The complete JSON output is limited to 1,000,000 characters; approximate numbers preserve their stored values. Unsupported states fail explicitly.
Common questions
Does forbidding Ari→Bo also forbid Bo→Ari?
No. Exclusions are directed because giver and receiver roles differ. Enter both rows when both directions are forbidden. The result still allows reciprocal pairs elsewhere unless you explicitly exclude them; it does not claim a single exchange cycle.
Are my model inputs saved or sent to a server?
No. This model runs in the current browser tab and creates a local JSON download. It does not save your input or call an external data service.
Keep going with related tools
All education →Cost Assignment Workbench
Find an exact minimum-cost or maximum-value one-to-one assignment and export the matching witness.
EducationConstrained Team Roster Builder
Find a complete roster with exact team sizes and explicit pairs that must remain apart, or return a bounded feasibility result.
EducationCombination and Ordered Selection Ranking
Rank or recover a combination or ordered selection by exact zero-based lexicographic index without enumerating all objects.