Floor Plan Manager
Making restaurant section assignments actually fair
The Problem
Dividing a restaurant floor into fair sections takes a lot longer than it should. Working at Queen's Harbor, I figured I could automate it.
The Algorithm
The core is a Seeded Region Growing algorithm. Three phases:
1. Seed Selection
First seed is the table closest to the floor's centroid. Each subsequent seed is chosen using the maximin distance criterion — pick the table that maximizes its minimum distance to all existing seeds. This guarantees optimal spatial dispersion. Additionally, prechosen adjacency constraints are respected, so tables that shouldn't be in the same section are not.
2. Region Growing
Iteratively expand sections. At each step, grow the section with the lowest current workload
by adding an adjacent unassigned table. Workload is calculated as:
seats × 1.0 + priority × 0.5. This naturally balances the distribution.
3. Border Refinement
After initial assignment, swap border tables between adjacent sections to minimize workload standard deviation. Uses BFS to verify swaps don't disconnect any section.
4. Cutting Servers
If the restaurant isn't busy enough to justify having as many servers as there currently are and some servers are cut, the algorithm will simply assign their tables to the remaining servers, ensuring that previous sections aren't disrupted.
Complexity: O(K × T × N × D²) where T = tables, N = servers, D = avg adjacency, K = refinement iterations.
In practice, runs in <100ms for typical restaurant layouts.
Tech Stack
- Go
- React
- TypeScript
- PostgreSQL
- AWS ECS
- Docker
- GitHub Actions
Features
- Drag-and-drop floor plan editor
- Automatic section generation
- Shift scheduling
- Role-based access
- Multi-location support
Server View
Servers can pull up the floor plan on their phones and see their assigned section.
Working with Users
Ran regular demos with managers at Queen's Harbor throughout development. Gathered requirements by watching how they currently assign sections, asked what frustrated them, and iterated based on their feedback.
Early versions were too automated — managers wanted manual override options. Added drag-to-reassign after hearing that. Also simplified the UI after observing they only glance at it during busy rushes.