igraph-help
[Top][All Lists]
Advanced

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

Re: [igraph] How to identify negative vertices in graph


From: Gábor Csárdi
Subject: Re: [igraph] How to identify negative vertices in graph
Date: Wed, 13 Nov 2013 22:10:12 -0500

Internal igraph vertex ids start from 0 in C, and from 1 in R, and
they are never negative. The not very helpful error message is coming
from the igraph C library and is a consequence of some other error,
probably in the R package, or maybe a bug in igraph.

Your data is not very big, actually, so if you save it with save() and
send it to me with the complete code that you used, I can probably
help you. Assuming you are allowed to share the data.

Gabor

On Wed, Nov 13, 2013 at 9:59 PM,  <address@hidden> wrote:
> I have a problem with the function bipartite.projection() which returns
>
> Error in bipartite.projection(igraph_bi) :
>   At structure_generators.c:84 : Invalid (negative) vertex id, Invalid
> vertex id
>
> when trying to project my bipartite graph.
>
> Unfortunately my graph is very large (IGRAPH DN-B 154626 448387 -- ) so I
> can't easily reproduce the error in a minimum working example to share.
>
> What I tried to do was to have a look at the dataframes that I used to
> create the graph object in the first place with
>
> graph.data.frame(edges, directed=TRUE, vertices=nodes)
>
> I checked the "id" column of my "nodes" df along with the "from" column of
> my "edges" df for negative values. (By the way, both "id" and "from" columns
> are character vectors, not numeric). Indeed I found 25 "negative" strings in
> my "id" column of the "nodes" df--it depends on the first character,
> non-alphanumerics make for a negative value of the string. But still after
> removing all the negative strings, and after double-checking again both "id"
> and "from" columns, I keep getting the same error from
> bipartite.projection()
>
> Error in bipartite.projection(igraph_bi) :
>   At structure_generators.c:84 : Invalid (negative) vertex id, Invalid
> vertex id
>
> Now my problem is to understand how to find where the negative values that
> trigger the error are hidden.
>
> Is the value of the column "id" used as id of the node without any
> transformation (and same for the column "from" for edges) by the function
> graph.data.frame?
>
> How can I get the id values out of the graph object to check for negative
> values?
>
> _______________________________________________
> 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]