Network centralities in GeoHabnet

Plex, Sula (, Krishna Keshav(

08 April, 2024

This article expands on “Analyzing risk index using habitat connectivity” from (Keshav et al. 2023) to demonstrate one example on how parameters can be customized to calculate centrality and it’s implication in the results.

Package installation -

if (!require("geohabnet")) {
## Loading required package: geohabnet


Getting the host density

avocado_mon <- geohabnet::cropharvest_rast("potato", "monfreda")

Running Sensitivity Analysis

avocado_result <- geohabnet::msean(avocado_mon, global = TRUE, link_threshold  = 0.000001,
                                   inv_pl = list(beta = c(0.5),
                                                 metrics = c("betweeness"),
                                                 weights = c(100),
                                                 cutoff = -1), res = 24,
                                   neg_exp = list(gamma = c(0.1),
                                                  metrics = c("betweeness"),
                                                  weights = c(100), cutoff = -1))




It is important to note that Betweenness centrality is a time intensive operation. Geohabnet uses a wrapper around igraph::betweenness(). Refer to (Csardi and Nepusz 2006) for more details and further reading. The cutoff parameter can be used set the threshold which will include the link weights based on this threshold. Setting this parameter will also be reflected in closeness.

The configuration based run for the above will be as follows -

get_parameters() -> modify values in parameters.yaml -> set_parameters() -> run sensitivity_analysis()


Csardi, Gabor, and Tamas Nepusz. 2006. “The Igraph Software Package for Complex Network Research” Complex Systems: 1695.
Keshav, Krishna, Garrett Lab, Karen Garrett, and Aaron Plex. 2023. “Geohabnet: Analysis of Cropland Connectivity.”