igraph - Removal of N Random nodes from the graph in R -


i new r/igraph. remove n nodes randomly graph. however, not find right way that. have generated erdos-renyi graph of igraph package 400 vertices.

igraph provides deletion of vertices, not in random way. example: delete.vertices(graph, v).

i referred this documentation.

i searched web , previous questions on stack overflow, not right answer.

can please tell or refer me documentation on how remove n (lets n = 100) random nodes?

basically need generate vector of random numbers ranging 1 400:

random.deletes <- runif(n=100, min=1, max=400) 

and apply it:

my.new.graph <- delete.vertices(graph, random.deletes) 

of course, both can done @ once you'd lose track of deleted nodes:

my.new.graph <- delete.vertices(graph, runif(n=100, min=1, max=400)) 

Comments

Popular posts from this blog

node.js - How to mock a third-party api calls in the backend -

node.js - Why do I get "SOCKS connection failed. Connection not allowed by ruleset" for some .onion sites? -

matlab - 0-by-1 sym - What do I need to change in order to get proper symbolic results? -