[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [igraph] Question about fastgreedy.community
From: |
Tamás Nepusz |
Subject: |
Re: [igraph] Question about fastgreedy.community |
Date: |
Sat, 5 May 2012 22:42:35 +0200 |
> At gengraph_mr-connected.cpp:146 : Cannot make a connected graph from
> the given degree sequence, Invalid value
>
> Do you have any method to fix it?
You are trying to generate a graph from a degree sequence for which there
exists no connected simple graph that satisfies the degree sequence. In other
words, if you see this message, just generate a new degree sequence.
By looking at your code, I think that a possible way for this to happen is if
deg[1] is equal to N-1 and the sum of degrees is odd. In this case, you add 1
to deg[1], making it equal to N, and it is of course impossible to generate a
simple graph on N vertices where a vertex has degree N. Of course there are
many other possible ways to fail. The Erdos-Gallai theorem describes the
necessary and sufficient condition for the degree sequence you are generating:
http://en.wikipedia.org/wiki/Erd%C5%91s%E2%80%93Gallai_theorem
When running degree.sequence.game, the VL algorithm first checks whether your
degree sequence satisfies the conditions of the Erdos-Gallai theorem, and
returns the error message you see if it does not.
--
T.