The Mathematics of AI Agents, laboratory reader ยท Chapter 21

Markets, Teams, and Institutions

Each participant can make a sensible local choice while the whole workflow gets slower; a rule decides whether local incentives add up to the task.

These four demonstrations use the chapter's five-edge traffic network: one unit of traffic from S to T, two routes that each mix a congestible edge with a fixed one, and a free directed link in the middle. They show why the free link moves the stable pattern away from the best one, how far the damage can go for linear delays, how a charge on exported delay repairs it (and how a toll on the link alone differs), and what the capacity comparison does and does not promise.

Every example in these readers is a constructed teaching example. The probabilities, utilities and cases are declared inputs chosen to make the mathematics visible. They are not measurements of any deployed agent, product or team.

Demonstration 1 of 4

A free link: better, worse or unchanged

When a zero-latency link is added, why does the stable pattern of choices differ from the best one, and how does that depend on demand?

The left panel prices each route at every possible flow z on the middle link: the middle route rises twice as fast as an outer route because it uses both congestible edges, so it stays cheaper than an outer route until z reaches 2 - D, and travellers keep switching until then. The right panel prices the whole system at the same z: total latency is smallest at z = 1 - D, or at zero when that is negative (for the demands from 0.5 to 2 offered here). The two panels have different minimisers, which is the gap between a stable private pattern and the best total. At demand 1 everyone takes the link, each trip costs 1 + 1 = 2, and TL rises from 1.5 to 2, while the best split is still the old one. At low demand the link is a real gain, and at high demand it is unused because the outer routes have already become as slow as the middle. Without the link the two panels agree on one split.

Equation (21.1), written in LaTeX: \operatorname{TL}(q) = \sum_{e\in\mathcal E} q_e \ell_e(q_e)

Scroll sideways for the whole equation

S is the source, T the target, U the upper junction and L the lower junction. The three routes are S-U-T, S-L-T and S-U-L-T, which crosses the directed middle link from U to L. q is a flow (the amount of traffic) and q_e the traffic on edge e. The latency function l_e(q_e) is the delay a traveller meets on edge e. TL(q) is total latency: the sum over edges of traffic times delay. Here the two congestible edges (S-U and L-T) have delay equal to their flow, the two fixed edges (U-T and S-L) have delay 1, and the middle link has delay 0. Demand D is the total traffic from S to T; z is the flow on the middle route, and v = (D + z) / 2 is then the flow on each congestible edge. The equilibrium is the pattern in which no traveller can lower their own delay by switching routes. Choosing 'link removed' deletes the middle link, so only the two outer routes remain.

Predict first. At the chapter's demand of 1, will total latency with the link be higher, lower or the same as before? Then try demand 2.

Your prediction

Choose an example

Scroll sideways for the whole figure

Figure: A free link: better, worse or unchanged. Left, route costs against the flow z on the middle link: the outer route rises slowly and the middle route rises faster, with the equilibrium at z = 1.00. Right, total latency against z, with the optimum 1.500 at z = 0.00 and the equilibrium 2.000 at z = 1.00.
Demand (units of traffic from S to T): 1, Network: With the free link
Constructed example: the chapter's one-unit network with demand varied, with and without the link; equilibrium and optimum are computed with the laboratory's congestion function.

Calculated values

Total latency before the link
1.500
Total latency, link added (equilibrium)
2.000
Total latency, social optimum
1.500
Latency of each trip with the link
2.000
Flow on the middle link
all travellers
Equilibrium over optimum
1.333

At z = 0 an outer route costs 1.00 / 2 + 1 = 1.50 and the middle route costs 1.00 + 0 = 1.00, so travellers switch to the link. At equilibrium with the link, all travellers take the middle link, so each congestible edge carries 1.00. Summing flow x latency over the five edges (the middle link and its zero latency add nothing): 2 x 1.00 x 1.00 + 2 x 0.00 x 1.00 = 2.00 + 0.00 = 2.00. Before the link the same demand split evenly: 1.00 x (1.00 / 2 + 1) = 1.500. Adding the link raised total latency from 1.500 to 2.000, a rise of 0.500, although no road got slower. The planner's best split (1.500) is the old one and ignores the link.

