igraph-help
[Top][All Lists]

## Re: [igraph] Scale-free random networks with different exponents and sam

 From: Gábor Csárdi Subject: Re: [igraph] Scale-free random networks with different exponents and same average degree Date: Sun, 11 Dec 2011 10:00:11 -0500

```Well, this is not really what I suggested. If you know the exponent
that you want, then create the degree sequence of the graph directly,
via the sample() R function. Then you can call degree.sequence.game()
to create the actual graph.
There are some examples in the manual page of degree.sequence.game().

E.g.:

degs <- sample(1:100, 100, replace=TRUE, prob=(1:100)^-2)
if (sum(degs) %% 2 != 0) { degs[1] <- degs[1] + 1 }
g5 <- degree.sequence.game(degs, method="vl")

First you'll need to decide the exact form of the degree distribution
that you want, and then make some calculations to adjust the
probabilities for the different degrees (i.e. 'prob' above)
accordingly.

Best,
G.

On Sun, Dec 11, 2011 at 8:47 AM, Eusebio Vargas <address@hidden> wrote:
> Hi Gabor,
>
>
> I was trying to find some information that might help me with igraph
> (because I don't know R language and I haven't used igraph before),
> and in
> http://igraph.sourceforge.net/igraphbook/igraphbook-random.html#id2533766
> I found the following:
>
> The original Barabási-Albert model uses linear preferential
> attachment, ie. the connection probability is proportional to the
> degree of the vertices. Nonlinear variations can also be studied with
> igraph by supplying the power parameter:
>
>> g1 <- barabasi.game(10000, power=0.5)
>> g2 <- barabasi.game(10000, power=1)
>> g3 <- barabasi.game(10000, poert=1.5)
>> plot(degree.distribution(g3), xlab="degree",
>          ylab="frequency", log="xy", pch=3, col=3, type="b")
>> points(degree.distribution(g2), pch=2, col=2, type="b")
>> points(degree.distribution(g1), pch=1, col=1, type="b")
>> legend(max(degree(g3)), 1, xjust=1, yjust=1,
>          c(0.5,1,1.5), pch=1:3, col=1:3, lty=1)
>
>
> So I wonder if this might help me to generate the kind of random
> graphs I'm trying to construct.
>
> Best,
> Eusebio
>
>> Message: 6
>> Date: Fri, 09 Dec 2011 12:59:50 +0000
>> Subject: [igraph] Scale-free random networks with different exponents
>>       and same average degree
>> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
>>
>> Dear all,
>>
>> I'm trying to generate connected scale-free random graphs with different
>> exponents (-1, -1.5, -2, -2.5, -3) and the same average degree (<k>= 8
>> and 12)... is there any function in i-graph that can do the work? (or
>> may be modified to achieve the goal)...
>>
>> Thanks for any possible help or hint.
>>
>> Best,
>> Eusebio
>>
>>
>>
>> Message: 10
>> Date: Fri, 9 Dec 2011 10:35:20 -0500
>> To: Help for igraph users <address@hidden>
>> Subject: Re: [igraph] Scale-free random networks with different
>>       exponents and same average degree
>> Message-ID:
>> Content-Type: text/plain; charset=ISO-8859-1
>>
>> Hi,
>>
>> the simplest is probably if you generate your degree sequence the way
>> you want it (e.g. with sample() in R) and then call
>> degree.sequence.game() to create the graph itself.
>>
>> Best,
>> Gabor
>>
>> On Fri, Dec 9, 2011 at 7:59 AM, Eusebio Vargas <address@hidden> wrote:
>>> Dear all,
>>>
>>> I'm trying to generate connected scale-free random graphs with different
>>> exponents (-1, -1.5, -2, -2.5, -3) and the same average degree (<k>= 8 and
>>> 12)... is there any function in i-graph that can do the work? (or may be
>>> modified to achieve the goal)...
>>>
>>> Thanks for any possible help or hint.
>>>
>>> Best,
>>> Eusebio
>>>
>>> _______________________________________________
>>> igraph-help mailing list
>>> https://lists.nongnu.org/mailman/listinfo/igraph-help
>>
>>
>>
>> --
>> Gabor Csardi <address@hidden>? ?? MTA KFKI RMKI
>>
>>
>>
>> ------------------------------
>>
>> _______________________________________________
>> igraph-help mailing list
>> https://lists.nongnu.org/mailman/listinfo/igraph-help
>>
>>
>> End of igraph-help Digest, Vol 65, Issue 6
>> ******************************************
>>

--
Gabor Csardi <address@hidden>     MTA KFKI RMKI

```