[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[igraph] contract.vertices() generates error "s tructure_generators.c:84
From: |
capitano . nemo |
Subject: |
[igraph] contract.vertices() generates error "s tructure_generators.c:84 : Invalid (negative) verte x id, Invalid vertex id" |
Date: |
Wed, 20 Nov 2013 11:56:33 +0000 |
User-agent: |
autistici.org webmail |
Hello list,
I already got the same error with bipartite.projection(). At that step I
was able to solve the problem by
1) eliminating few negative ids and
2) eliminating few edges between same type nodes (the graph was then
actually not truly bipartite).
After correcting the bipartite graph I executed with no errors
> igraph_onemode <- bipartite.projection(igraph_bi)
> igraph_onemode
IGRAPH UNWB 75439 50375688 --
attr: ...
> igraph_onemode_threads <- igraph_onemode$proj2
> category_attr <- get.vertex.attribute(igraph_onemode_threads,
"category")
> # Map categories to integers, empty attribute is mapped to 4
> map = setNames(c(1:4), c("category1",
"category2",
"category3",
""))
And finally
> igraph_category <- contract.vertices(igraph_onemode_threads,
category_attr)
Error in contract.vertices(igraph_onemode_threads, category_attr) :
At structure_generators.c:84 : Invalid (negative) vertex id,
Invalid vertex id
But this error is quite unexpected since the vertex id went through
bipartite.projection() which also check for negative values. Can still
be a problem with edges between the nodes of the same type?
I am more than happy to share data and code (only the
'igraph_onemode_threads' is 460MB) if can be help.
PS: BTW, how come the graph returned from the one-mode projection is
bipartite?
- [igraph] contract.vertices() generates error "s tructure_generators.c:84 : Invalid (negative) verte x id, Invalid vertex id",
capitano . nemo <=