|
From: | Tamas Nepusz |
Subject: | Re: [igraph] igraph_get_eid strange behaviour |
Date: | Sat, 22 Mar 2008 18:14:36 +0100 |
Hi,
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.igraph_get_edgelist(&community_graph, &community_edges, 0); <iterate over community_edges> { ... igraph_get_eid(&community_graph, &eid, i, i+1, false);
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
[Prev in Thread] | Current Thread | [Next in Thread] |