ash_model.measures.average_s_local_clustering_coefficient¶
- ash_model.measures.average_s_local_clustering_coefficient(h, s, start=None, end=None)[source]¶
Compute the average local clustering coefficient across all hyperedges in the s-overlap line graph.
- Parameters:
- Returns:
average local clustering coefficient in [0,1], or 0 if no nodes
- Return type:
Examples
>>> import numpy as np, networkx as nx >>> from ash_model.utils.networkx import from_networkx_maximal_cliques_list >>> Gs = [nx.barabasi_albert_graph(100, 3, seed=i) for i in range(10)] >>> rng = np.random.default_rng(42) >>> for G in Gs: ... for n in G.nodes(): ... G.nodes[n]['color'] = 'red' if rng.integers(0, 2) == 0 else 'blue' >>> h = from_networkx_maximal_cliques_list(Gs) >>> round(average_s_local_clustering_coefficient(h, 1, start=0, end=0), 12) 0.581891366366