The Ashen Crown had been inside the Labyrinth for three hours when I arrived, and they were already losing.

I could tell by the sound. Floor Three began behind a bronze door at the top of the Coin Hall stairs, and through it came the noise of forty people arguing in a very large space: the flat slap of boots, the clang of someone hitting a wall with a spear, a voice shouting "We *passed* this!" in the tone of a person who has said it before.

"Left-hand rule," said Ruth Adeyemi, at my elbow. "Put your left hand on the wall and walk. They've been doing it for three hours."

"Does it work?"

"In a maze with no loops, it always works. In a maze with loops, it works until it doesn't, and then you walk in a circle around an island until your feet fall off." She was fifty-eight, small and straight-backed, with grey hair cropped like a soldier's, and she looked at the door the way I'd seen paramedics look at car wrecks. "I spent thirty-one years dispatching freight for a company that moved four hundred trucks a day across six states. People think routing is about maps. It's about knowing which questions the map can't answer."

"You gave me the bread," I said.

She didn't turn her head. "I gave a hungry man a heel of bread. I don't know anything about the chalk."

But the corner of her mouth moved, and I had the strong impression of being allowed to believe something without being told it.

I had been told, by the Arbiter's sentence, to teach whatever I found to anyone who asked. Ruth had asked on the first morning. She'd stood in the Hearth corridor with her arms crossed and said, "I'm told you can read machines. I'd like to see you read a building."

Now there were five of us at the base of the bronze door. Me. Pim, carrying chalk in a satchel and an expression of terrible importance. Ruth. Tobias Lund, who went by Tobi, fifty-two, a systems administrator from a hospital, with a chess set in his coat pocket and a habit of saying "interesting" in a way that meant its opposite. And Lena Moritz, who had been assigned by Crane to observe, and who had brought an extra ledger and said nothing about why.

"Have you tried turning it off and on again?" Tobi said, looking at the door.

"Every sixty minutes, apparently," I said. "The Herald says the map reshuffles."

"I like a challenge that reboots."

I pushed the door open.


Floor Three was a maze made of rooms.

I'd been braced for corridors. Instead, the bronze door opened into a round stone chamber about the size of a classroom, empty except for six archways leading out of it. Above each archway, a small brass plate. Above the one we had entered by, a plate that read **elm_00**. Through the first archway, another chamber, round and identical; above its archways, plates reading **elm_01**, **elm_02**, **elm_03**.

I stopped.

"What?" said Pim.

"Nothing." I stared at the plates. They were in a plain lowercase font, and the underscore sat just a little below the line, the way my own keyboard had always drawn it. *elm_04.* *elm_05.* I could feel the thing in my chest, the old key turning, and I didn't want to look at what it opened. I had grown up on Elmhurst Lane, a short curved street of brown houses and cracked pavement and one streetlamp that never worked. I hadn't thought of it in years. I hadn't thought of it at all.

It was a coincidence. It was a stupid, ordinary coincidence. Elm was a common word.

"Kai," said Ruth.

"I'm fine." I wasn't. "Forty-eight rooms. Names go up to elm_47. Each room has between two and six exits. That's a graph."

"A what?" said Pim.

"A set of places, and a set of doors between them. Mathematicians call the places *nodes* and the doors *edges*. A maze isn't a space. It's a list of who's next to whom." I pulled out the chalk and knelt on the floor. "Every question about a maze is a question about that list. How do I get from here to there? What's the fewest doors? Is there a loop? The walls and the rooms and how big they are, none of that matters. What matters is the connections."

I drew a dot for elm_00. Six lines coming off it, each ending in a smaller dot.

"We can't see the whole map," Tobi said. "We only know the rooms we've visited."

"Correct. So we build it as we go."


There are two basic ways to explore a graph you can't see all at once, and every programmer meets them in the first year. The first is to pick a door and keep going, as deep as you can, and when you hit a dead end, back up one step and try the next door. That's called depth-first. It's what the Ashen Crown was doing, with their left hands on the stone. It has one great virtue: you don't need to remember much. And one great vice: it dives. If the exit is two doors from the start and you chose the wrong first door, you may walk thirty rooms before you backtrack.

The second way is to explore in rings. Visit everything one door from the start. Then everything two doors away. Then three. You always know the shortest path to anywhere you've reached, because you reach it by the fewest doors. That's breadth-first. It costs you memory, because you have to keep track of the frontier, but it never wanders.

"An hour," I said. "That's what we have before it reshuffles. At forty seconds a door, that's ninety doors, total. Ninety walks. The Ashen Crown's been spending theirs wall-hugging. We'll spend ours in rings."

