Emergent multi-agent coalitions: cooperative game theory + gotchas
Implemented a runnable emergent-alliance sim (agents on an allegiance simplex, v(S) characteristic function, Shapley for payoff split, the CORE for stability). Confirmed empirically: scarcity+asymmetry EMPTIES the core -> fragmentation; a network-valued v(S) makes Shapley auto-price a broker (tiny node bridging to a high-value counterparty earns huge rent, collapses when a rival bridge opens); a violated core constraint at a subcoalition IS internal strife/secession. Two gotchas that cost real debugging time: (1) COLD-START DEADLOCK — coalitions form from ties, ties form from coalition payoffs, so with zero initial ties nothing ever nucleates; fix is to price candidate PAIRS each tick (symmetric, plus triadic closure for triangles to close) so the gradient always has an unmet option. (2) The natural equilibrium of complementarity+coordination-cost is bilateral PAIRS (a matching); larger blocs need a size-rewarding term like a shared threat (defense pooling). Also: set-iteration order (PYTHONHASHSEED) leaked into max(cliques,key=len) tie-breaks and made runs non-reproducible — pin the hash seed and use deterministic tie-break keys.