snap-stanford / snap

Stanford Network Analysis Platform (SNAP) is a general purpose network analysis and graph mining library.
Other
2.17k stars 797 forks source link

Node Iterator Misbehavior #100

Open acartamersoy opened 7 years ago

acartamersoy commented 7 years ago

I am using the C++ version of SNAP. I have an undirected graph with 174093228 nodes and 309401867 edges. The maximum node id in the graph is 174093228. The node iterator is behaving strangely when I input it nodes ids that do not exist in the graph. Please see the commands and the outputs below.

printf("%d\n", Graph->IsNode(500000000)); //output: 0 TUNGraph::TNodeI NI = Graph->GetNI(500000000); printf("%d\n", NI.GetOutDeg()); //output: 1 printf("%d\n", NI.GetOutNId(0)); //output: 111788745 printf("%d\n", Graph->IsNode(NI.GetOutNId(0))); //output: 1 printf("%d\n", Graph->IsEdge(500000000, NI.GetOutNId(0))); //output: 0