3 ms·
As in many holiday events, it's just tradition that requires a Hamiltonian cycle. And tradition is not known for its reasonableness or flexibility! The traditi
by LeifCarrotson 6y ago
As in many holiday events, it's just tradition that requires a Hamiltonian cycle. And tradition is not known for its reasonableness or flexibility!
The tradition says that after opening the gift they've received, they have to wear the funny Santa hat and bring the gift they brought to the person they were randomly assigned.
If the graph is not Hamiltonian, and instead goes A-B-C-A and D-E-F-D and G-H-G, there are going to be several awkward moments where someone has to arbitrarily choose someone who hasn't gone yet. It's really easy to generate these loops, and hard to get a 'proper' graph by drawing randomly from a hat, especially if you add other constraints like excluding spouses and your own kids/parents.