[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [igraph] exponential graph
From: |
Csardi Gabor |
Subject: |
Re: [igraph] exponential graph |
Date: |
Thu, 11 Sep 2008 11:09:18 +0200 |
User-agent: |
Mutt/1.5.9i |
Ok, the problem is much simpler than I thought, the generator
simply does not check that the sum of the degrees is even.
This will be corrected in the next release. Until then a workaround is
to check and correct your degree sequence, e.g.
## Exponential degree distribution
## Note, that we correct the degree sequence if its sum is odd
degs <- sample(1:100, 100, replace=TRUE, prob=exp(-0.5*(1:100)))
if (sum(degs) %% 2 != 0) { degs[1] <- degs[1] + 1 }
g4 <- degree.sequence.game(degs, method="vl")
all(degree(g4) == degs)
## Power-law degree distribution
## Note, that we correct the degree sequence if its sum is odd
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")
all(degree(g5) == degs)
Note, that even if the sum of degrees is even, it is possible
that you cannot create a connected simple graph with the given
degree sequence.
Best,
Gabor
On Thu, Sep 11, 2008 at 09:37:35AM +0200, Csardi Gabor wrote:
> Yes, this is a bug, I'm working on it right now. Sorry about this.
>
> Gabor
>
> On Wed, Sep 10, 2008 at 11:22:32PM +0100, Amit Kumar wrote:
> > Hello Gabor,
> > I tried :-
> > degs <- sample(1:100, 100, replace=TRUE, prob=(1:100)^-2)
> > g <- degree.sequence.game(degs, method="vl")
> >
> > but every time the second line is executed RGui prompt an error and closes
> > the application.I am not able to figure out why this is happening.I am using
> > R in windows vista.Please help!
> >
> > regards
> > Amit
> >
> > On Wed, Sep 10, 2008 at 5:01 PM, Amit Kumar <address@hidden>wrote:
> >
> > > Hello Gabor,
> > > Sorry my fault. I will try to be more precise this time.
> > > I need to generate random graph having exponential degree distribution.
> > > Where no of nodes in the graph is 100 and probablity that an edge between
> > > two randomly picked vertices exists is 0.15.
> > >
> > > Amit
> > >
> > > On Wed, Sep 10, 2008 at 4:12 PM, Csardi Gabor <address@hidden> wrote:
> > >
> > >> Amit, I'm sorry, but you have to be a bit more precise.
> > >>
> > >> What is an exponential graph? A graph with exponential degree
> > >> distribution?
> > >>
> > >> The of probability of what exactly is 0.15? That an edge between two
> > >> randomly picked vertices exists?
> > >>
> > >> G.
> > >>
> > >> On Wed, Sep 10, 2008 at 03:44:47PM +0100, Amit Kumar wrote:
> > >> > Hello Gabor,
> > >> > I just want to generate an exponential graph with No of nodes=100 and
> > >> > probablity=0.15
> > >> >
> > >> > Amit
> > >> >
> > >> > On Wed, Sep 10, 2008 at 2:18 PM, Csardi Gabor <address@hidden>
> > >> wrote:
> > >> >
> > >> > > Amit, what is the preferential attachment=1.5?
> > >> > >
> > >> > > To generate connected undirected graphs with an arbitrary
> > >> > > degree distribution use degree.sequence.game with method="vl".
> > >> > >
> > >> > > E.g.
> > >> > >
> > >> > > degs <- sample(1:100, 100, replace=TRUE, prob=(1:100)^-2)
> > >> > > g <- degree.sequence.game(degs, method="vl")
> > >> > >
> > >> > > Gabor
> > >> > >
> > >> > > On Wed, Sep 10, 2008 at 01:47:43PM +0100, Amit Kumar wrote:
> > >> > > > Hello,
> > >> > > > Please guide me how to generate exponential degree distribution and
> > >> then
> > >> > > > generate a exponential graph from this exponential degree
> > >> distribution.
> > >> > > > Given that No of nodes=100 and preferential attachment=1.5.
> > >> > > >
> > >> > > > regards
> > >> > > > Amit
> > >> > >
> > >> > > > _______________________________________________
> > >> > > > igraph-help mailing list
> > >> > > > address@hidden
> > >> > > > http://lists.nongnu.org/mailman/listinfo/igraph-help
> > >> > >
> > >> > >
> > >> > > --
> > >> > > Csardi Gabor <address@hidden> MTA RMKI, ELTE TTK
> > >> > >
> > >> > >
> > >> > > _______________________________________________
> > >> > > igraph-help mailing list
> > >> > > address@hidden
> > >> > > http://lists.nongnu.org/mailman/listinfo/igraph-help
> > >> > >
> > >>
> > >> > _______________________________________________
> > >> > igraph-help mailing list
> > >> > address@hidden
> > >> > http://lists.nongnu.org/mailman/listinfo/igraph-help
> > >>
> > >>
> > >> --
> > >> Csardi Gabor <address@hidden> MTA RMKI, ELTE TTK
> > >>
> > >>
> > >> _______________________________________________
> > >> igraph-help mailing list
> > >> address@hidden
> > >> http://lists.nongnu.org/mailman/listinfo/igraph-help
> > >>
> > >
> > >
>
> > _______________________________________________
> > igraph-help mailing list
> > address@hidden
> > http://lists.nongnu.org/mailman/listinfo/igraph-help
>
>
> --
> Csardi Gabor <address@hidden> MTA RMKI, ELTE TTK
>
>
> _______________________________________________
> igraph-help mailing list
> address@hidden
> http://lists.nongnu.org/mailman/listinfo/igraph-help
--
Csardi Gabor <address@hidden> MTA RMKI, ELTE TTK
- [igraph] exponential graph, Amit Kumar, 2008/09/10
- Re: [igraph] exponential graph, Csardi Gabor, 2008/09/10
- Re: [igraph] exponential graph, Amit Kumar, 2008/09/10
- Re: [igraph] exponential graph, Csardi Gabor, 2008/09/10
- Re: [igraph] exponential graph, Amit Kumar, 2008/09/10
- Re: [igraph] exponential graph, Amit Kumar, 2008/09/10
- Re: [igraph] exponential graph, Csardi Gabor, 2008/09/11
- Re: [igraph] exponential graph,
Csardi Gabor <=
- Re: [igraph] exponential graph, Amit Kumar, 2008/09/11