igraph-help
[Top][All Lists]
Advanced

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

Re: [igraph] At structure_generators.c:84 : Invalid (negative) vertex id


From: Stephan Schlögl
Subject: Re: [igraph] At structure_generators.c:84 : Invalid (negative) vertex id, Invalid vertex id
Date: Tue, 26 Nov 2013 16:24:55 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.1.0

Hi Federik,
Thank you very much for your help. The error message was a bit missleading. I didn't even think of this problem. But you where right my graph wasn't really bipartite I had an error in my script. Here is a bit faster snippet to identify the problematic edges:

e <- get.data.frame(g,what="edges")
v <- get.data.frame(g,what="vertices")
e$from_type <- v$type[match(e$[,1],v$name)]
e$to_type <- v$type[match(e[,2],v$name)]
e[e$from_type==e$to_type,]

by the way: In this case the projections result in a graph with v=54183 e=266112529 and one which is v=135 e=8044. I'am just interested in the second projection which is much smaller. Is there a way to just compute the second one and would this save computational ressources?

Best,
stephan




Am 2013-11-25 18:00, schrieb Frederik Elwert:
Hello Stephan,

there were some issues like this on the list: It seems like the error
message is a red herring, and the actual problem is with the
bipartiteness of your graph. I suggested a simple test, and it shows
some issues:

for (v in V(G)) {
+     vtype <- V(G)[v]$type
+     for (n in neighbors(G, v)) {
+         if (V(G)[n]$type == vtype) {
+             print(paste('Problem with', V(G)[v]$name, 'and',
V(G)[n]$name))
+         }
+     }
+ }
[1] "Problem with 1276601 and 444969570"
[1] "Problem with 1417761 and 444969570"
[1] "Problem with 1600201 and 444969570"
[1] "Problem with 1612811 and 444969570"
[1] "Problem with 1999731 and 444969570"
[1] "Problem with 6467932 and 444969570"
[1] "Problem with 8179472 and 444969570"
[1] "Problem with 8507372 and 444969570"
[1] "Problem with 8560922 and 444969570"
...

So maybe you should double-check your graph is bipartite according to
your "type" attribute. (As I learned here, is.bipartite(g) only checks
if the graph is bipartite according to *any* mapping.) Checking the type
of node 444969570 might be a good start. (I couldn’t test a fixed
mapping, as my machine runs out of memory with bipartite.projection on
your graph.)

Regards
Frederik



Am 25.11.2013 17:45, schrieb Stephan Schlögl:
Hi,
I'm using igraph in R. I'm trying to compute:

/graph <-bipartite.projection(g)/

but I get the following error:

/At structure_generators.c:84 : Invalid (negative) vertex id, Invalid
vertex id/

this seems strange to me because I'm not using negative vertex ids.

/> min(V(g)$name)//
//[1] "100000090"/
/#(not sure if this is the correct way to prove this, since $name seems
to be a string)/

I suppose the only way to make this reproducible is by providing the
graph object <http://homepage.univie.ac.at/stephan.schloegl/net.RData>

I would gratefull for any help!
Best,
stephan


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

_______________________________________________
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]