I trusted the algorithm over the evidence on the wall, and Tobi Lund paid for it.
I'm going to tell it plainly. I have thought about how else to tell it, and every other version puts me in a better light.
By the third day on Floor Three we had a routine. At the top of each hour the Labyrinth reshuffled its doors, and we spent the first half mapping the new connections ring by ring, scouts reporting to Ruth's chalk wall. By minute twenty-five we usually knew which rooms touched which. The rest of the hour was for acting on what we knew.
The job was simple on paper: take the brass key from elm_44, carry it to the gold door in elm_31, and the door would open for good. Two legs, one hour, and we'd get there before the clock ran out if we picked the right route.
Picking was the problem. By now we knew the doors didn't all cost the same. The rooms sat on a fixed grid, and every door was a passage between two of them, so a door to a neighbor took about forty seconds to walk, and a door to a room five squares away took five times that. The reshuffle changed which rooms touched, but never how far apart they stood. That meant *breadth-first* wasn't enough any more. We needed the cheapest path by time, not by count of doors.
"There's an algorithm for that," I told Ruth on the morning of Day Fifty, standing at the chalk wall with forty-two rooms mapped and six to go. "Dijkstra. It finds the cheapest route from a start to every other room. It's slow, though. You expand rooms in order of cost, so you end up looking at almost everything."
"How slow?"
"Doing it by hand, with this many rooms? Twelve minutes of chalk arithmetic. Twelve minutes we don't have."
"Then we need a shortcut," said Tobi.
He was leaning against the far wall with his chess set open on a crate, playing both sides against himself. He'd been that way since I'd met him: restless, funny, and the one person on the team who asked a second question when everyone else was content with one answer. That morning he had bet Pim two marks that he could beat him in twenty moves. Pim had accepted at once, then lost in nineteen.
"There is a shortcut," I said. "It's called A-star. It's Dijkstra with a compass. You give it an estimate of how far each room is from the goal, and it explores the promising ones first. The estimate is called a heuristic."
"What stops it from lying?"
"One rule." I held up a finger. "The estimate must never be *bigger* than the true remaining cost. It can be too small. That just means the algorithm looks at a few extra rooms. But if it's ever too big, A-star might discard the best route because it *thinks* it's expensive. That's called being admissible. An admissible heuristic never overestimates, and if you use one, the path A-star returns is guaranteed to be the cheapest."
"Is ours admissible?" said Ruth.
"It should be." I pointed at the room names. "Forty-eight rooms. The plates run elm_00 to elm_47. They sit on a grid. Eight across, six down. Room number N is in row N divided by eight, column N remainder eight. A passage can't be shorter than the grid distance it spans, and every passage costs forty seconds a step. So forty times the grid distance to the goal can never be more than the true time. It can't be too big."
It was a pretty argument. I was proud of it. I said it with the quiet confidence of a man who has once explained something to a child and watched the child nod.
"Every door costs forty seconds a step?" Ruth asked.
"Every one we've timed."
"Dolores mentioned an arch. In elm_03."
"A glowing one." I'd noted it, yesterday, and moved on. "She walked through it and came out in elm_43 in no time. She had a bad stopwatch. Doors don't skip space."
"Doors don't skip space," Ruth repeated, flat, the way she said anything she wasn't going to argue with yet.
"The grid's regular. It's a floor, Ruth. A building. People build buildings."
She looked at me for a long moment, and I looked back. Then she shrugged, as much as a small, straight-backed woman can shrug, and went to chalk the board.
We ran A-star by hand: Ruth keeping the frontier list, me adding costs, Pim shouting the numbers across the room. It took seven minutes. By minute thirty-two, we had a route.
**elm_00 to elm_44: ten doors. Seven minutes, twenty seconds. Then elm_44 to elm_31: six doors. Four minutes, forty seconds.** Total: twelve minutes exactly. Mapping had dragged that morning, a collapsed passage in elm_21 had cost us time, and it was minute forty-two when we set out. We'd reach the gold door at minute fifty-four, with six to spare.
"It's the cheapest possible route," I said. "A-star with an admissible heuristic, so it can't be beaten."
Lena was standing at the back with her ledger open. She looked at the chalk wall for a long time, and I realized she'd been looking at one corner of it, the corner with the arch at elm_03. She didn't say anything. I would remember that, afterward. I'd tell myself she hadn't known, and that was true. But she'd had the same number I'd had.
We went.
I won't describe the whole run. It was hot stone corridors and the sound of boots on rubble, and a fallen lintel in elm_36 that cost us four minutes we hadn't planned for. The first leg still went well. We found the brass key in a niche in elm_44, a heavy thing the length of my hand, and I passed it to Pim, who tucked it inside his shirt and shivered. The second leg was a long climb. Tobi led, humming and taking the stairs two at a time, because someone had to keep a pace for the rest of us.
At minute fifty-eight we were in elm_29, one door from elm_31, twelve people breathless in a line.
"Two minutes," Dolores called. "It said reshuffle on the hour, yes?"
"It reshuffles on the hour," I said. "We have time."
We had *just* enough time. That was the thing. It had worked out to the second, because we'd planned it to the second. We'd planned for a world where nothing went wrong, and that's a plan with no slack.
The gold door was in view. Pim ran to it. The key turned. The door swung open on a long dark staircase, and the Herald's voice came down like a tired sigh: "FLOOR FOUR: UNLOCKED. Please proceed."
"Go," I said. "*Go.*"
They went. Dolores, then Ruth, then Pim, then the scouts. I stood at the threshold counting heads, and when the last one went through I turned back and saw that Tobi was still in the doorway of elm_29, with the white king in his hand.
He'd dropped it. Of course he had. He'd been running with the chess set in his pocket, and the king had slipped out and rolled across the floor of elm_29, and Tobi, who'd lost his wife eight years ago and had apparently decided to keep one thing from before, had gone back for it.
"Tobi!"
"Coming," he called. He bent and picked it up. He grinned at me across the room.
The stone began to move.
It starts as a sound. A dry, deep groan from inside the walls, like a mouth opening. The floor of elm_29 shuddered. The archway above him lowered an inch, then two, and the room's walls began to slide sideways on hidden rails.
"*Run!*"
He ran. He was a fifty-two-year-old systems administrator with a bad knee, and he ran for four steps, and the doorway to elm_31 sealed itself in front of him as neatly as a mouth closing.
I got there first. I got my hands on the stone. It was warm. I could feel it grinding, and a bar of light in the gap thinning to a line, and through the line I could see Tobi's face, quite calm.
"Interesting," he said.
It was the word he used when something was bad. He looked at the ceiling. He looked at his hand, with the white king in it, and then he looked at me, and I saw him decide to say the useful thing instead of the other thing.
"Check your heuristic," Tobi said.
The gap closed.
For a long time nobody spoke. Then Pim made a sound I'd have given anything not to have heard.
The overlay on the corner of my vision flickered. **ALIVE: 1,005.**
I sat down on the stairs.
Ruth found me there ten minutes later. She didn't say she was sorry. She sat down next to me and put the chalk board on her knees and turned it so I could see.
"Look at elm_03," she said.
I looked. It was a small mark in the corner, the glowing arch Dolores had reported. A note beside it in Pim's hand: *elm_03 to elm_43. Time: 0.*
"Elm_03 is row zero, column three," Ruth said. "Elm_43 is row five, column three. Five steps on the grid. Your heuristic says five steps is at least two hundred seconds. The arch takes none." She paused. "The grid can't tell you about the arch. Your estimate was too *big* for every room that touched it. The heuristic lied, and A-star believed it, and the algorithm threw the arch away without looking, because it thought those rooms were too far from the goal to be worth exploring."
I stared at the board. I did the calculation I should have done at minute thirty-two. Elm_00 to elm_03: three steps, a hundred and twenty seconds. Through the arch to elm_43: no time. Elm_43 to the key in elm_44: forty seconds.
"The key was reachable in two minutes forty," I said. "The whole run was seven minutes twenty, not twelve. We'd have been at the gold door at minute forty-nine, even with the fallen lintel."
"Yes."
"I'd have had ten minutes of slack. Tobi would have been in the stairwell with the rest of us, playing against himself."
"Yes."
"I told you doors don't skip space. You asked me, and I told you."
"You did." Ruth's voice was very even. "You made a rule, and you were right nine hundred and ninety-nine times out of a thousand. You didn't test it on the thousandth."
"I should have."
"You should have. It isn't a sin to be wrong. It's a sin to be wrong and not check." She looked at me with flat, ancient grey eyes. "Thirty-one years of dispatch. I put a truck on the wrong road once. A man died. I carried it for a decade, and then I learned something. A mistake is information. The question is whether you spend it."
I was crying, a little, with the horrible dry shame of someone who has no right to. Ruth did not look away.
"The next time," I said, "I check every edge. Every one. I don't assume. I *verify*."
"Good," said Ruth. She put one hand on my shoulder, briefly, and took it away. "Now tell me why a designer who builds a grid at all would put a free arch from elm_03 to elm_43 in it."
I opened my mouth, and then shut it.
"Because it's the one thing that doesn't fit," she said. "And things that don't fit are where the author is."