[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [igraph] how to access edge weight in C
From: |
Tamas Nepusz |
Subject: |
Re: [igraph] how to access edge weight in C |
Date: |
Thu, 17 Jun 2010 21:53:34 +0100 |
Hi,
> The *.ncol has three columns, the first two are the edge list, the last one
> is the edge weight. After reading the graph, I want to access the weight of
> each edge.
> Do Igraph provides an function to access the edge weight in C? I searched the
> manual of C, and did not find one.
You have to read the part of the documentation that is concerned with attribute
handling:
http://igraph.sourceforge.net/doc/html/igraph-Attributes.html
Edge weights are assigned to a numeric edge attribute named "weight". In order
to use attributes from C, you first have to turn on the C attribute handler
before doing anything with igraph:
igraph_i_set_attribute_table(&igraph_cattribute_table);
After that, you can query numeric edge attributes using igraph_cattribute_EAN
or igraph_cattribute_EANV (or their macro form: EAN and EANV). Read these pages
as a start:
http://igraph.sourceforge.net/doc/html/ch09s02s01.html#igraph_cattribute_EAN
http://igraph.sourceforge.net/doc/html/ch09s02s01.html#igraph_cattribute_EANV
--
Tamas