vertex average problem
Hello all, Somehow I am getting only a half of the actual value when I try to calculate the average clustering of the graph. For example, consider the following: G = gt.Graph(directed = False) G.add_edge_list([(0, 1), (0, 2), (1, 2)]) clust = gt.local_clustering(G) C_ave = gt.vertex_average(G, clust) print(C_ave) Since the graph is simply an undirected triangle, we should get C_ave = 1. However, I get C_ave = 0.5. Am I missing something obvious? Thank you Snehal -- Snehal Madhukar Shekatkar Pune India
On 08.10.2016 11:44, Snehal Shekatkar wrote:
Hello all,
Somehow I am getting only a half of the actual value when I try to calculate the average clustering of the graph. For example, consider the following:
G = gt.Graph(directed = False) G.add_edge_list([(0, 1), (0, 2), (1, 2)])
clust = gt.local_clustering(G) C_ave = gt.vertex_average(G, clust) print(C_ave)
Since the graph is simply an undirected triangle, we should getC_ave = 1.However, I get C_ave = 0.5. Am I missing something obvious?
If I run the above code I get: (1.0, 0.0) -- Tiago de Paula Peixoto <tiago@skewed.de>
Thanks Tiago for a quick reply, I found a bug in the way I was doing it for my big graph. Now I am getting the correct value. Sorry for this. Regards Snehal On Sat, Oct 8, 2016 at 4:20 PM, Tiago de Paula Peixoto <tiago@skewed.de> wrote:
On 08.10.2016 11:44, Snehal Shekatkar wrote:
Hello all,
Somehow I am getting only a half of the actual value when I try to calculate the average clustering of the graph. For example, consider the following:
G = gt.Graph(directed = False) G.add_edge_list([(0, 1), (0, 2), (1, 2)])
clust = gt.local_clustering(G) C_ave = gt.vertex_average(G, clust) print(C_ave)
Since the graph is simply an undirected triangle, we should getC_ave = 1.However, I get C_ave = 0.5. Am I missing something obvious?
If I run the above code I get: (1.0, 0.0)
-- Tiago de Paula Peixoto <tiago@skewed.de>
_______________________________________________ graph-tool mailing list graph-tool@skewed.de https://lists.skewed.de/mailman/listinfo/graph-tool
-- Snehal Madhukar Shekatkar Pune India
participants (2)
-
Snehal Shekatkar -
Tiago de Paula Peixoto