attack - Simulate attack behaviors to the network model
Simulate attack behaviors to the network model. g is the initial model, t is the attack time, flag is the scale factor which represents different attack strategies. flag=0: attack one node randomly flag=1: attack one link randomly flag=2: attack one node with the maximum degree in every time step.
[a b]=ba(6,4,9994); g=make_graph('ba',0,10000,a,b); t=tran(g('head'),g('tail'),g('node_number')); disp(eff(t)); g=attack(g,10,2); t=tran(g('head'),g('tail'),g('node_number')); disp(eff(t));
eff ,