Worked steps

  1. Demand D = 1.00. With z on the middle route, each congestible edge carries v = (D + z) / 2.
  2. At z = 0: outer route 1.00 / 2 + 1 = 1.50; middle route 1.00 + 0 = 1.00.
  3. Equilibrium z = 1.00, so v = (1.00 + 1.00) / 2 = 1.00.
  4. Seen costs at equilibrium: outer 1.00 + 1 = 2.00, middle 2 x 1.00 = 2.00.
  5. Total latency at equilibrium = 2 x 1.00 x 1.00 + 2 x 0.00 x 1.00 = 2.00 + 0.00 = 2.00.
  6. Social optimum: z = 0.00, total latency 1.500.
  7. Ratio = 2.000 / 1.500 = 1.333.

Use the idea

Before adding a shared shortcut such as a common reviewer, a shared tool or a fast lane, ask what everyone will do once it exists, not whether one case could finish faster against yesterday's traffic.

Where the conclusion applies

One unit-scale network with linear congestible edges, many small travellers who each pick the cheapest route, and a total-delay objective. It does not say that any real shortcut, tool or team behaves this way. In this construction the paradox disappears once demand is large enough to make the outer routes as slow as the middle route (the two totals tie at demand 2); this is a result of the reader's computation, not a statement of the chapter.

Common wrong turn: More options must make everyone better off
The chapter says this is no contradiction: each traveller correctly reads the available routes, and only the premise that more options must improve their collection fails. The measurement that lies by omission records each traveller's best response, not whether those responses add up to the system's job.
What this does not settle

Braess's network does not prove that new tools, shared agents, markets, or centralized review make real teams worse. It gives a mechanism to test: changed options alter the equilibrium created by local rules.

Chapter 21 source: "What this does not settle".

Check your understanding: At demand 1.5, what does each trip cost with the link, and how does that compare with the cost of an outer route?
Equilibrium puts 0.5 on each outer route and 0.5 on the middle, so each congestible edge carries 1.0. An outer route costs 1.0 + 1 = 2.0 and the middle costs 1.0 + 1.0 = 2.0, a tie. Total latency is 2 x 1.0 x 1.0 + 2 x 0.5 x 1 = 3.0, which is 2.0 per trip.

Chapter 21 source: section "A free connection changes what best means". Demonstration C21-D01.

Demonstration 2 of 4

How bad can it get with linear delays

Across every demand, how large can the ratio of equilibrium delay to optimal delay be when every delay is linear, and where does the gap come from?

Each point of the left curve is the lab's equilibrium total divided by its optimal total at one demand. The ratio is 1 when the link is unused or already optimal. The right panel shows why it rises: it peaks where demand is just large enough that the optimum shuts the link while the equilibrium still crowds onto it (the hatched gap). With a free link the peak reaches 4/3 exactly, and no linear delay example can go higher. The chapter's strings-and-springs image states the same bound as a distance: after severing, the weight hangs at least 1 / (4 / 3) = 0.75 of its original distance below the support.

Equation (21.2), written in LaTeX: \frac{\operatorname{TL}(q^{\mathrm{NE}})}{\operatorname{TL}(q^{\star})} \leq \frac{4}{3} \text{when every }\ell_e(q_e)=a_e q_e+b_e\text{ with }a_e,b_e\geq0

Scroll sideways for the whole equation

S is the source, T the target, U the upper junction and L the lower junction. The three routes are S-U-T, S-L-T and S-U-L-T, which crosses the directed middle link from U to L. TL(q) is total latency. q^NE is the equilibrium flow and q* the flow with the smallest total latency, so the ratio compares self-directed routing with the best feasible routing. Linear means each edge delay is a times its flow plus b, with a and b not negative. The control sets a constant delay on the middle link (the b of that edge); 0 is the chapter's free link. In the right panel, the flow on the middle link is shown for the equilibrium and for the optimum at each demand.

Predict first. Make the link slower (delay 0.5). Does the highest ratio rise, fall or stay at 4/3?

Your prediction

Choose an example

Scroll sideways for the whole figure

Figure: How bad can it get with linear delays. Left, the equilibrium to optimum ratio against demand, peaking at 1.333 at demand 1.00 under a dashed 4/3 bound. Right, the flow on the middle link at equilibrium and at the optimum against demand, with a hatched gap where the equilibrium uses the link more than the optimum does.
Constant delay on the middle link: 0 (free link)
Constructed example: the chapter's network with a middle-link delay defined for this reader; ratios and flows are computed with the laboratory's congestion function.

