igraph-help
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [igraph] Generate bipartite graph with specified degree distribution


From: Caio Santos
Subject: Re: [igraph] Generate bipartite graph with specified degree distribution [Again]
Date: Mon, 20 May 2013 11:15:24 -0300

Hi Garbor, 

thanks for the fast answer. 
You were right, the edgelist have confirmed that is a bipartite graph. (I was confused by the plot function). 

But I haven't resolved the problem yet because is required that the sum out-degree and in-degree be the same even number.
Please, take a look at my example:

users = 1000
items = 500

usersDegs = sample(1:items, size=items, replace=TRUE, prob=(1:items)^-2)
itemsDegs = sample(1:users, size=users, replace=TRUE, prob=(1:users)^-2)
g <- degree.sequence.game(out.deg = c(usersDegs, rep(0, items)), in.deg = c(rep(0, users), itemsDegs))

It's very unlikely have that required sum using sample from a specified distribuition.

Is there a way to use degree.sequence.game with sampling from a distribution?
Is there another function to achieve this?

thank you so much,
Caio


2013/5/18 Gábor Csárdi <address@hidden>
Hi,

On Fri, May 17, 2013 at 7:40 PM, Caio Santos <address@hidden> wrote:
Hi, 

I saw a discussion about this, but i couldn't make it work.
Sugestion:
"In out_deg, the first n1 values should be the
degrees of the vertices in the first bucket, the next n2 values will
be zero. In in_deg, the first n1 values will be zero, the next n2
values will be the degrees of the vertices in the second bucket."

I tried this in R:
g <- degree.sequence.game(out.deg = c(3, 2, 0, 0, 0, 0), in.deg = c(0, 0, 1, 1, 2, 1))

but the result is not a bipartite graph.

Why not? All the edges go between {1,2} and {3,4,5,6}, right? So this is a bipartite graph. 

If you mean that the graph has no 'type' argument, yes, you need to add that yourself, degree.sequence.game() does not know that it is generating a bipartite graph. You also might want to convert the graph to undirected.

Gabor
 
What am I doing wrong?

Best, 
Caio



_______________________________________________
igraph-help mailing list
address@hidden
https://lists.nongnu.org/mailman/listinfo/igraph-help




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

_______________________________________________
igraph-help mailing list
address@hidden
https://lists.nongnu.org/mailman/listinfo/igraph-help



reply via email to

[Prev in Thread] Current Thread [Next in Thread]