A brief introduction to the CNDPs
The Critical Node Detection Problems (CNDPs) constitute one of the most extensively studied classes of combinatorial optimization problems. A central issue in CNDPs is the selection of an appropriate network connectivity metric, for which a wide range of alternatives has been proposed in the literature. According to the adopted metrics, CNDPs can be broadly categorized into two groups: fragmentation-based CNDPs and distance-based CNDPs. The PyCNP package currently supports two representative variants, namely the Critical Node Problem (CNP) and the Distance-based Critical Node Problem (DCNP), which belong to the fragmentation-based and distance-based categories, respectively.
Problem formulation
The Critical Node Problem (CNP) and its variants can be formally described as optimization problems on an undirected graph \(G = (V, E)\), where \(V\) is the set of nodes and \(E\) is the set of edges. The goal is to find a subset of nodes \(S \subseteq V\) to remove, such that a specific connectivity metric of the residual graph \(G[V \setminus S]\) is minimized, subject to a budget constraint.
Supported problem variants
Critical Node Problem (CNP)
The standard CNP seeks to identify a set of critical nodes \(S\) whose removal minimizes the pairwise connectivity of the residual graph. The pairwise connectivity metric calculates the total number of node pairs that remain connected by a path.
Formally, the CNP is defined as:
Where:
\(k\): Budget constraint (maximum cost of removed nodes).
\(w_{ij}\): Weight associated with the connection between nodes \(i\) and \(j\).
\(x_{ij}\): Binary variable, equal to 1 if a path exists between \(i\) and \(j\) in \(G[V \setminus S]\), and 0 otherwise.
\(c_i\): Cost of removing node \(i\).
PyCNP focuses on the unweighted case where \(c_i = 1\) and \(w_{ij} = 1\). In this context, the objective simplifies to minimizing the total number of connected node pairs in the residual graph.
Distance-based Critical Node Problem (DCNP)
The Distance-based CNP (DCNP) considers the actual pairwise distances between nodes rather than just their connectivity. The objective is to minimize a distance-based connectivity metric.
Formally, the DCNP is defined as:
Where:
\(d_{ij}\): Shortest path distance between \(i\) and \(j\) in the residual graph \(G[V \setminus S]\).
\(\phi(d_{ij})\): Distance-based connectivity measure, defined as:
\(b\): Predefined hop distance limit. Two nodes are considered “connected” only if their distance is strictly less than \(b\).
Notably, when \(b \geq |V|\), the DCNP reduces to the standard CNP.
Hint
Check out the quick tutorial for step-by-step examples of solving CNP and DCNP instances.