---
title: Who Sits Next to Whom? — I Handed Banquet Seating to a Solver, and the Score Function Seated People Alone First
url: https://oosioo.com/en/p/%EB%88%84%EA%B5%AC%EB%A5%BC-%EB%88%84%EA%B5%AC-%EC%98%86%EC%97%90-%EC%95%89%ED%9E%90%EA%B9%8C
date: 2026-11-26T12:10:54+00:00
author: SYSOP
summary: I built a solver that takes a guest list, relationships (close, know each other, awkward, keep apart, came together) and needs (children, wheelchairs, interpreters), plus table shapes and sizes, and assigns every seat. On synthetic sets of 30, 80 and 150 fictional guests I compared random placement, a human-style list-order heuristic, greedy, local search, simulated annealing and integer programming (OR-Tools CP-SAT). Integer programming proved the 30-guest table assignment optimal in 0.1 seconds but could not prove anything for 150 guests in 60 seconds, while annealing found a better plan in 4. List-order filling seated 32-40% of close pairs together at 80-150 guests; annealing managed 63-75%. The biggest mistake was the score function: a first version that only kept awkward pairs apart left an average of 28 of 150 guests at tables where they knew nobody. Adding points for seating acquaintances together cut that sharply, but 14 of the 35 remaining lone guests were wheelchair users. A penalty for anyone with no acquaintance at their table brought it to zero. Adding keep-apart pairs showed where plans become impossible: with 80 guests and 80 seats, at around 16-19 people to avoid per guest, while annealing gave up long before that. Also covered: a 36-hour integer program for a real wedding, a graph-colouring approach behind a seating website, and a quantum-computer benchmark built on reception seating.
---
# Who Sits Next to Whom? — I Handed Banquet Seating to a Solver, and the Score Function Seated People Alone First

![Two seatings of the same 30 fictional guests at four round tables. On the left, the score only kept awkward pairs apart, and seven red dots are guests with nobody they know at their table. On the right, lone guests are penalised: no red dots, and green lines marking neighbours who know each other run around every table](/uploads/4af2cb91ee2c291e.webp)

Once a gathering gets big enough, the seating chart becomes somebody's homework. You paste the guest list into a spreadsheet, start writing table numbers, and stall almost at once. Two uncles haven't spoken in years. A client of the groom knows nobody but the groom. Grandma uses a wheelchair and needs the table by the door. Two relatives on the bride's mother's side speak no Korean and need a bilingual cousin beside them. The kids have to sit next to their parents. Fix one thing and another breaks, and you end up wrestling sticky notes for hours.

This homework has a name in mathematics: the wedding seating problem. It is a combinatorial optimisation problem whose number of possibilities explodes, so it gets written up in journals and even used as a test case for quantum computers. Could you build something that takes a guest list and a set of relationships and hands back a seating chart? And would that chart actually beat one put together by hand? That is what this episode tried.

## What I set out to do

1. Build a **seating solver**: give it a guest list, relationships between guests (close, know each other, awkward, keep apart, came together), per-guest needs (child, wheelchair, needs an interpreter), table shapes (round or long) and seat counts, and it assigns seats.
2. Since real names are off limits, build **fictional guest sets**: 30, 80 and 150 guests, three of each. All synthetic, all named by role ("A's aunt", "B's team lead").
3. Run six methods on the same sets and compare **score and time**: random, filling tables in list order (a human-style heuristic), greedy, local search, simulated annealing, and integer programming.
4. Add "keep apart" constraints step by step to find **where solutions disappear**.
5. Build a **playground** where you edit people and relationship lines and press "Seat them" to get a table drawing.
6. Find and summarise the research and practice that take this problem seriously.

The research, solver, experiments, figures and playground were all written and run by an AI agent on a laptop. Where it went wrong is collected separately below.

## How many possibilities are there?

Just splitting 30 guests among 4 tables gives 4 to the 30th power, about 10 to the 18th. That rough count includes over-full tables, but the order of magnitude holds. Eighty guests over 9 tables is 10 to the 76th; 150 guests over 16 tables, 10 to the 180th. Who sits next to whom multiplies that further: there are 2,520 ways to arrange eight people around one round table even after treating rotations and mirror images as the same.