"I only have five people," said Ruth.

"Crane's given us twelve scouts." I nodded at the doorway, where a dozen men and women in grey coats waited with very uncertain faces. Lena had arranged it. "In the first ring there are six doors. Six scouts, one each. They go through, look at the room, write down the name and the number of exits, and come back. Then the second ring."

"They come *back*?" said one of the scouts.

"They come back and report. Nobody keeps going. Nobody's lost." I held up the chalk. "That's the rule. The report goes on the wall. The wall *is* the map."

It's remarkable how much people will tolerate once they have a rule that makes sense. By minute eight, Pim had drawn the first ring on a chalk board bolted to the wall of elm_00, and a dozen scouts were coming and going through the archways with the brisk, relieved energy of people who knew what to do. Ruth stood beside Pim and called the queue. Each report, she repeated aloud, and each report went up in a line. *elm_02: doors to elm_09, elm_14, elm_31. elm_03: doors to elm_05, elm_21.*

"It's a dispatch board," Ruth said, a little breathless, around minute twenty. "It's a freight dispatch board. We had these. A wall, a piece of chalk, and a lot of people yelling."

"Do you want to run it?"

"I've been running it for twelve minutes." She did not smile. "You'd better learn to keep up."

The second ring took twelve minutes, the third took nine, and in the fourth ring, at minute thirty-six, a scout named Dolores came running back so fast that she skidded on the stone. "There's a door," she gasped, "in elm_31. Gold. A big one. It says *Floor Four.* It's locked. There's a keyhole and a plaque: *Key in elm_44. Return before the shuffle.*"

"Which way did you come?"

"elm_00 to elm_02 to elm_31."

"Two doors," Pim said, in awe. "That's *two doors*."

"Not quite," I said. "elm_02 to elm_31 is two rooms. But we'll need to count the way back." I looked at the board. Every route from elm_00 to elm_31 that anyone had found was on it. Two of them were short. One of them, a winding path that Ashen scouts had walked an hour earlier, using their left hands, came to nineteen. "Ring by ring, we reached it in the shortest possible number of steps. Nobody could do better. That isn't luck. It's guaranteed."

"It's *guaranteed*?" said Tobi. He sounded delighted.

"On a graph where every door costs the same, the first time breadth-first search reaches a room is the shortest way there. It can't miss. It's the closest thing to a free lunch you get in this business."

Lena had been writing steadily, and now she looked up. "The Ashen Crown's DFS group reached elm_31 as well," she said. "Fifty-six minutes in. By a nineteen-door route. They're lucky the clock didn't run out."

"They'd be luckier with a queue."

"What's a queue?" said Pim.

"A line where the first one in is the first one out. It's how breadth-first remembers whose turn it is."


At minute fifty-two, the Herald's voice rang through the chambers: "Attention, Wakers. In eight minutes, the Labyrinth will reshuffle its connections. Rooms retain their names. Doors do not. Please do not be inside a wall. TODO: warn people better than this."

"Eight minutes," Ruth said. "Can we get everyone out?"

"It's two doors back to elm_00. Everyone goes. Now. We have the whole map of this hour on the wall, and it's worth nothing next hour. Copy the room list, not the doors."

We went. We went through elm_02 and then elm_00, forty of us in a long grey line, the bronze door swinging wide to the cold corridor of Floor Two. Behind us, I heard the first shuddering groan of stone beginning to move, the sound of a building rearranging its own mind.

Tobi caught my arm outside. He was out of breath and flushed and, for once, not joking.

"That was beautiful," he said. "I've watched people debug a data center for forty hours straight and never get that clean."

"We didn't get the key."

"We got the shortest route to the lock, and we know where the key is. That's two-thirds of a plan." He looked at me with sudden seriousness. "It's going to get harder. The map reshuffles. The rooms keep their names. The doors don't. If a graph changes every hour and you only get ninety door-walks to learn it, you're going to need to learn something *about the changes*."

"Yes," I said. "That's exactly what I've been thinking."

Ruth was beside us, arms folded, the chalk board under one arm. She'd listened to all of it without a word, and now she said, in her flat dispatcher's voice, "Then there's a rule that moves the doors. And somebody wrote it. And whoever wrote it left the room names plain."

I looked at the board. Pim had copied the full list of names down the right side, in his neat, proud hand: elm_00 down to elm_47.

"Yes," I said. "Somebody wrote it."

I did not say that I had a sinking certainty about what the rule would look like, and who had written it, and that I had begun, very faintly, to hate the shape of that handwriting.