Skip to contents

Algorithms

The LCDA variants proposed in the paper, plus the ensemble-consensus variant.

lcda_grasp()
LCDA-GRASP: fixed-parameter variant.
lcda_gr()
LCDA-GR: Reactive variant with self-tuning of (alpha_c, alpha_s). Implements Algorithm 4 of the paper.
lcda_ecg()
LCDA-ECG: ensemble-consensus community and leader detection.

Construction phases

Building blocks of a single GRASP iteration (construct, repair, local search).

lcda_construct()
LCDA construction - variant 1 (centrality computed once) or 2 (adaptive).
lcda_repair()
Repair: ensure every community has exactly one leader by recomputing centrality within the community and designating the top-scoring node.
lcda_local_search()
First-improvement local search, with automatic VNMI dispatch for n > 300.

Reporting

Everything the paper’s tables report, computed from a fitted result: one tidy metric table, plus the per-community and per-leader breakdowns.

lcda_metrics()
Paper-grade metrics for a community-and-leader solution

Quality scores

Modularity, the NCE leader score (global and community-conditioned), and the lexicographic objective.

modularity_score()
Compute modularity for an arbitrary partition.
nce_score()
Global NCE leader score (Eq. 14).
nce_local_score()
Community-conditioned NCE (proposed alternative).
lex_dominates()
Lexicographic dominance under (Q, H).

Centrality measures

Leader-selection centralities.

centrality_eigen()
Eigenvector centrality (own implementation, O(m log n)).
centrality_betweenness()
Betweenness centrality - delegates to igraph::betweenness for now. Tagged for a future native Rcpp implementation (Brandes 2001).
centrality_closeness()
Closeness centrality - delegates to igraph::closeness. On a disconnected graph, plain closeness is ill-defined across components (nodes in tiny components score spuriously high, distorting leader selection); we fall back to harmonic centrality, the robust generalisation that handles unreachable pairs (Boldi & Vigna 2014). Note the two are NOT identical even on a connected graph – closeness inverts the mean distance, harmonic averages the inverse distances – so on disconnected inputs (e.g. PolBlogs, and the frequently-disconnected induced subgraphs of variant 2) the selected leader may differ from a per-component closeness; this is a deliberate robustness choice, recorded here so benchmark results are interpreted accordingly.

Statistical comparison

The non-parametric procedure used in the paper’s experiments.

kruskal_then_permute()
Two-stage non-parametric comparison: Kruskal-Wallis omnibus followed by pairwise permutation tests with Bonferroni correction.
permutation_test()
Two-sample permutation test for a difference in means. Robust to ties and to zero-variance pools (as discussed in section 5.1).

Plotting

The community-and-leader map, plus the search-diagnostic figures.

lcda_plot_communities()
Detect communities and leaders on a graph, then plot them
plot_partition()
Plot a community partition with its leaders highlighted
plot(<lcda_grasp_result>) plot(<lcda_gr_result>) plot(<lcda_ecg_result>)
Plot a fitted LCDA result as a community-and-leader map
autoplot(<lcda_grasp_result>) autoplot(<lcda_gr_result>) autoplot(<lcda_ecg_result>)
Community-and-leader map as a ggplot object
plot_grasp_trajectory()
Plot the Q trajectory across GRASP iterations, with running maximum.
plot_reactive_pk()
Plot the evolution of selection probabilities p_k across iterations.

Graph constructors & data

as_csr()
Convert an igraph graph to the CSR representation used by the kernels
as_graph()
Coerce a variety of inputs to igraph.
graph_from_edgelist_simple()
Build an igraph from an integer edgelist (1-based), undirected simple.
lcda_data()
Precomputed simulation datasets
lcda_provenance()
Provenance of a shipped dataset (versions, date, checksum)