igraph-help
[Top][All Lists]
Advanced

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

[igraph] Correlation based on the attributes of vertices


From: S.M. Ali Abbas
Subject: [igraph] Correlation based on the attributes of vertices
Date: Mon, 3 Oct 2011 18:34:01 +0100

Hi,
I have a directed graph which has some vertices attributes (like dorm, year etc). Edges and the graph itself do not have any attributes. Based on the attributes of the vertices, I'd like to calculate correlation among the edges (e.g. how likely people of the same dorm are connected?) for the whole graph. Also, I'd like to calculate inter-attributes correlation for the whole graph (how correlated dorm and year attributes are?)
Could you kindly tell how to go about it?
I thought of populating a list just like the graph edge list, and then replacing each source and destination by its attribute value. For instance, instead of the edge (0->1), I will replace it by (dorm_valueOf(0) -> dorm_valueOf(1)) and then run the function cor over it. It does not seem like a nice solution.
On a side note, how does one get source and destination out of an edge list by the Edge Iterator? For example, I'd like to know the source and the target vertices' index of the first edge, E(graph)[0]. How can I extract this information?

Thanks!

Cheers,
Ali



reply via email to

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