Calculated values

Largest ratio on the grid
1.333
Demand at the largest ratio
1.00
Bound from Equation (21.2)
1.333
Room below the bound
0.000

Peak at demand m = 1 - 0.00 = 1.00. Everyone on the link: each trip costs 2 x 1.00 + 0.00 = 2.00, total 1.00 x 2.00 = 2.000. Optimum, nobody on the link: each trip costs 1.00 / 2 + 1 = 1.500, total 1.00 x 1.500 = 1.500. Ratio = 2.000 / 1.500 = 1.333. This reaches 4/3 exactly: the bound is tight for the chapter's own network. The curve is computed on 50 demands from 0.05 to 2.50, and no point crosses 4/3. The line is a ceiling for linear delays only; the chapter says the broader class has no finite ceiling.

Worked steps

  1. A link trip costs 2v + 0.00 against v + 1 on an outer route, where v is the flow on a congestible edge.
  2. The ratio peaks where the optimum has just shut the link but the equilibrium still crowds onto it: m = 1 - 0.00 = 1.00.
  3. Equilibrium total at m: 1.00 x (2 x 1.00 + 0.00) = 2.000.
  4. Optimal total at m: 1.00 x (1.00 / 2 + 1) = 1.500.
  5. Ratio = 2.000 / 1.500 = 1.333.
  6. Room below the bound = 4 / 3 - 1.3333 = 0.000 (the ratio carried to four decimals).

Use the idea

When someone quotes a worst-case ratio for a queue or workflow, first check that its delays really are linear over the range of load the team will see. A ratio proved for one class of delay says nothing outside that class.

Where the conclusion applies

The same one-unit network with the middle link given a constant delay. The bound applies because every delay stays linear. The chapter notes that if delays are only continuous and nondecreasing, the ratio can be unbounded; thresholds, retry storms and sudden queue growth may not have the linear form, in which case the 4/3 figure is not guaranteed.

Common wrong turn: Four thirds is a generic comfort number
The chapter says treating four thirds as a generic comfort number would repeat the opening error, substituting a convenient measurement for the object being measured. Under only continuous, nondecreasing latency functions the ratio can be unbounded, so the bound belongs to a declared model of delay, not to the word equilibrium.
What this does not settle

The linear four-thirds bound does not cover every queue or institution. Check the latency-function class before applying the ratio: a linear approximation over ordinary load does not establish a guarantee past that operating range.

Chapter 21 source: "What this does not settle".

Check your understanding: With a delay of 0.25 on the middle link, what is the highest ratio?
The peak is at demand m = 1 - 0.25 = 0.75. Equilibrium: 0.75 x (2 x 0.75 + 0.25) = 0.75 x 1.75 = 1.3125. Optimum: 0.75 x (0.75 / 2 + 1) = 0.75 x 1.375 = 1.03125. The ratio is 1.3125 / 1.03125 = 1.273, below 4/3.

Chapter 21 source: section "What linear bound says, and what it does not". Demonstration C21-D02.

Demonstration 3 of 4

Charging for the delay you export

If every congestible edge charges its own delay plus the delay the traveller adds for others, where does the equilibrium land, and how does a toll on the link alone compare?

Travellers still choose the cheapest route, but now by the charged cost. The charge turns the old comparison 1 + v against 2v into 2v + 1 against 4v, which moves traffic back toward the outer routes. The physical delay then equals the best possible total. A toll of 0.5 on the link alone is the notebook's variant: a different rule, although at the demands shown it gives the same flows and the same total as the marginal-cost charge. At demand 1 the smallest toll that empties the link is 0.5, and 0.49 leaves 0.02 of the traffic on it. At demand 0.5, the notebook's transfer case, the link is privately efficient, so the paradox depends on the demand regime.

Equation (21.3), written in LaTeX: \ell^{\mathrm{mc}}_e(q_e) = \ell_e(q_e)+q_e\ell'_e(q_e), \ell_e(q_e)=a_e q_e+b_e \Longrightarrow \ell^{\mathrm{mc}}_e(q_e)=2a_e q_e+b_e

Scroll sideways for the whole equation

