attacking largest connected component (lcc) by degree

I am trying to implement a function to remove some fraction of high degree
nodes based on initial lcc (1% in every step) until the lcc will be
destructed completely (size zero). to test my code I am using DBLP coauthor
ship network which is already shown that the lcc of the this graph will be
destructed after removing 1.5% of high degree nodes. However my code fail
to that,.
one thing that I am not sure is that when we mask some nodes and then use
GraphView(G,vfilt=mask), it does not take of isolated vertices after
masking. So I had to check for them manually. thanks for any hint!

code is attached.

attachment.html (818 Bytes) (2.91 KB)

I did not review your code in detail; you should try to provide a
minimal example of the problem, together with the expected and obtained

But it seems to me that you are simply building the vertex mask
incorrectly. Note that when you do mask.a, it returns an array pointing
to all vertices, even those that are currently being masked. If you want
to obtain an array only for the unmasked nodes, you should use mask.fa.