Skip to contents

A collection of tools for analyzing and visualizing networks. Summarizes global topology and per-node centrality, identifies hubs, bottlenecks and community structure, and classifies nodes into connectivity roles following Guimera and Amaral (2005) doi:10.1038/nature03288 . Extracts interpretable subnetworks around a set of nodes, including approximate Steiner trees after Kou, Markowsky and Berman (1981) doi:10.1007/BF00288961 . Propagates influence from seed nodes using Laplacian smoothing, heat-kernel and random-walk-with-restart diffusion, with degree-matched permutation nulls, and simulates network robustness under progressive node removal. Observed metrics can be tested against degree-preserving random ensembles. Edge weights are supported throughout, with an explicit declaration of whether a weight means strength or distance. Matrix operations use sparse representations throughout so that the methods remain usable on large graphs.

Getting started

Every function accepts either an igraph object or a data.frame edge list, so there is no import step to learn:

edges <- data.frame(from = c("a", "b", "c"), to = c("b", "c", "a"))
summarize_graph_metrics(edges)

Analysis functions return a list with a shared vocabulary – result (a table of per-node or per-step values), graph (the input graph with the new values attached as vertex attributes), method (what was actually computed, including the thresholds used) and, where there is one, plot. Because the annotated graph comes back, the functions chain:

hubs <- find_hubs(g, plot = FALSE)
mods <- find_modules(hubs$graph, plot = FALSE)   # keeps `is_hub`

Function map

Input and annotation

assign_attributes() attaches node and edge metadata from a data.frame. netkit-weights documents how edge weights are declared and used – read it before analyzing a weighted graph.

Topology

summarize_graph_metrics() for one row of global metrics, node_metrics() for the per-node counterpart, plot_CCDF() for the degree distribution and compare_networks() for two graphs side by side.

Statistical testing

null_model() builds a matched random ensemble; metric_significance() tests observed metrics against it and small_worldness() reports the sigma coefficient.

Node classification

find_hubs(), find_bottlenecks() and calculate_roles() for the Guimera-Amaral roles.

Community structure

find_modules().

Subnetworks

extract_subnetwork() builds an interpretable neighborhood around a set of nodes.

Diffusion

network_diffusion() propagates a signal from seed nodes, network_diffusion_with_pvalues() adds a permutation null, prepare_diffusion() precomputes the kernel for repeated calls and greedy_seed_selection() solves the inverse problem.

Robustness

robustness_analysis().

Visualization

plot_Net() is the central renderer; highlight_nodes() and layout_horizontal_tree() support it.

See also

vignette("introduction", package = "netkit") for a worked tour, and vignette("weighted-networks", package = "netkit") for what a weight means to each function.

Author

Maintainer: Alex Gallinat alex.gaoc@gmail.com