Checking every option is hopeless already at 30. Mathematicians note that the problem contains two famously hard ones. Splitting guests evenly across tables is the k-partition problem, and sending people who clash to different tables is graph colouring, the same problem as colouring a map so that neighbouring countries differ. Both are NP-hard, meaning no fast general method is known. In practice people mix exact methods, which can prove a plan optimal, with heuristics, which find good plans fast but prove nothing.

## Writing the problem down in numbers

A solver needs "a good seating" spelled out as numbers. This one has two kinds of rules.

**Hard rules** (each violation costs 1,000 points):

- **People who came together** (couples, families with kids, plus-ones) sit at one table. The solver moves such parties as a single unit, so this rule can never break.
- **Keep apart** pairs sit at different tables.
- A **child** sits right next to an adult from their party.
- A **wheelchair user** gets a wheelchair spot (a place with the chair removed, one per accessible table near the door).
- A guest who **needs an interpreter** sits right next to someone who speaks both their language and Korean.

**Soft score**:

| Relationship | Same table | Right next to each other |
|---|---|---|
| Know each other | +1 | +1 more |
| Close | +3 | +2 more |
| Came together | (always same table) | +2 |
| Awkward | -5 | -10 more |

At a round table, "next to" means the two people on either side. At a long table it also includes the person directly opposite, so three neighbours. One more line gets added at the end, and it takes up half of this story. It wasn't there at the start.

## Making up the guests

A real wedding list was out of the question, so I invented one. Two hosts, A and B, each bring family, coworkers, school friends and hobby-club friends. Inside a circle, people know each other with high probability (family 80%, friends 60%, coworkers 55%, clubs 35%); outside it, rarely (same side 4%, the two families 10%, otherwise 1%). Some coworkers and friends bring a plus-one, who knows nobody but their partner. Awkward pairs are sprinkled at 8% of the guest count and keep-apart pairs at 2.5%. B's relatives include a party who speak only Vietnamese, and the 150-guest sets add a friend of A's who speaks only English; bilingual guests on the same side can interpret. A few older guests who came alone use wheelchairs.

| Size | Tables | Seats | Parties | Relationship pairs | Wheelchair | Need interpreter / can interpret |
|---|---|---|---|---|---|---|
| 30 | 4 round × 8 | 32 | 22-23 | 31-42 | 1 | 2 / 1 |
| 80 | 6 round × 10 + 3 long × 10 | 90 | 54-59 | 294-311 | 2 | 3 / 2 |
| 150 | 10 round × 10 + 6 long × 10 | 160 | 95-102 | 1,077-1,131 | 3 | 4 / 3 |

Each size has three sets from different random seeds. That the data is synthetic matters when reading the results. Real relationships are lumpier, and nobody writes down every "we know each other".

## Six methods

- **Random**: drop each party into free seats at a random table. The floor.
- **List order (human-style)**: sort the list as A's family, A's coworkers and so on, and fill tables from the front. Wheelchair users' parties go to accessible tables first; if a keep-apart or awkward pair lands at one table, swap one party once with a same-size party at the next table; pull a bilingual guest next to anyone who needs interpreting; finally, a clean-up pass that only reduces rule violations. No actual person arranged anything. This is a rule-based imitation of the common "go down the spreadsheet" approach.
- **Greedy**: seat the hardest parties first (wheelchair, interpreter), each at whichever table and seat raises the score most right now, with no thought for who comes later.
- **Local search**: start anywhere, randomly try "swap two seats at one table" or "swap a party with the same number of people at another table", and accept only moves that don't make things worse.
- **Simulated annealing**: like local search, but early on it accepts plenty of worsening moves and gets stricter as a "temperature" drops, named after slowly cooling metal so its crystals settle evenly. 300,000 moves for 30 guests, 1 million for 80, 2 million for 150.
- **Integer programming**: write the whole problem as 0/1 variables ("party g sits at table t") and hand it to Google's open-source solver OR-Tools CP-SAT, which can prove optimality given time. Putting seat adjacency into the model blows up the variable count, so the integer program only decides **who sits at which table**; a short annealing run then orders seats within each table. The "right next to" rules for children and interpreters enter only as table-level necessities (one interpreter can cover two guests at a round table, three at a long one). Time limits: 10 and 60 seconds.

## The result: a chart for 30

