Network Robustness — Targeted vs Random Attack

A Barabási-Albert scale-free network is robust against random failures but fragile under targeted attacks on hubs. Watch the giant connected component collapse as nodes are removed by degree (targeted) versus uniformly at random. Compares with an Erdős-Rényi network.

Build a network and run comparison