After writing "Why the 60 cm route check can fail a 63 cm gap" I left the problem alone for a while. I've now rewritten the route check from scratch, and before doing that I went back to see exactly when the old one got it wrong. These are my notes from that.
A room with one way through
I needed a room where the right answer was certain. Two wardrobes block a 300 × 400 cm room from wall to wall, with a single gap between them. To reach the far side you have to use that gap, so whether a 60 cm-wide person fits depends only on whether the gap is at least 60 cm.
I tried gaps of 59, 60, 61, 63 and 68 cm. The new check blocked the 59 cm gap and let the rest through. At exactly 60 cm a person brushes both wardrobes with nothing to spare; the site already treats touching as not overlapping, so that counts as getting through.
Why the old check failed
The old note said that checking points every 10 cm made the check up to 10 cm too strict. That was true, but it didn't explain everything. I moved the same 63 cm gap one centimeter to the right ten times, and the old check let it through only 4 times. For a 60 cm gap it was 1 out of 10, for 68 cm 9. Whether a multiple of 10 happened to fall inside the gap decided the answer. A check that changes its mind when a wardrobe moves 1 cm is hard to trust. The new one gave the same answer all ten times.
The layout from the note
With the wardrobe at 185, the old check said "not found" and the new one finds a way. Looking again, that spot sits between two corners 63 cm apart across and 23 cm apart down, so they are really 67.1 cm apart. The old check drew square buffers around furniture and saw only the 63 cm. The new one rounds the corners of the buffer. The narrowest point on the path it found is 66.1 cm, about a centimeter under the corner distance, because the path is drawn through evenly spaced points.
Two answers held back
I also tried eight corner-to-corner gaps from 58 to 63.6 cm. The old check blocked all eight, the 63.6 cm one included. The new one blocked 59.5 cm and under, let 60.1 cm and over through, and for 59.8 cm, 60 cm said "not verified" instead of answering. Those gaps are within 0.2 cm of 60, and even with points 1.25 cm apart it couldn't settle them. I'd rather it say it doesn't know than guess.
How the new check decides
Once it finds a path, it walks along it and measures the distance to every wall and piece of furniture the whole way. If any stretch comes closer than 30 cm, that path is dropped, so "connected" means the path really is walkable. For "blocked" it works the other way: it leaves open every spot where someone might possibly stand and checks that there's still no way through. If neither check settles it, the answer is "not verified".
The count
In these runs the old check called a gap of 60 cm or more blocked 21 times, and called an impassable gap open 0 times. The new check gave 0 wrong answers and held back 2.
60 cm is this site's benchmark, not a legal standard. Turned sideways people fit through narrower gaps, and carrying a laundry basket they need more.
Data
| Gap | Right answer | Old | New | Narrowest point on the path (cm) | Result |
|---|---|---|---|---|---|
| 59 cm | Blocked | Not found | Blocked | – | PASS |
| 60 cm | Connected | Connected | Connected | 60 | PASS |
| 61 cm | Connected | Connected | Connected | 61 | PASS |
| 63 cm | Connected | Connected | Connected | 63 | PASS |
| 68 cm | Connected | Connected | Connected | 68 | PASS |
| Gap | Positions the old check passed | Positions the new check passed | Result |
|---|---|---|---|
| 59 cm | 0/10 | 0/10 | PASS |
| 60 cm | 1/10 | 10/10 | PASS |
| 63 cm | 4/10 | 10/10 | PASS |
| 68 cm | 9/10 | 10/10 | PASS |
| Wardrobe left edge | Gap across | Corner to corner | Old | New | Narrowest point | Result |
|---|---|---|---|---|---|---|
| 206 | 84 | 87.1 | Connected | Connected | 80 | PASS |
| 195 | 73 | 76.5 | Connected | Connected | 75.2 | PASS |
| 190 | 68 | 71.8 | Connected | Connected | 69.9 | PASS |
| 185 | 63 | 67.1 | Not found | Connected | 66.1 | PASS |
| Diagonal gap (cm) | Right answer | Old | New | Result |
|---|---|---|---|---|
| 58 | Blocked | Not found | Blocked | PASS |
| 59 | Blocked | Not found | Blocked | PASS |
| 59.5 | Blocked | Not found | Blocked | PASS |
| 59.8 | Blocked | Not found | Not verified | PASS |
| 60 | Connected | Not found | Not verified | PASS |
| 60.1 | Connected | Not found | Connected | PASS |
| 61 | Connected | Not found | Connected | PASS |
| 63.6 | Connected | Not found | Connected | PASS |
Where the right answers came from. For the blocked-off room the answer is one rule: the gap lets a person through if it's at least 60 cm. For corner-to-corner gaps, the rule is the same with the distance between the corners. Separately, a Python program that doesn't use the planner's code put a point every centimeter on the floor, marked where a person could stand, and spread out from the door to see if it got through. The old results were compared with a Python rewrite of the old rules.
Open in the planner
- 59 cm gap in a wall-to-wall barrier
- 60 cm gap in a wall-to-wall barrier
- 61 cm gap in a wall-to-wall barrier
- 63 cm gap in a wall-to-wall barrier
- 68 cm gap in a wall-to-wall barrier
- Note layout, wardrobe left edge at 206
- Note layout, wardrobe left edge at 195
- Note layout, wardrobe left edge at 190
- Note layout, wardrobe left edge at 185
Running these three lines in the site's repository rebuilds the files. If the calculation code changes and these files aren't rebuilt, the site won't build, so the numbers on this page can't drift away from what the planner does.
node tools/run_experiments.mjs
python tools/verify_experiments.py