igraph-help
[Top][All Lists]
Advanced

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

Re: [igraph] igraph_get_eid strange behaviour


From: Tamas Nepusz
Subject: Re: [igraph] igraph_get_eid strange behaviour
Date: Sat, 22 Mar 2008 18:14:36 +0100

Hi,

    igraph_get_edgelist(&community_graph, &community_edges, 0);
    <iterate over community_edges>
    { ...
        igraph_get_eid(&community_graph, &eid, i, i+1, false);
I think you should invoke igraph_get_eid with VECTOR(community_edges) [i] and VECTOR(community_edges)[i+1] instead of simply i and i+1. Otherwise you request for the edge going between vertex i and i+1.

Note that a simpler way to iterate over all the edges of a graph is:

igraph_eit_t iterator;
igraph_eit_create(&g, igraph_ess_all(), &iterator);
for (; !IGRAPH_EIT_END(iterator); IGRAPH_EIT_NEXT(iterator)) {
  igraph_integer_t edge_id = IGRAPH_EIT_GET(iterator);
  /* Do whatever you want with the edge ID here */
}
igraph_eit_destroy(&iterator);

--
Tamas





reply via email to

[Prev in Thread] Current Thread [Next in Thread]