0

I have a problem with "rewire" function in igraph.

I randomise my graphs using keeping_degseq but the randomised graphs became very "broken". Especially if I followed niter = vcount(g) * 10. The graphs can be broken into ~1000 disconnected subnetworks.

May I know if there is a way to randomise graphs without breaking? What is best "niter" for "keeping_degseq" to keep the graph intact/connected?

Obviously when "niter" = a small number it will not break so much but it will mean under randomised?

main = read.table("main.txt")
g = graph_from_data_frame(main, directed=FALSE)
no.clusters(g)

[1] 1

g_r = rewire(g, with=keeping_degseq(niter = vcount(g)*10))
no.clusters(g_r)

[1] 1305

I expect to generate an intact rewired graph from my own graph using "rewire" but it is broken into a lot of disconnected subnetworks.

Newl
  • 310
  • 2
  • 12
  • We need some data so that we can reproduce your problem: https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example. using a random graph with varying levels of sparsity I cannot recreate your problem. – emilliman5 Jun 05 '19 at 18:21
  • https://igraph.org/r/doc/sample_degseq.html – Nick Jun 28 '19 at 01:39

0 Answers0