Selfish Routing & Price of Anarchy

Route drivers through a congested network and compare selfish choices with the social optimum.

Selfish Routing

Assign the next driver. Each driver chooses the route that currently appears cheapest.

Total cost0
Average0
PoA estimate1.00

How this teaches game theory

Scenario, mode, and level guide

Each scenario now runs a different experiment. This guide explains how the selected scenario, mode, and level affect the generated allocation and results.

Scenario explanations

Selfish routing

This is the interactive experiment. Human choices are applied directly, while computer-controlled drivers choose the route with the lowest current personal cost. The final distribution therefore depends on decentralized decisions.

Social optimum

Selecting this scenario immediately fills the network with the centrally coordinated allocation having the smallest possible total travel cost. Route buttons are disabled because drivers are assigned by the planner.

Price of Anarchy

Selecting this scenario automatically generates the repeated best-response selfish allocation, computes the social optimum, and displays their cost ratio. A value above 1 means selfish behavior produced an efficiency loss.

Mode explanations

Human vs Computer drivers

You choose one route, then the computer immediately assigns the next driver to the route with the lowest current individual cost. This mode highlights competition between a human decision and a myopic best-response strategy.

Human controls all drivers

You assign every driver manually. This is the best mode for testing hypotheses, deliberately constructing selfish outcomes, and comparing them with coordinated allocations.

Computer simulation

The computer fills the network automatically by repeatedly choosing the currently cheapest route. Resetting the game runs a new deterministic best-response simulation for the selected level.

Level explanations

Level 1 — Two routes

Eight drivers choose between Route A, whose cost rises with congestion, and Route B, whose cost is fixed at 8. This introductory case makes the trade-off between a cheap congestible route and a predictable route easy to see.

Level 2 — More drivers

Fourteen drivers use the same two-route network, while Route B has a fixed cost of 10. The larger population magnifies congestion and makes the difference between individual and collective efficiency more visible.

Level 3 — Braess link

Twelve drivers may also use Shortcut C, whose cost increases rapidly with use. The extra option can attract selfish traffic without improving total welfare, illustrating the intuition behind Braess's paradox.

Mode–level combinations

CombinationWhat happensWhat to observe
Human vs Computer × Level 1You and a best-response computer alternate assignments across two routes.When the congestible route stops being individually attractive.
Human vs Computer × Level 2The same alternating interaction occurs with more drivers and heavier congestion.How population size amplifies inefficient route switching.
Human vs Computer × Level 3You and the computer may also choose the shortcut.Whether the new option lowers personal cost but raises system cost.
Human controls all × Level 1You construct the full eight-driver allocation.Compare a selfish-looking distribution with the displayed optimum.
Human controls all × Level 2You control all fourteen assignments.Search manually for low-cost allocations and test equilibrium intuition.
Human controls all × Level 3You decide how much traffic uses all three routes.Test allocations with and without heavy shortcut use.
Computer simulation × Level 1The computer fills the simple network using current-cost best responses.The baseline selfish outcome and its Price of Anarchy.
Computer simulation × Level 2The computer repeats best responses for a larger population.How congestion compounds as more agents enter.
Computer simulation × Level 3The computer automatically considers the shortcut at every step.How an added route may fail to improve collective efficiency.

Suggested learning path

  1. Start with Human controls all drivers × Level 1 and try to minimize total cost.
  2. Press Show social optimum and compare your allocation with the optimum.
  3. Switch to Computer simulation × Level 2 to observe repeated best responses.
  4. Finish with Human vs Computer × Level 3 and investigate whether the shortcut helps individuals, society, both, or neither.

Interpretation note: This simulator uses simplified cost functions to teach the concepts. It demonstrates the mechanism behind congestion games and Braess-like effects rather than reproducing a specific real road network.