John Burrett
John Burrett

Reputation: 11

igraph - generating random graph communities estimate as per Kolaczyk and Csardi

I am having a problem getting igraph to generate a network statistic (in this case, number of communities) from the degree distribution of my actual network (in order to assess the significance of the calculated number of communities in the network). I am following page 80 of Kolaczyk and Csardi, but it does not work.

See code below. The error message that I get is: "Error in match.arg(arg=arg, choices=choices, several.ok=several.ok) : 'arg' should be one of "simple", "v1", simple.no.multiple".

The book says use "v1", but I get the error message. Using simple.no.multiple seemed to work, but I don't know if it's correct, as it only gave me a frequency for one community size.

I posted this question before, and it was deleted. I have tried to find the answer on this site but no luck- there were related things, but not that close. Code:

>degs<-degree(Jan18BSEGendered)
> num.comm.grg<-numeric(ntrials)
>#note, I had generated "degs" and "ntrials" earlier, as per the book
>for(i in (1:ntrials)){
+g.grg<-degree.sequence.game(degs, method="v1")
+c.grg<-fastgreedy.community(g.grg)
+num.comm.grg(i)<-length(c.grg)}

I'd really appreciate some help, please. John

Upvotes: 0

Views: 64

Answers (1)

Ryan Haunfelder
Ryan Haunfelder

Reputation: 786

Luckily this is a really easy solution. Your code has method="v1" when it should be method="vl". Unfortunately "1" and "l" look very similar in courrier new. vl stands for Viger and Latapy, who introduced a method for generating simple random graphs with heavy tail distributions. Hope this helps!

Upvotes: 2

Related Questions