stingergraph / stinger

The STINGER in-memory graph store and dynamic graph analysis platform. Millions to billions of vertices and edges at thousands to millions of updates per second.
http://www.stingergraph.com
Other
210 stars 67 forks source link

How to get the outdegree of a vertex? #200

Closed rohitvarkey closed 8 years ago

rohitvarkey commented 8 years ago

Hi,

I wanted to find the outdegree of a vertex in a stinger graph. Looking through the examples, I see that stinger_outdegree is used. But it seems to be deprecated and not to be used as it shows up in the stinger_deprecated.h file. The new function provided there is stinger_outdegree_get. The definition of stinger_outdegree_get is commented out.

Is there any other way I can obtain the outdegree of a vertex?

Thanks, Rohit

davidediger commented 8 years ago

stinger_outdegree_get(S, v) is the proper function. The first parameter, S, is the pointer to the graph data structure. The second parameter, v, is the logical vertex ID.

rohitvarkey commented 8 years ago

Ah. I see its defined in the header file itself. Sorry for the noise.

rohitvarkey commented 8 years ago

I was trying to access stinger_outdegree_get using a call to the libstinger_core library when it said the symbol could not be found. I tried a nm -m libstinger_core and saw that stinger_outdegree_get was a non-external symbol.

$ nm -m libstinger_core.dylib | grep stinger_outdegree_get
0000000000002a70 (__TEXT,__text) non-external _stinger_outdegree_get

Is the definition of stinger_outdegree_get as a static inline function the reason for it being a non-external symbol?

Is there any other function that would let me get the outdegree using the shared library?

ehein6 commented 8 years ago

You're right, looks like the definition was changed to inline a while back in https://github.com/stingergraph/stinger/commit/dcddcdae323dee9ac062363cb8061731e5067d1d and no one has tried to use it externally since then.

I added an extern defintion for you, check out https://github.com/ehein6/stinger/tree/stinger-outdegree-get-extern and let me know if that fixes the problem.

rohitvarkey commented 8 years ago

@ehein6 Thanks! But it didn't work. I've made a PR - #204 with a fix that worked for me.