Imagine you and your best friend get caught doing something wrong. You're both taken to separate rooms and can't talk to each other. The police offer you both a deal:
We say that the Cooperation Reward \(R\) is 2 (since the player get a 2 years discount on the worst penalty, which is 3), the Punishment payoff \(P\) is 1, the Temptation payoff \(T\) is 3, and finally the Sucker's payoff \(S\) is 0.
This situation is tricky because if you stay quiet, you hope your friend does too, so you both get only 1 year. But if you think your friend will tell on you, you might want to tell on him first, so you don't get 5 years while they go free. And you know that your friend is thinking the same way in his room.
Consequently, if the two prisoners think rationnally, they will both betray. In game theory, this is called a Nash Equilibirum: no player could gain by changing his own strategy.
This reasoning leads us to believe that no one should cooperate. But if this is true when there are only two players, is it also true when we consider an entire community where everyone repeatedly plays against their neighbors?
We represent this community as a graph, where each node is a player. Each of them is a defector, colored in red, or a collaborator, colored in green.
The following applet allows you to observe how the two strategies spead among the player. You can set the value of the four different rewards, the probability of a player being a defector at the begining, the number of players, as well as the graph geeneration process (Scale-free or Random, see below).
A random graph (Erdős-Rényi) is built by randomly connecting pairs of nodes with a fixed probability, so each connection
is equally likely, resulting in a graph where most nodes have a similar number of connections (degree).
In contrast, a scale-free graph (Barabási-Albert) grows by adding new nodes that preferentially connect to existing nodes with more
connections, following a "rich-get-richer" principle. This process creates a graph where a few nodes, called hubs, have
many connections, while most nodes have only a few.
The key difference is that random graphs have a more uniform
distribution of connections, while scale-free graphs have a few highly connected hubs and many less connected nodes.