igraph-help
[Top][All Lists]

## Re: [igraph] problems with parameters in barabasi.game()

 From: Csardi Gabor Subject: Re: [igraph] problems with parameters in barabasi.game() Date: Tue, 9 Sep 2008 11:36:31 +0200 User-agent: Mutt/1.5.9i

```Hi Mario,

1) You probably don't want to use out.pref=TRUE, because that means
that k(i) is total degree and I think in the papers it was in-degree.
2) You cannot really do P[i] ~ k(i) if k(i) is in-degree, because then
the zero degree vertices have to chance to gain incoming edges.
3) You can ignore the warning, I just forgot to remove it, the code
itself uses the supplied 'zero.appeal' value.

Keeping these in mind, the results look a bit better to me:
(I removed the warning lines for readability.)

> g <- barabasi.game(100000, out.pref=FALSE, power=1, zero.appeal=1, m=4)
> power.law.fit(degree(g, mode="in"), xmin=15)
Coefficients:
alpha
2.191552
> g <- barabasi.game(100000, out.pref=FALSE, power=1, zero.appeal=2, m=4)
> power.law.fit(degree(g, mode="in"), xmin=15)
Coefficients:
alpha
2.357224
> g <- barabasi.game(100000, out.pref=FALSE, power=1, zero.appeal=2, m=3)
> power.law.fit(degree(g, mode="in"), xmin=15)
Coefficients:
alpha
2.479433

It is still not the formula in the Dorogovtsev paper, though. I don't
know why, maybe they don't consider multiple edges, or the results are
only valid in some limit.

One problem with the current generator is that is created multiple
edges, and the degree distribution of the graph might change if you remove
these.

If you just want to have graphs with various power law degree distributions,
you might consider using 'degree.sequence.game', with method="vl", here
you can prescribe the exact degree distribution. It always generated
connected graphs, but probably this is not a problem.

Best,
Gabor

On Mon, Sep 08, 2008 at 05:05:35PM +0200, Mario Lavezzi wrote:
> Hello
>
> I am trying to generate Scale-free graphs with barabasi.game()
>
> What I want is an undirected graph for n agents, with neither loops, nor
> multiple edges.
>
> I would like to generate different power-law distributions with
> different exponents (ALPHA) by manipulating the "a" coefficient in the
> formula (taken from the igraph documentation, page 18):
>
> P[i] ~ k(i)^alpha + a
>
> Since an exponent alpha different from 1 does not generate power laws, I
> keep it fixed at 1, so I work with:
>
> P[i] ~ k(i) + a
>
> _Example
> _
> What I write:
> >networkScFr =
> barabasi.game(100000,directed=FALSE,out.pref=TRUE,power=1,zero.appeal=1,m=4)
> >networkScFrS = simplify(networkScFr, remove.multiple = TRUE,
> remove.loops = TRUE)
> >power.law.fit(degScFr,xmin=10)
>
> _What I get:_
> power.law.fit(degScFr,xmin=10)
>
> Call:
> mle(minuslogl = mlogl, start = list(alpha = start))
>
> Coefficients:
>   alpha
> 2.970474
>
>
> *_Question 1:
> _*With zero.appeal = 1, I am considering
>
> P[i] ~ k(i) + 1
>
> which is not exactly the original BA model, which studied P[i] ~ k(i).
> This is the extension proposed in http://arxiv.org/abs/cond-mat/0009090.
> According to Dorogovstev et al, the power-law exponent should equal 2 +
> a/m, where m is the number of links added at each time step.
> So, I should get ALPHA approx equal to 2.2, while I get ALPHA=2.97.
> Am I correct? If not, where I am wrong?
>
> *_Question 2:
> _*I want to try with:
>
> P[i] ~ k_i + 2
>
> _What I write:_
> > networkScFr =
> barabasi.game(n,directed=FALSE,out.pref=TRUE,power=1,zero.appeal=2,m=4)
>
> _What I get:_
>
> Warning message:
> In barabasi.game(n, directed = FALSE, out.pref = TRUE, power = 1,  :
>  `zero.appeal' is set to 1 for traditional BA game
>
> Does this mean that the zero.appeal value is fixed at 1? How can I
> change it?
>
> If I try to compute the exponent, I get:
>
> >power.law.fit(degScFr,xmin=10)
>
> Call:
> mle(minuslogl = mlogl, start = list(alpha = start))
>
> Coefficients:
>   alpha
> 3.042824
>
> That is, I obtain ALPHA=3.04, while I expected ALPHA= 2+2/4 = 2.5.
>
> Can anyone help?
>
> Thanks!
> Mario
>
> --
> Andrea Mario Lavezzi
> Dipartimento di Studi su Politica, Diritto e Società
> Università di Palermo
> Piazza Bologni 8
> 90134 Palermo, Italy
> tel. ++39 091 6625600
> fax ++39 091 6112023
> skype: lavezzimario
> email: lavezzi (at) unipa.it
> web: http://www.unipa.it/~lavezzi
>
>
>
> _______________________________________________
> igraph-help mailing list