Identify and Bottleneck Nodes in a Network
find_bottlenecks.Rd
Identifies bottleneck nodes in an igraph
network as those with low degree
and high betweenness centrality. The function supports both standardized (z-score)
and quantile-based thresholding. Optionally, it produces a 2D scatter plot with
bottlenecks highlighted.
Arguments
- graph
An
igraph
object representing the network to analyze or a data frame containing a symbolic edge list in the first two columns. Additional columns are considered as edge attributes.- method
Character. Method to define bottlenecks:
"zscore"
or"quantile"
.- degree_threshold
Numeric. Upper threshold for standardized degree (only used if
method = "zscore"
).- betweenness_threshold
Numeric. Lower threshold for standardized betweenness (used in both methods).
- degree_quantile
Numeric between 0 and 1. Quantile threshold for degree (used if
method = "quantile"
).- betweenness_quantile
Numeric between 0 and 1. Quantile threshold for betweenness (used if
method = "quantile"
).- log_transform
Logical. If
TRUE
, applieslog1p
transformation to degree and betweenness.- plot
Logical. If
TRUE
, generates a plot of degree vs. betweenness highlighting bottlenecks.- focus_color
Character. Color to display in the focus area of the plot (bottlenecks region).
- bottleneck_names
Logical. If
TRUE
, labels bottleneck nodes on the plot.- bottleneck_cex
Numeric. Font size scaling for bottleneck labels on the plot.
- gg_extra
List. Additional user-defined layers for the returned ggplot. eg. list(ylim(-2,2), theme_bw(), theme(legend.position = "none"))
Value
A list with the following components:
method
A message describing the method and thresholds used.
result
A
tibble
with node name, degree, betweenness, transformed metrics, and bottleneck status.graph
The original graph with a new vertex attribute
bottleneck
(logical).
If plot = TRUE
, a scatter plot of degree vs. betweenness is displayed, highlighting bottlenecks.