igraph-help
[Top][All Lists]
Advanced

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

Re: [igraph] How to get weight after loading ncol file


From: Tamas Nepusz
Subject: Re: [igraph] How to get weight after loading ncol file
Date: Sun, 15 Mar 2009 12:53:36 +0000

I am loading a weighted graph from an ncol file. I want to access the weights for usage in the walktrap function. Do i have to use iterators and fill a vector with the values or is there something more straight forward I can do.
Take a look at the igraph_cattribute_table structure that you use to initialize the C attribute handler interface. There's a member called get_numeric_edge_attr with the following signature:

int (*get_numeric_edge_attr)(const igraph_t *graph, const char *name, igraph_es_t es, igraph_vector_t *value); This can be used to retrieve a given attribute of multiple edges at the same time to an igraph vector as follows (untested):

igraph_cattribute_table.get_numeric_edge_attr(your_graph, "weight", igraph_ess_all(), your_vector);

--
T.





reply via email to

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