![Thirty fictional guests at four round tables, seated by simulated annealing. A's grandma, a wheelchair user, takes the circled spot at the top of table 1. At table 2 the Vietnamese-speaking couple sit on either side of B's aunt, who interprets. Table 3 holds A's younger cousin's family with two kids plus A's friends. Green lines join neighbours who know each other; red would mark awkward neighbours, and there are none. Score 67, rules broken 0, guests who know nobody at their table 0](/uploads/cf1bae3086544bdd.webp)

This is the first 30-guest set, seated by annealing in under half a second. The wheelchair user has the wheelchair spot, and the Vietnamese-speaking couple sit with their interpreter between them: the solver gave up the +2 for a couple sitting together to satisfy the interpreter rule. Both kids sit between their parents. Both awkward pairs and the one keep-apart pair ended up at different tables. All six close pairs share a table.

A person can do that much. Across the three 30-guest sets, list-order filling broke no rules either and put 88% of close pairs together. The difference showed up elsewhere: list order left an average of 4.3 guests out of 30 at a table where they knew nobody, because the hobby-club guests and plus-ones at the bottom of the list fill whatever seats remain at the last tables. Annealing left 0.3. Who that 0.3 is comes up later.

## Comparing methods

![Relationship score and time by method for 30, 80 and 150 guests. Top row: score with rule penalties removed. Bottom row: time on a log scale. Random scores below zero at every size and breaks 3.7, 7.6 and 14.2 rules on average. List order scores -20, 127 and 340; annealing 62, 321 and 699. Integer programming reaches 63 in 0.1 s at 30 guests, but at 150 guests it gets 665 after 60 s, below annealing. Local search and greedy sometimes finish with rules broken](/uploads/86a6ac0ed2708069.webp)

Averages over three sets (three runs per set for local search and annealing):

| Method | 30 guests | 80 guests | 150 guests | Time at 150 |
|---|---|---|---|---|
| Random | -3,848 | -7,810 | -14,477 | under 1 ms |
| List order (human-style) | -20 | -206 | 6 | 32 ms |
| Greedy | -1,034 | -1,259 | -1,851 | 3 ms |
| Local search | 59 | -31 | 337 | 3.8 s |
| Simulated annealing | 62 | **321** | **699** | 3.9 s |
| Integer prog. 10 s | **63** | **323** | 595 | 10.5 s |
| Integer prog. 60 s | 62 | **325** | 665 | 60.5 s |

Scores include the -1,000 per broken rule. Random is so negative because it breaks 3.7 to 14.2 rules on average: kids away from parents, interpreter-needing guests with nobody beside them.

**At 30 guests, integer programming wins.** For all three sets it proved within 0.1 seconds that its table assignment was optimal. On table-level score, five of nine annealing runs matched that optimum and the rest fell 1 to 6 points short. After seat ordering, integer programming was ahead by about a point on average.

**At 80, it's a draw.** Integer programming proved nothing in 10 or 60 seconds; after 60 seconds it reported something like "current plan 217, the maximum is at most 233". Still, its plans were good: final scores within 4 points of annealing, which took 1.8 seconds.

**At 150, annealing wins.** The integer program's gap blew open. After 60 seconds on the first set its table-level score was 421, and all it could say about the best possible was "at most 1,245", nowhere near a proof. Annealing found 422 to 428 at table level in 4 seconds and averaged 699 after seat ordering, above the 60-second integer program's 665. Exact methods reward you with a proof on small instances; on big ones they spend all their time trying to get it.

![Best score so far versus moves tried for annealing on the first 150-guest set. It clears its rule violations within about 10,000 moves and reaches the low 100s, passes list order (309) around 500,000 moves, passes the 60-second integer program (653) around 1.25 million, and stops at 676. One local-search run under the same conditions stalls at -335 with one rule broken](/uploads/f847dd33abb85bf4.webp)

**The gap to the human-style heuristic widens with size.** With rule penalties removed, it's -20 vs 62 at 30 guests, 127 vs 321 at 80, 340 vs 699 at 150. List order seated 88%, 40% and 32% of close pairs at the same table; annealing managed 98%, 75% and 63%. Because the list is sorted in big blocks like "A's coworkers", a block that straddles a table boundary splits friends apart. A real person would see that and fix it; this imitation only does a single swap per awkward pair. Read the comparison as "filling in list order misses this much", not as "the solver beats people".

**Greedy and local search showed the traps.** Greedy broke 1 to 3 rules in every one of the nine sets, all of them interpreter rules: it seated an interpreter-needing guest early and then filled the seats beside them, leaving no room for the bilingual guest who came later. Local search stopped with one broken rule in three of nine runs at both 80 and 150. All six were a wheelchair user sitting somewhere other than a wheelchair spot. The free wheelchair spot was at another table, and getting there meant moving the guest's party and whoever already sat in that spot. Fixing it requires briefly accepting a worse score, which local search never does. That is exactly why annealing accepts bad moves now and then.

## Playground: seat them yourself

Try it below. In the relationship graph on the left, pick a relationship type (close, know, awkward, keep apart, came together) and tap two people to draw a line. Tap one person to rename them or add child, wheelchair or interpreter needs. On the right, set the number, shape and size of tables and press "Seat them": annealing builds a plan and draws the tables. "Fill in list order" shows what the human-style heuristic does. Untick "Prevent lone guests" to reproduce the failure described under "Where it went wrong". Presets: a 14-guest small party and the 30-guest synthetic set.

```map /embed/seating-solver-en.html 3:4
Seating plan solver: edit people and relationship lines, press "Seat them", and see who sits where at each table. Red dots are guests who know nobody at their table
```

## Adding more "keep apart" pairs

Add enough rules and at some point no arrangement can satisfy them all. I took the first 80-guest set, added 100, 200, up to 900 random keep-apart pairs, drew each level five times, and asked the integer program only whether a rule-abiding plan existed. Two venues: the original 9 tables (90 seats), and 8 tables with one long table removed (80 seats, no spare seat).

![Left: share of draws where a rule-abiding plan exists as keep-apart pairs are added to 80 guests. The horizontal axis is how many people each guest must avoid on average. By integer programming, with 80 seats plans start vanishing around 16 and none exist at 19; with 90 seats none exist at 23. Annealing fails to find plans that exist from around 7.5, and a two-stage "rules first" annealing only partly catches up. Right: time for integer programming to decide; it spikes to about 1 s at the 80-seat boundary (17.6) and stays under 0.3 s elsewhere](/uploads/2800bf024b53c3f7.webp)

The integer program was clear:

- **80 seats (none spare)**: up to an average of 15 people to avoid per guest (600 pairs), every draw but one, explained below, had a plan. At 16.3 (650 pairs) two of five had none, at 17.6 (700 pairs) four, and from 18.8 (750 pairs) all five.
- **90 seats (10 spare)**: the boundary moved out. At 18.8 to 20 (750-800 pairs) three or four of five draws still had a plan; at 22.6 (900 pairs) none did.

Ten empty seats pushed the boundary out by three or four people per guest. In practice: the more strained the relationships at a gathering, the more it pays to leave a table's worth of slack. Deciding was fast, mostly under 0.3 seconds whether or not a plan existed, with a longest time of 3.2 seconds near the boundary. As usual for hard problems, time spiked right where "yes" turns into "no".

One draw had no plan far before the boundary. At 450 pairs (11 people to avoid per guest), one of five was impossible with both 90 and 80 seats. Looking inside, "B's maternal relative 2", who speaks only Vietnamese, had drawn keep-apart links to both bilingual guests. She needs one of them beside her, and neither may share her table. However roomy the average, **a few constraints piled on one person can make the whole thing impossible**. When a real seating plan won't come together, that is the first place to look.

## Where it went wrong

In the order it happened, the biggest first.

### 1. Score function v1 only kept awkward people apart

The first score function had only the awkward-pair penalty and the hard rules. Seating worries are mostly about who to keep apart, so I assumed that doing that well was enough. On paper the result was perfect: across every set and every run at 30, 80 and 150 guests, zero rules broken, zero awkward pairs at the same table, zero side by side.

Then I drew the tables, and every one had red dots: guests with not a single acquaintance at their table. On average 6.7 of 30, 18.7 of 80 and 27.9 of 150, and as many as 35 of 150 in one run. The share of close pairs seated together was 31%, 12% and 6%, about what random gives.

![Left: guests with nobody they know at their table, by score-function version. v1 (only keep awkward pairs apart) averages 6.7, 18.7 and 27.9 at 30, 80 and 150 guests; v2 (plus grouping acquaintances) 0.9, 1.3 and 1.7; v3 (plus a lone-guest penalty) 0.3, 0 and 0. Right: the same 30 guests seated under v1 and v3. Under v1, seven red dots are scattered across the tables; under v3 there are none](/uploads/1fa869d005afc2aa.webp)

The cause is simple. If the score says "everything scores 0 as long as awkward pairs are apart", every plan meeting that condition is an equally good answer, and most of them scatter people almost at random. The solver did exactly what it was told. What it was told was wrong. "A table where nobody fights" and "a table where everyone has a good time" are different problems.

Later I found that Bellows and Peterson, who solved wedding seating with integer programming in 2012, had guarded against this from the start. Their objective is the sum of closeness over pairs at the same table, and one constraint says every guest must know at least b people at their table. A lesson that keeps coming up in this series came up again: deciding what to optimise is harder than optimising it.

### 2. v2 still left people alone, and most were wheelchair users

v2 added the "+1 know, +3 close" rows from the table. Lone guests dropped to 0.9, 1.3 and 1.7 on average, and close pairs seated together rose to 100%, 74% and 63%. I wanted to stop there.

Then I printed the names of the remaining one or two, and I couldn't. Of 35 cases over 27 runs, 14 were wheelchair users; in the 150-guest sets, 11 of 15. "A's maternal grandma" in the first 30-guest set and "B's maternal grandma" and "B's great-uncle" in the first 150-guest set were left alone run after run.

Tracing it, the structure was plain. A wheelchair user can only go to a table with a wheelchair spot. If that table lacks room for the rest of their side of the family, the plan that maximises the total score puts grandma among strangers and keeps the rest of the family together with people they know. One lonely person (0 points) loses to many people gathered together. That's simply how a sum works. Losses pile onto the person with the most constraints and the least freedom to move, which in real life means the guest who most needs looking after is the easiest to push aside.

### 3. v3: a penalty for sitting alone

So I added "-15 if you know nobody at your table, counting your own party", essentially Bellows and Peterson's b = 1 as a penalty. At 80 and 150 guests, lone guests went to zero in every run. The share of close pairs seated together barely moved, 74% to 74% and 63% to 63%: moving a few people so each lone guest gets one familiar face beside them was enough.

At 30 guests, 0.3 on average remained: "A's director" in the third set, who knows nobody on the entire list. The generator sprinkles relationships by probability, and in a small set it produced one such person. No seating can fix that. Real gatherings have such guests too; what they need is not a solver but someone at their table asked to look after them.

### 4. Annealing said "no solution" when there was one

In the keep-apart experiment I first tried to find the boundary from annealing alone. With 90 seats it already left rules broken in three of five draws at 7.5 people to avoid per guest (300 pairs), and from 13.8 (550 pairs) it never found a rule-abiding plan. Taken at face value, I'd have written that seating gets hard past 8 people per guest. The integer program, given the same problems, found plans in all five draws up to 15 (600 pairs). Annealing's "couldn't find one" did not mean "there isn't one".

The cause is in the score design. Annealing looks at rule penalties and relationship points as one number. As the avoid lists grow, rule-abiding plans become rare, scattered islands, and chasing relationship points keeps the search from reaching them. That's why Lewis, who treated wedding seating as graph colouring, split his method in two in a 2013 manuscript: first find a plan that satisfies every keep-apart rule, then move only within such plans to raise the score.

I tried the same idea: 300,000 moves of annealing that counts only rule violations, then 300,000 more on the original score starting from there. With 90 seats, 300 pairs went from 2/5 to 5/5 and 500 pairs from 2/5 to 4/5. But at 550 to 700 pairs it found plans in only one or two of five draws, and from 750 pairs it never found one even where the integer program said one existed. Lewis uses Kempe chains, moves that swap a whole interlocked group of people between two tables at once; this solver has none. The conclusion is modest: **ask the integer program whether a plan exists, and let annealing find a good one.** The playground says "Could not satisfy every rule", never "impossible".

### 5. I first looked for the boundary in the wrong range

The first run added only 0 to 400 keep-apart pairs. With 80 guests there are only 3,160 pairs, so I assumed 400 would be tight. Everything came back feasible. Avoiding 10 people on average still leaves 69 of 79, and with nine tables only nine sit together. Probing more widely, 600 to 1,700 pairs, showed plans at 600 and none at 800. The figure above is the rerun with fine steps in between.

### 6. The guest generator produced "B's team lead, who speaks only Vietnamese"

The first generator picked interpreter-needing guests from "B's family members who came alone or as a couple". The 30-guest set had only five people in B's family and none qualified, so it moved on to another circle and turned "B's team lead" and his plus-one into Vietnamese-only speakers. The plus-one knows nobody but his partner, so the interpreter rule got tangled twice over. The bilingual guest was picked from a family of four with two kids, so moving her next to anyone meant moving all four. An even earlier version had no interpreter-needing guests in the 30-guest set at all.

The fix was simple: create the foreign-language party (a relative couple and a single relative) explicitly, and choose interpreters from adults who came alone first. A flaw remains: in some 80- and 150-guest sets, "B's maternal relative 2 (Vietnamese)" was also picked as a wheelchair user, because the wheelchair code runs after the foreign party is created. Not an impossible combination, so I left it, but she is also the person who made the 450-pair draw impossible.

### 7. The human-style heuristic was too dumb at first

The first imitation filled in list order and did one swap per awkward pair. It never seated an interpreter next to the guest who needed one, so even the 30-guest sets broke one or two rules. Nobody arranging real seats would forget to put the bilingual cousin next to the foreign guest. Compared that way, the result would read not "the solver beat a person" but "the solver beat a scarecrow".

I added the interpreter step and a final pass of 20,000 tries that accepts only swaps reducing rule violations, ignoring relationship points: the level of a person scanning the chart and fixing obvious rule breaks. Even then, one run in three at 80 and 150 guests left one interpreter rule broken. That number is reported as is. I also changed table filling from "if it doesn't fit, move to the next table" to "the first table with room". The old version couldn't seat 14 people in 16 seats once the playground's small party switched to long tables.

### 8. "Not enough seats" with 10 seats free

Random placement crashed on the second 150-guest set with a "not enough seats" error and stopped the whole run. 160 seats, 150 guests, 10 free. But inserting parties in random order let parties of one or two take a seat or two at every table, and the last family of four had nowhere to go: the ten free seats were spread one per table. It's why you load the big suitcases into the boot first. I changed it to place the largest parties first. The same kind of mistake appeared in the code that turns integer-programming results into seats: another guest took the wheelchair spot first, leaving the wheelchair user nowhere. Now wheelchair parties are seated first.

### 9. The playground's "not enough seats" was a lie

In the playground, switching to long tables and pressing "Fill in list order" showed "Not enough seats", with 14 guests and 16 seats. The real cause was the sort. The human-style heuristic sorts by host side and circle, but guests created in the playground have neither, so the sort crashed, and the playground lumped that crash in with "not enough seats". Now it falls back to input order. Trusting the error message would have meant fixing the wrong thing.

### 10. Numbers not to trust

- **The weights are mine.** +3 for close, -5 for awkward, -15 for sitting alone have no deeper basis. Raise "awkward" to -20 and a different plan wins. Only the ranking between methods and the shape of the failures are trustworthy; absolute values like "score 699" mean nothing.
- **Synthetic guests are tidier than real ones.** Acquaintance is spread evenly within circles. Real networks cluster around a few social hubs, and nobody lists every acquaintance.
- **Integer programming proves only the table assignment.** "Optimal" at 30 guests refers to who sits at which table. Seat order was polished by annealing, so the full plan isn't proven optimal.
- **Times are from one laptop,** shared with other experiments. The integer program used four workers.

## The people who do this for real

**Banquet halls and protocol.** The people who take seating most seriously are diplomatic protocol officers. Korea's foreign ministry guide on protocol calls seating arrangement "the issue requiring the most careful attention among banquet preparations", and sets out that the guest of honour sits farthest from the entrance, the diplomatic corps by date of presenting credentials, and domestic ministers by the order in the Government Organization Act. Rank comes before relationships there, a dimension this solver doesn't touch. Wedding venues and hotel banquet staff do the same work every week, mostly by spreadsheet and experience, and even with automated seating a person does the final touches.

**Optimisation researchers.** The best-known write-up of wedding seating as a formula is by Bellows and Peterson of Princeton, published in the Annals of Improbable Research in 2012. They gave each pair of guests a closeness weight from 0 to 50 (50 for couples, 10 for cousins who should sit together, 1 for the same family) and solved it by integer programming. Seventeen guests took one to two seconds. Their real wedding, 107 guests at 11 tables, ran for 36 hours on a high-performance compute node without proving optimality; the bride's mother adjusted a few seats in the plan it produced. Same shape as this experiment's 60-second integer program on 150 guests, far from any proof.

Rhyd Lewis at Cardiff University recast the problem as graph partitioning: each party that must sit together is a vertex and preferences are edge weights, so it contains both even table splitting (k-partition) and keeping enemies apart (graph colouring). He solved it in two stages, a tabu search that first satisfies every keep-apart rule and then a search that raises the score, and ran it on a wedding-seating website. Users give only three kinds of input: "definitely apart", "rather apart", "rather together". Letting users enter weights would confuse them, he wrote. This episode's v1 score function backs that judgement. In 2016, with Fiona Carroll, he compared the method with a commercial integer-programming solver in the Journal of the Operational Research Society.

**A quantum-computing test bench.** Seating is also used to test quantum computers. Karie Nicholas and Vikram Mulligan mapped wedding-reception seating into the cost-function form they had used for protein design and gave it to both classical Monte Carlo solvers and a D-Wave quantum annealer. The classical side found optimal seatings easily; the quantum hardware struggled to return optimal ones. They released a set of seating problems as a benchmark: a small everyday headache turned into a yardstick for computing machines.

**Problems of the same shape.** "Split things that mustn't collide into different slots, keeping slots balanced" is also exam timetabling (no two courses sharing a student at the same time), class allocation, and splitting conference sessions. It's no accident Lewis came to seating from graph colouring.

## What it can't do

- **It can't find out relationships.** The solver is only as good as the relationship table you give it. Who is awkward with whom has to be written down by the host, and it's usually awkward to write. In practice filling in that table takes longer than the seating.
- **It knows nothing of rank or face.** The head table, seats of honour, "why is our family at the back" are not in the score. They could be, but someone has to pick the numbers.
- **It knows nothing of space.** Distance from the stage, tables by the restroom, the route from the door are reduced to "one wheelchair spot".
- **It can't prove optimality.** From 80 guests on, the integer program couldn't prove anything in 60 seconds. Annealing's plan is a good plan, not a guaranteed best one.
- **It can't say "impossible".** Annealing only says it didn't find one. Whether a plan exists must be asked of the integer program.
- **It wasn't checked against real guests.** The guests are synthetic and the human approach is an imitation, not a real list arranged by a real planner.

## So, is it one click?

The solver itself was. Writing the problem as numbers plus annealing and the five comparison methods came to about 570 lines of JavaScript, and even 150 guests get a chart in 4 seconds. Hand the formula to an open-source integer-programming solver and it proves the 30-guest optimum in 0.1 seconds.

The score function was not. The first version was optimised flawlessly, and 28 of 150 guests ended up sitting alone. The second shrank that, but many of those left alone were older guests in wheelchairs. Only the third put "leave nobody alone" into numbers. The solver doesn't do this part for you. You see it only by looking at the drawing and reading the names behind the red dots.

If you have to seat a year-end party or a banquet, here's the advice. When filling in relationships, list who each person knows before listing who they clash with. Keep one table spare. If the plan won't come together, look not at the average but at the one person the constraints pile up on. And before you print the solver's chart, check once more for anyone who knows nobody at their table.

## Sources

- Meghan L. Bellows, J. D. Luc Peterson, ["Finding an optimal seating chart"](https://improbable.com/news/2012/Optimal-seating-chart.pdf), Annals of Improbable Research (2012)
- Rhyd Lewis, ["Constructing Wedding Seating Plans: A Tabu Subject"](https://www.rhydlewis.eu/papers/WSPTabu.pdf), manuscript submitted to GEM'13
- Rhyd Lewis, Fiona Carroll, ["Creating seating plans: a practical application"](https://ideas.repec.org/a/pal/jorsoc/v67y2016i11d10.1057_jors.2016.34.html), Journal of the Operational Research Society 67(11) (2016)
- Karie A. Nicholas, Vikram Khipple Mulligan, ["Entangled happily ever after: Wedding reception seating mapped to classical and quantum optimizers"](https://arxiv.org/abs/2604.10497), arXiv:2604.10497
- Ministry of Foreign Affairs (Korea), [Protocol and etiquette: banquets and seating](https://www.mofa.go.kr/www/wpge/m_4061/contents.do) (in Korean)
- [OR-Tools CP-SAT](https://developers.google.com/optimization) (Apache-2.0)
- All guests, relationships and table layouts are synthetic; names are fictional roles.

