Congestion game (source code)

= Congestion game

Players select sets of resources, and each resource's cost depends on its total number of users. Each player's cost is the sum of the costs of their selected resources. A unilateral deviation changes resource loads, so a finite-player <Nash equilibrium> compares costs after that change, not at the old loads. For cost functions $c_e$, the potential $\sum_e\sum_{j=1}^{n_e}c_e(j)$ changes by exactly the deviator's cost change. A minimizer of this potential in a <finite game> is therefore a pure <Nash equilibrium>.