Title: | Cluster Evaluation on Graphs |
---|---|
Description: | Evaluates the stability and significance of clusters on 'igraph' graphs. Supports weighted and unweighted graphs. Implements the cluster evaluation methods defined by Arratia A, Renedo M (2021) <doi:10.7717/peerj-cs.600>. Also includes an implementation of the Reduced Mutual Information introduced by Newman et al. (2020) <doi:10.1103/PhysRevE.101.042304>. |
Authors: | Martí Renedo Mirambell |
Maintainer: | Martí Renedo Mirambell <[email protected]> |
License: | GPL (>= 3) |
Version: | 0.5.5 |
Built: | 2025-02-12 05:42:26 UTC |
Source: | https://github.com/martirm/clustanalytics |
Average degree (weighted degree, if the graph is weighted) of a graph's communities.
average_degree(g, com)
average_degree(g, com)
g |
Graph to be analyzed (as an |
com |
community membership integer vector. Each element corresponds to a vertex. |
Numeric vector with the average degree of each community.
Other cluster scoring functions:
FOMD()
,
average_odf()
,
conductance()
,
coverage()
,
cut_ratio()
,
density_ratio()
,
edges_inside()
,
expansion()
,
internal_density()
,
max_odf()
,
normalized_cut()
,
scoring_functions()
,
weighted_clustering_coefficient()
,
weighted_transitivity()
data(karate, package="igraphdata") average_degree(karate, membership(cluster_louvain(karate)))
data(karate, package="igraphdata") average_degree(karate, membership(cluster_louvain(karate)))
Computes the Average Out Degree Fraction (Average ODF) of a graph (which can be weighted) and its communities.
average_odf(g, com)
average_odf(g, com)
g |
Graph to be analyzed (as an |
com |
Community membership integer vector. Each element corresponds to a vertex of the graph, and contains the index of the community it belongs to. |
Numeric vector with the Average ODF of each community.
Other cluster scoring functions:
FOMD()
,
average_degree()
,
conductance()
,
coverage()
,
cut_ratio()
,
density_ratio()
,
edges_inside()
,
expansion()
,
internal_density()
,
max_odf()
,
normalized_cut()
,
scoring_functions()
,
weighted_clustering_coefficient()
,
weighted_transitivity()
data(karate, package="igraphdata") average_odf(karate, membership(cluster_louvain(karate)))
data(karate, package="igraphdata") average_odf(karate, membership(cluster_louvain(karate)))
Generates a Barabási-Albert graph with community structure
barabasi_albert_blocks( m, p, B, t_max, G0 = NULL, t0 = NULL, G0_labels = NULL, sample_with_replacement = FALSE, type = "Hajek" )
barabasi_albert_blocks( m, p, B, t_max, G0 = NULL, t0 = NULL, G0_labels = NULL, sample_with_replacement = FALSE, type = "Hajek" )
m |
number of edges added at each step. |
p |
vector of label probabilities. If they don't sum 1, they will be scaled accordingly. |
B |
matrix indicating the affinity of vertices of each label. |
t_max |
maximum value of t (which corresponds to graph order) |
G0 |
initial graph |
t0 |
t value at which new vertex start to be attached. If G0 is provided, this argument is ignored and assumed to be gorder(G0)+1. If it isn't, a G0 graph will be generated with order t0-1. |
G0_labels |
labels of the initial graph. If NULL, they will all be set to 1. |
sample_with_replacement |
If TRUE, allows parallel edges. |
type |
Either "Hajek" or "block_first". |
The resulting graph, as an igraph object. The vertices have a "label" attribute.
B <- matrix(c(1, 0.2, 0.2, 1), ncol=2) G <- barabasi_albert_blocks(m=4, p=c(0.5, 0.5), B=B, t_max=100, type="Hajek", sample_with_replacement = FALSE)
B <- matrix(c(1, 0.2, 0.2, 1), ncol=2) G <- barabasi_albert_blocks(m=4, p=c(0.5, 0.5), B=B, t_max=100, type="Hajek", sample_with_replacement = FALSE)
Performs nonparametric bootstrap on a graph's by resampling its vertices and clustering the results using a list of clustering algorithms.
boot_alg_list( alg_list = list(Louvain = cluster_louvain, `label prop` = cluster_label_prop, walktrap = cluster_walktrap), g, R = 999, return_data = FALSE, type = "global" )
boot_alg_list( alg_list = list(Louvain = cluster_louvain, `label prop` = cluster_label_prop, walktrap = cluster_walktrap), g, R = 999, return_data = FALSE, type = "global" )
alg_list |
List of igraph clustering algorithms |
g |
|
R |
Number of bootstrap replicates. |
return_data |
Logical. If |
type |
Can be "global" (Variation of Information, Reduced Mutual Information, and adjusted Rand Index) or "cluster-wise" (Jaccard distance) |
If return_data
is set to TRUE
, returns a list of objects of
class "boot
" (see boot
). Otherwise, returns as table
with the mean distances from the clusters in the original graph to the resampled
ones, for each of the algorithms.
Conductance of a graph's communities, which is given by
,
where is the weight of the edges connecting the community s to the rest
of the graph, and m_s is the internal weight of the community.
conductance(g, com)
conductance(g, com)
g |
Graph to be analyzed (as an |
com |
community membership integer vector. Each element corresponds to a vertex. |
Numeric vector with the conductance of each community.
Other cluster scoring functions:
FOMD()
,
average_degree()
,
average_odf()
,
coverage()
,
cut_ratio()
,
density_ratio()
,
edges_inside()
,
expansion()
,
internal_density()
,
max_odf()
,
normalized_cut()
,
scoring_functions()
,
weighted_clustering_coefficient()
,
weighted_transitivity()
data(karate, package="igraphdata") conductance(karate, membership(cluster_louvain(karate)))
data(karate, package="igraphdata") conductance(karate, membership(cluster_louvain(karate)))
Given a contingency table, obtains a possible pair of corresponding labelings. That is, element M[i,j] is the number of elements that belong to community i in the first labeling and j in the second.
contingency_to_membership_vectors(M)
contingency_to_membership_vectors(M)
M |
the contingency table |
a list containing the two membership vectors
Given a contingency table, returns the natural logarithm of the number of contingency tables that share the same column and row sums. This implementation combines a Markov Chain Monte Carlo approximation with an analytical formula. The input can be either M a contingency table, or two vectors of labels c1 and c2 (in this case, we are counting contingency tables with the same column an row sums as the one produced by c1 and c2)
count_contingency_tables_log(c1, c2, M = NULL, monte_carlo_only = FALSE)
count_contingency_tables_log(c1, c2, M = NULL, monte_carlo_only = FALSE)
c1 , c2
|
membership vectors |
M |
contingency table |
monte_carlo_only |
Uses only the Monte Carlo approximation |
Computes the coverage (fraction of internal edges with respect to the total number of edges) of a graph and its communities
coverage(g, com)
coverage(g, com)
g |
Graph to be analyzed (as an |
com |
Community membership integer vector. Each element corresponds to a vertex of the graph, and contains the index of the community it belongs to. |
Numeric value of the coverage of g
and com
.
Other cluster scoring functions:
FOMD()
,
average_degree()
,
average_odf()
,
conductance()
,
cut_ratio()
,
density_ratio()
,
edges_inside()
,
expansion()
,
internal_density()
,
max_odf()
,
normalized_cut()
,
scoring_functions()
,
weighted_clustering_coefficient()
,
weighted_transitivity()
data(karate, package="igraphdata") coverage(karate, membership(cluster_louvain(karate)))
data(karate, package="igraphdata") coverage(karate, membership(cluster_louvain(karate)))
The cut ratio of a graph's community is the total edge weight connecting the community to the rest of the graph divided by number of unordered pairs of vertices such that one belongs to the community and the other does not.
cut_ratio(g, com)
cut_ratio(g, com)
g |
Graph to be analyzed (as an |
com |
community membership integer vector. Each element corresponds to a vertex. |
Numeric vector with the cut ratio of each community.
Other cluster scoring functions:
FOMD()
,
average_degree()
,
average_odf()
,
conductance()
,
coverage()
,
density_ratio()
,
edges_inside()
,
expansion()
,
internal_density()
,
max_odf()
,
normalized_cut()
,
scoring_functions()
,
weighted_clustering_coefficient()
,
weighted_transitivity()
data(karate, package="igraphdata") cut_ratio(karate, membership(cluster_louvain(karate)))
data(karate, package="igraphdata") cut_ratio(karate, membership(cluster_louvain(karate)))
Density ratio of a graph's communities.
density_ratio(g, com, type = "local")
density_ratio(g, com, type = "local")
g |
Graph to be analyzed (as an |
com |
community membership integer vector. Each element corresponds to a vertex. |
type |
can either be "local" or "global" |
Numeric vector with the internal density of each community.
Other cluster scoring functions:
FOMD()
,
average_degree()
,
average_odf()
,
conductance()
,
coverage()
,
cut_ratio()
,
edges_inside()
,
expansion()
,
internal_density()
,
max_odf()
,
normalized_cut()
,
scoring_functions()
,
weighted_clustering_coefficient()
,
weighted_transitivity()
data(karate, package="igraphdata") density_ratio(karate, membership(cluster_louvain(karate)))
data(karate, package="igraphdata") density_ratio(karate, membership(cluster_louvain(karate)))
Number of edges inside a graph's communities, or their accumulated weight if the graph's edges are weighted.
edges_inside(g, com)
edges_inside(g, com)
g |
Graph to be analyzed (as an |
com |
community membership integer vector. Each element corresponds to a vertex. |
Numeric vector with the internal edge weight of each community
Other cluster scoring functions:
FOMD()
,
average_degree()
,
average_odf()
,
conductance()
,
coverage()
,
cut_ratio()
,
density_ratio()
,
expansion()
,
internal_density()
,
max_odf()
,
normalized_cut()
,
scoring_functions()
,
weighted_clustering_coefficient()
,
weighted_transitivity()
data(karate, package="igraphdata") edges_inside(karate, membership(cluster_louvain(karate)))
data(karate, package="igraphdata") edges_inside(karate, membership(cluster_louvain(karate)))
This is the total number of contingency tables (of the same margins as M) divided by the number that match M until the r-th row (included, 0-indexed). Note that if r==0, this is always 1 by definition.
estimate_H_fraction_r_rows(M, r, error = 0.1)
estimate_H_fraction_r_rows(M, r, error = 0.1)
M |
contingency table |
r |
row index |
error |
error for the convergence of the method |
Given a graph and a list of clustering algorithms, computes several scoring functions on the clusters found by each of the algorithms.
evaluate_significance( g, alg_list = list(Louvain = cluster_louvain, `label prop` = cluster_label_prop, walktrap = cluster_walktrap), no_clustering_coef = FALSE, gt_clustering = NULL, w_max = NULL )
evaluate_significance( g, alg_list = list(Louvain = cluster_louvain, `label prop` = cluster_label_prop, walktrap = cluster_walktrap), no_clustering_coef = FALSE, gt_clustering = NULL, w_max = NULL )
g |
Graph to be analyzed (as an |
alg_list |
List of clustering algorithms, which take an |
no_clustering_coef |
Logical. If |
gt_clustering |
Vector of integers that correspond to labels of the ground truth clustering. The scoring functions will be evaluated on it. |
w_max |
Numeric. Upper bound for edge weights. Should be generally left as default ( |
A data frame with the values of scoring functions (see scoring_functions
)
of the clusters obtained by
applying the clustering algorithms to the graph.
data(karate, package="igraphdata") evaluate_significance(karate)
data(karate, package="igraphdata") evaluate_significance(karate)
Computes community scoring functions to the communities obtained by applying the given clustering algorithms to a graph. These are compared to the same scores for randomized versions of the graph obtained by a switching algorithm that rewires edges.
evaluate_significance_r( g, alg_list = list(Louvain = cluster_louvain, `label prop` = cluster_label_prop, walktrap = cluster_walktrap), no_clustering_coef = FALSE, gt_clustering = NULL, table_style = "default", ignore_degenerate_cl = TRUE, Q = 100, lower_bound = 0, weight_sel = "const_var", n_reps = 5, w_max = NULL )
evaluate_significance_r( g, alg_list = list(Louvain = cluster_louvain, `label prop` = cluster_label_prop, walktrap = cluster_walktrap), no_clustering_coef = FALSE, gt_clustering = NULL, table_style = "default", ignore_degenerate_cl = TRUE, Q = 100, lower_bound = 0, weight_sel = "const_var", n_reps = 5, w_max = NULL )
g |
Graph to be analyzed (as an |
alg_list |
List of clustering algorithms, which take an |
no_clustering_coef |
Logical. If |
gt_clustering |
Vector of integers that correspond to labels of the ground truth clustering. The scoring functions will be evaluated on it. |
table_style |
By default returns a table with three columns per algorithm: the original one, the mean of the corresponding rewired scores (suffix "_r") and it's percentile rank within the distribution of rewired scores (suffix "_percentile"). If table_style == "string", instead returns a table with a column per algorithm where each element is of the form "original|rewired(percentile)" |
ignore_degenerate_cl |
Logical. If TRUE, when computing the means of the scoring functions, samples with only one cluster will be ignored. See rewireCpp. |
Q |
Numeric. Parameter that controls the number of iterations of the switching algorithm, which will be Q times the order of the graph. |
lower_bound |
Numeric. Lower bound to the edge weights. The randomization process will avoid steps that would make edge weights fall outside this bound. It should generally be left as 0 to avoid negative weights. |
weight_sel |
Can be either |
n_reps |
Number of samples of the rewired graph. |
w_max |
Numeric. Upper bound for edge weights. The randomization algorithm will avoid steps that would make
edge weights fall outside this bound. Should be generally left as default ( |
A matrix with the results of each scoring function and algorithm. See table_style
for details.
Given a graph (possibly weighted) split into communities, the expansion of a community is the sum of all edge weights connecting it to the rest of the graph divided by the number of vertices in the community
expansion(g, com)
expansion(g, com)
g |
Graph to be analyzed (as an |
com |
community membership integer vector. Each element corresponds to a vertex. |
Numeric vector with the expansion of each community.
Other cluster scoring functions:
FOMD()
,
average_degree()
,
average_odf()
,
conductance()
,
coverage()
,
cut_ratio()
,
density_ratio()
,
edges_inside()
,
internal_density()
,
max_odf()
,
normalized_cut()
,
scoring_functions()
,
weighted_clustering_coefficient()
,
weighted_transitivity()
data(karate, package="igraphdata") expansion(karate, membership(cluster_louvain(karate)))
data(karate, package="igraphdata") expansion(karate, membership(cluster_louvain(karate)))
Given a weighted graph and a partition into communities, returns the fraction of nodes of each community whose internal degree (i.e. the degree accounting only intra-community edges) is greater than the median degree of the whole graph.
FOMD(g, com, edgelist = NULL)
FOMD(g, com, edgelist = NULL)
g |
Graph to be analyzed (as an |
com |
Community membership integer vector. Each element corresponds to a vertex. |
edgelist |
alternatively, the edgelist of the graph, as a matrix where the first two columns to the vertices and the third is the weight of each edge. |
Numeric vector with the FOMD of each community.
Other cluster scoring functions:
average_degree()
,
average_odf()
,
conductance()
,
coverage()
,
cut_ratio()
,
density_ratio()
,
edges_inside()
,
expansion()
,
internal_density()
,
max_odf()
,
normalized_cut()
,
scoring_functions()
,
weighted_clustering_coefficient()
,
weighted_transitivity()
data(karate, package="igraphdata") FOMD(karate, membership(cluster_louvain(karate)))
data(karate, package="igraphdata") FOMD(karate, membership(cluster_louvain(karate)))
Network built from correlations between time series of exchange rate returns. It was built from the 13 most traded currencies and with data of January 2009. It is a complete graph of 78 vertices (corresponding to pairs of currencies) and has edge weights bounded between 0 and 1.
g_forex
g_forex
An igraph object with 78 vertices and 3003 weighted edges
This function is just used internally for testing the package
igraph_to_edgelist(g, sort = TRUE)
igraph_to_edgelist(g, sort = TRUE)
g |
igraph graph with weighted edges |
sort |
sorts the edge list lexicographically before returning |
A matrix where the first two columns indicate the incident vertices, and the third is the weight of the corresponding edge.
Internal density of a graph's communities. That is, the sum of weights of their edges divided by the number of unordered pairs of vertices (which is the number of potential edges).
internal_density(g, com)
internal_density(g, com)
g |
Graph to be analyzed (as an |
com |
community membership integer vector. Each element corresponds to a vertex. |
Numeric vector with the internal density of each community.
Other cluster scoring functions:
FOMD()
,
average_degree()
,
average_odf()
,
conductance()
,
coverage()
,
cut_ratio()
,
density_ratio()
,
edges_inside()
,
expansion()
,
max_odf()
,
normalized_cut()
,
scoring_functions()
,
weighted_clustering_coefficient()
,
weighted_transitivity()
data(karate, package="igraphdata") internal_density(karate, membership(cluster_louvain(karate)))
data(karate, package="igraphdata") internal_density(karate, membership(cluster_louvain(karate)))
Given a graph, create a "weight" attribute set to 1 for the edges if it doesn't exist already.
make_graph_weighted(g)
make_graph_weighted(g)
g |
igraph graph |
igraph graph with either all edge weights set to 1 (if the original graph was unweighted), or to their original weights if they already existed (in this case, the graph isn't modified at all).
Computes the Maximum Out Degree Fraction (Max ODF) of a graph (which can be weighted) and its communities.
Computes the Flake Out Degree Fraction (Max ODF) of a graph (which can be weighted) and its communities.
max_odf(g, com) max_odf(g, com)
max_odf(g, com) max_odf(g, com)
g |
Graph to be analyzed (as an |
com |
Community membership integer vector. Each element corresponds to a vertex of the graph, and contains the index of the community it belongs to. |
Numeric vector with the Max ODF of each community.
Numeric vector with the Max ODF of each community.
Other cluster scoring functions:
FOMD()
,
average_degree()
,
average_odf()
,
conductance()
,
coverage()
,
cut_ratio()
,
density_ratio()
,
edges_inside()
,
expansion()
,
internal_density()
,
normalized_cut()
,
scoring_functions()
,
weighted_clustering_coefficient()
,
weighted_transitivity()
Other cluster scoring functions:
FOMD()
,
average_degree()
,
average_odf()
,
conductance()
,
coverage()
,
cut_ratio()
,
density_ratio()
,
edges_inside()
,
expansion()
,
internal_density()
,
normalized_cut()
,
scoring_functions()
,
weighted_clustering_coefficient()
,
weighted_transitivity()
data(karate, package="igraphdata") max_odf(karate, membership(cluster_louvain(karate))) data(karate, package="igraphdata") max_odf(karate, membership(cluster_louvain(karate)))
data(karate, package="igraphdata") max_odf(karate, membership(cluster_louvain(karate))) data(karate, package="igraphdata") max_odf(karate, membership(cluster_louvain(karate)))
Normalized cut of a graph's communities, which is given by
,
where is the weight of the edges connecting the community s to the rest
of the graph,
is the internal weight of the community, and
is
the total weight of the network.
normalized_cut(g, com)
normalized_cut(g, com)
g |
Graph to be analyzed (as an |
com |
community membership integer vector. Each element corresponds to a vertex. |
Numeric vector with the normalized cut of each community.
Other cluster scoring functions:
FOMD()
,
average_degree()
,
average_odf()
,
conductance()
,
coverage()
,
cut_ratio()
,
density_ratio()
,
edges_inside()
,
expansion()
,
internal_density()
,
max_odf()
,
scoring_functions()
,
weighted_clustering_coefficient()
,
weighted_transitivity()
data(karate, package="igraphdata") normalized_cut(karate, membership(cluster_louvain(karate)))
data(karate, package="igraphdata") normalized_cut(karate, membership(cluster_louvain(karate)))
Given a weighted graph and a partition into communities, returns the maximum, average and flake out degree fractions of each community.
out_degree_fractions(g, com, edgelist)
out_degree_fractions(g, com, edgelist)
g |
Graph to be analyzed (as an |
com |
Community membership vector. Each element corresponds to a vertex of the graph, and contains the index of the community it belongs to. |
edgelist |
alternatively, the edgelist of the graph |
A numeric matrix where each row corresponds to a community, and the columns contain the max, average and flake ODFs respectively.
Computes the Newman's Reduced Mutual Information (RMI) as defined in (Newman et al. 2020).
reduced_mutual_information( c1, c2, base = 2, normalized = FALSE, method = "approximation2", warning = TRUE )
reduced_mutual_information( c1, c2, base = 2, normalized = FALSE, method = "approximation2", warning = TRUE )
c1 , c2
|
membership vectors |
base |
base of the logarithms used in the calculations. Changing it only scales the final value. By default set to e=exp(1). |
normalized |
If true, computes the normalized version of the corrected mutual information. |
method |
Can be "hybrid" (default, combines Monte Carlo with analytical formula), "monte_carlo", approximation1" (appropriate for partitions into many very small clusters), or "approximation2" (for partitions into few larger clusters). |
warning |
set to false to ignore the warning. |
The implementation is based on equations 23 (25 for the normalized case) and 29 in (Newman et al. 2020).
The evaluations of the functions can get too large and cause overflow
issues in the intermediate steps, so the following term of equation 29:
is rewritten as
, and then the function lgamma is used instead of gamma.
The value of Newman's RMI (a scalar).
Newman MEJ, Cantwell GT, Young J (2020). “Improved mutual information measure for clustering, classification, and community detection.” Phys. Rev. E, 101(4), 042304. doi:10.1103/PhysRevE.101.042304.
Takes a vector of vertex ids indicating community membership, and relabels the communities to have consecutive values from 1 to the number of communities.
relabel(c)
relabel(c)
c |
numeric vector of vertex ids, not necessarily consecutive |
A numeric vector of consecutive vertex ids starting from one
Converts the graph to a weighted edge list in NumericMatrix, which is compatible with Rcpp. The Rcpp function "randomize" is called, and then the resulting edge list is converted back into an igraph object.
rewireCpp( g, Q = 100, weight_sel = "max_weight", lower_bound = 0, upper_bound = NULL )
rewireCpp( g, Q = 100, weight_sel = "max_weight", lower_bound = 0, upper_bound = NULL )
g |
|
Q |
Numeric. Parameter that controls the number of iterations, which will be Q times the order of the graph. |
weight_sel |
can be either "const_var" or "max_weight". |
lower_bound , upper_bound
|
Bounds to the edge weights. The randomization process will avoid steps that would make edge weights fall outside these bounds. Set to NULL for no bound. By default, 0 and NULL respectively. |
The rewired graph.
Computes the scoring functions of a graph and its clusters.
scoring_functions( g, com, no_clustering_coef = TRUE, type = "local", weighted = TRUE, w_max = NULL )
scoring_functions( g, com, no_clustering_coef = TRUE, type = "local", weighted = TRUE, w_max = NULL )
g |
Graph to be analyzed (as an |
com |
Community membership integer vector. Each element corresponds to a vertex of the graph, and contains the index of the community it belongs to. |
no_clustering_coef |
Logical. If TRUE, skips the computation of the clustering coefficient (which can be slow on large graphs). |
type |
can be "local" for a cluster by cluster analysis, or "global" for a global analysis of the whole graph partition. |
weighted |
Is the graph weighted? If it is, doesn't compute TPR score. |
w_max |
Numeric. Upper bound for edge weights. Should be generally left as default (NULL). Only affects the computation of the clustering coefficient. |
If type=="local"
, returns a dataframe with a row for each
community, and a column for each score. If type=="global"
, returns a
single row with the weighted average scores.
Other cluster scoring functions:
FOMD()
,
average_degree()
,
average_odf()
,
conductance()
,
coverage()
,
cut_ratio()
,
density_ratio()
,
edges_inside()
,
expansion()
,
internal_density()
,
max_odf()
,
normalized_cut()
,
weighted_clustering_coefficient()
,
weighted_transitivity()
data(karate, package="igraphdata") scoring_functions(karate, membership(cluster_louvain(karate)))
data(karate, package="igraphdata") scoring_functions(karate, membership(cluster_louvain(karate)))
Given a matrix, rearranges rows and columns so that row sums and col sums end up in ascending order.
sort_matrix(M)
sort_matrix(M)
M |
matrix |
rearranged matrix
Computes the triangle participation ratio (proportion of vertices that belong to a triangle). The computation is done to the subgraphs induced by each of the communities in the given partition.
triangle_participation_ratio_communities(g, com)
triangle_participation_ratio_communities(g, com)
g |
The input graph (as an igraph object). Edge weights and directions are ignored. |
com |
Community membership vector. Each element corresponds to a vertex of the graph, and contains the index of the community it belongs to. |
A vector containing the triangle participation ratio of each community.
Weighted clustering Computed using the definition given by McAssey, M. P. and Bijma, F. in "A clustering coefficient for complete weighted networks" (2015).
weighted_clustering_coefficient(g, upper_bound = NULL)
weighted_clustering_coefficient(g, upper_bound = NULL)
g |
igraph graph |
upper_bound |
upper bound to the edge weights used to compute the integral |
The weighted clustering coefficient of the graph (a scalar).
Other cluster scoring functions:
FOMD()
,
average_degree()
,
average_odf()
,
conductance()
,
coverage()
,
cut_ratio()
,
density_ratio()
,
edges_inside()
,
expansion()
,
internal_density()
,
max_odf()
,
normalized_cut()
,
scoring_functions()
,
weighted_transitivity()
data(karate, package="igraphdata") weighted_clustering_coefficient(karate)
data(karate, package="igraphdata") weighted_clustering_coefficient(karate)
Computed using the definition given by McAssey, M. P. and Bijma, F. in "A clustering coefficient for complete weighted networks" (2015).
weighted_transitivity(g, upper_bound = NULL)
weighted_transitivity(g, upper_bound = NULL)
g |
igraph graph |
upper_bound |
upper bound to the edge weights used to compute the integral |
The weighted transitivity of the graph (a scalar).
Other cluster scoring functions:
FOMD()
,
average_degree()
,
average_odf()
,
conductance()
,
coverage()
,
cut_ratio()
,
density_ratio()
,
edges_inside()
,
expansion()
,
internal_density()
,
max_odf()
,
normalized_cut()
,
scoring_functions()
,
weighted_clustering_coefficient()
data(karate, package="igraphdata") weighted_transitivity(karate)
data(karate, package="igraphdata") weighted_transitivity(karate)