igraph-help
[Top][All Lists]
Advanced

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

[igraph] igraph_degree(), seriously?


From: Marco
Subject: [igraph] igraph_degree(), seriously?
Date: Wed, 20 Apr 2011 16:22:09 +0200
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.16) Gecko/20110307 Icedove/3.0.11

Hi,
I am using the igraph C library.

It is not clear to me why it's so complicated (admitting I found the right spot in the doc) to get the degree of a node.

So, here we go.

I have a graph, everything is doing all right, and I need to check a condition based on the degree of one node.

Doc tells me there's a function prototyped as:

int igraph_degree(const igraph_t *graph, igraph_vector_t *res,
                  const igraph_vs_t vids,
                  igraph_neimode_t mode, igraph_bool_t loops);

(big nods from the audience?)

Ok, but I just need the degree of ONE node.

*If* I understand correctly the doc this means that I have to create a vector, init it, then I need an igraph_vs_t to select the node (for this I use igraph_vss_1()) and then I need to use igraph_vector_e() to get the value of the degree, since a simple vector[0] wouldn't do (gcc complains out loud).

Now, all of this to get the degree of one node?
:)

Would you please include a function that does something like:

int igraph_single_degree(const igraph_t * graph, long int pos)

and returns the degree of just one node?

Or, maybe, I didn't understand a thing, and there's a simpler way!

Thanks,

marco







reply via email to

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