I have a file that contains information about airports. how do i find the fraction of the giant component in a graph? the data looks like
1 43
1 52
43 1
53 146
and so on, it just has source-target , i.e from one airport to another.
Q. Randomly choose a fraction p 0.01 of the nodes and remove them from the network. Calculates the fraction of nodes belonging to the giant component (gee) of the attacked network. tried this
> listofnodes=A.nodes()
print('Number of nodes before reducing ' ,len(listofnodes))
numofnodes=A.number_of_nodes()
sample=int(numofnodes*0.1)
>output : Number of nodes before reducing 940
RandomSample = random.sample(listofnodes, sample)
G.remove_nodes_from(RandomSample)
print('Number of nodes before reducing ' ,len(G.nodes))
>Number of nodes before reducing 534
https://mathematica.stackexchange.com/questions/130525/how-can-i-remove-a-fraction-p-of-nodes-or-edges-from-a-graph-randomly tried to do something like this, the problem statement here is what i wish to accomplish ,how fraction survives the attack, but the function used there, gives an error saying theres no such function. sorry about earlier :)