S is the source, T the target, U the upper junction and L the lower junction. The three routes are S-U-T, S-L-T and S-U-L-T, which crosses the directed middle link from U to L. l_e(q_e) is the delay on edge e at flow q_e. The marginal-cost latency adds q_e times the slope of l_e, which is the extra delay one more unit of flow imposes on those already there. For a delay a x q + b the charged cost is 2 x a x q + b: the congestion term doubles and the fixed term does not. Here a = 1 and b = 0 on a congestible edge, and a = 0 and b = 1 on a fixed edge. A toll on the link alone adds a fixed charge to the middle route only; it is a different rule from the marginal-cost charge.

Predict first. At demand 1 with the marginal-cost charge, how much traffic uses the middle link?

Your prediction

Choose an example

Scroll sideways for the whole figure

Figure: Charging for the delay you export. Left, the delay line q with the doubled marginal-cost line and the fixed edge at 1, with a marker at flow 0.50. Right, flows on the three routes for 'marginal-cost charge' at demand 1.00: 0.50, 0.50 and 0.00, with the costs each chooser sees.
Charging rule: Marginal-cost charge, Demand (units of traffic from S to T): 1
Constructed example: the chapter's network and its marginal-cost charge at the laboratory's default demand 1, a changed toll and the transfer demand 0.5; the no-charge and toll cases use the laboratory's congestion function, and the marginal-cost flows are derived here and checked against the laboratory's optimum.

Calculated values

Rule
Marginal-cost charge
Outer route cost seen
2.00
Middle route cost seen
2.00
Flow on the middle route
0.00
Physical total latency
1.5000
Social optimum
1.5000

At demand 1.00 the equilibrium puts 0.50 on each outer route and 0.00 on the middle, so each congestible edge carries 0.50. Corrected cost of an outer route = 2 x 0.50 + 1 = 2.00; of the middle route = 2 x 0.50 + 2 x 0.50 = 2.00. Physical total = 2 x 0.50 x 0.50 + 2 x 0.50 x 1.00 = 1.5000. Physical total latency 1.5000 equals the social optimum 1.5000. The charge makes each chooser face the delay it adds for others, so the equilibrium lands on the optimum. Charge payments are transfers and are left out of physical latency.

Worked steps

  1. Rule: marginal-cost charge; demand D = 1.00.
  2. Travellers pick the cheapest seen route: 0.50 on each outer route and 0.00 on the middle.
  3. Each congestible edge carries v = 0.50 + 0.00 = 0.50.
  4. Corrected cost of an outer route = 2 x 0.50 + 1 = 2.00; of the middle route = 2 x 0.50 + 2 x 0.50 = 2.00.
  5. Physical total = 2 x 0.50 x 0.50 + 2 x 0.50 x 1.00 = 1.5000.
  6. Social optimum = 1.5000; excess = 1.5000 - 1.5000 = 0.0000.

Use the idea

In a shared workflow, the charge might be a rising budget for a busy shared tool, a queue-aware scheduler or a concurrency limit. The common property is that a local choice receives a signal about the shared resource it uses.

Where the conclusion applies

Linear delays, a total-delay objective, and a charge that is paid but not counted as physical delay. A real signal can be late, noisy, gameable or attached to the wrong boundary, and the objective may omit fairness or safety. The chapter treats the construction as proof that one gap can be closed under stated conditions, not as a general policy answer.

Common wrong turn: Treating the toll on the link as the marginal-cost charge
The chapter says the notebook's toll of 0.5 on the shortcut alone differs from its marginal-cost charge of 0.5 on each congestible edge. The charge also stays out of physical travel time: payments are transfers, and adding them to travel time would change the objective being minimized.
What this does not settle

Marginal-cost pricing does not decide fairness, authority, or legitimacy. Those require objectives and constraints stated outside the routing model.

Chapter 21 source: "What this does not settle".

Check your understanding: At demand 0.75 with the marginal-cost charge, what flow goes on the middle link?
Both route types are used, so their charged costs match: 2v + 1 = 4v gives v = 0.5. The middle flow is 1 - 0.75 = 0.25, each outer route carries 0.25, and the physical total is 2 x 0.5 x 0.5 + 2 x 0.25 = 1.0.

Chapter 21 source: section "Prices that make group target locally legible". Demonstration C21-D03.

Demonstration 4 of 4

Capacity is a comparison, not a cure

How does the cost of selfish routing at rate r compare with the best routing that must carry extra traffic?

Left panel: the optimal cost grows with the traffic it must carry, so asking the benchmark to carry more makes the comparison easier for the equilibrium. Right panel: the guaranteed factor 1 / extra falls from 4 to 1 as extra grows from 0.25 to 1, while this particular network stays near or under 1. The theorem is a worst-case promise and does not tell you which server to buy.

Equation, written in LaTeX: (1+\gamma_{\mathrm{cap}})r

Equation, written in LaTeX: 1/\gamma_{\mathrm{cap}}

Scroll sideways for the whole equation

r is the traffic rate and gamma_cap (written extra here) is a positive fraction. The first expression, (1 + gamma_cap) r, is the traffic the benchmark carries: an optimal flow that carries (1 + extra) times r. The second, 1 / gamma_cap, is the guaranteed factor. The theorem combines them: equilibrium cost at r is at most 1 / extra times the benchmark's cost at (1 + extra) r. The cost is total latency, as in Equation (21.1). Nobody adds a road: the network stays the same and only the benchmark's burden changes.

Predict first. With extra = 1 (the benchmark carries twice the traffic) at r = 1, is the equilibrium cost below or above the optimal cost at rate 2?

Your prediction

Choose an example

Scroll sideways for the whole figure

Figure: Capacity is a comparison, not a cure. Left, the optimal cost curve against the traffic rate, with the equilibrium cost 2.000 at r = 1.00 and the optimum 2.625 at 1.500 marked. Right, the guaranteed factor 1 over extra against this network's ratio 0.762, well below it.
Traffic rate r: 1, Extra-traffic fraction: 0.5
Constructed example: the chapter's network at rates defined for this reader; all costs are computed with the laboratory's congestion function.

Calculated values

Equilibrium cost at r
2.000
Optimal cost at (1 + extra) r
2.625
Equilibrium over optimum
0.762
Guaranteed factor 1/extra
2.00
Within the guarantee
yes

Equilibrium at r = 1.00: 2 x 1.00 x 1.00 = 2.000 (all traffic takes the link, each congestible edge carries 1.00). The optimum must carry (1 + 0.50) x 1.00 = 1.500: 1.500 x (1.500 / 2 + 1) = 2.625. Ratio = 2.000 / 2.625 = 0.762, against the guaranteed factor 1 / 0.50 = 2.00. This network sits far under the guarantee, which is a worst case over all networks, not a forecast. The benchmark is burdened with extra traffic, not given extra capacity.

Worked steps

  1. Equilibrium at r = 1.00: everyone takes the link, so each congestible edge carries 1.00.
  2. Equilibrium cost = 2 x 1.00 x 1.00 = 2.000.
  3. The benchmark must carry (1 + 0.50) x 1.00 = 1.500.
  4. Its optimal cost: 1.500 x (1.500 / 2 + 1) = 2.625.
  5. Ratio = 2.000 / 2.625 = 0.762; guaranteed factor 1 / 0.50 = 2.00.

Use the idea

In a staffing meeting, separate delay caused by too little throughput from delay caused by a rule that steers work into one stage. More capacity can lower delay at a given flow, but it can also make a stage attractive to more work and shift the equilibrium again.

Where the conclusion applies

The chapter's linear network and the rates r = 0.5, 0.75 and 1. The guarantee is a bound over all networks in its class, and this network does not come close to it, so the picture shows the comparison, not tightness. It says nothing about adding capacity to a real system, where demand responds.

Common wrong turn: Reading 'twice the traffic' as doubled capacity
The chapter says the phrase 'forced to carry twice the traffic' is the whole statement: it does not mean that capacity was doubled. The network is unchanged and the comparison changes the amount of demand the optimal benchmark must serve.
What this does not settle

The bicriteria comparison says how much worse a self-directed allocation can be relative to a deliberately burdened benchmark. It does not identify which server to buy.

Chapter 21 source: "It does not identify which server to buy".

Check your understanding: With r = 1 and extra = 0.5, what must the benchmark carry, and what is its cost?
It carries (1 + 0.5) x 1 = 1.5. At 1.5 the optimum uses only the outer routes, 0.75 each: 1.5 x (1.5 / 2 + 1) = 1.5 x 1.75 = 2.625. The equilibrium cost 2.0 is below it, and 1 / 0.5 = 2 times 2.625 is a much looser ceiling.

Chapter 21 source: section "Capacity is a comparison, not a cure". Demonstration C21-D04.