The critical node detection problem (CNDP) aims to fragment a graph G=(V,E) by removing a set of vertices R with cardinality |R|≤k, such that the residual graph has minimum pairwise connectivity for user-defined value k. Existing optimization algorithms are incapable of finding a good set R in graphs with many thousands or millions of vertices due to the associated computational cost. Hence, there exists a need for a time- and space-efficient approach for evaluating the impact of removing any v∈V in the context of the CNDP. In this paper, we propose an algorithm based on a modified depth-first search that requires O(k(|V|+|E|)) time complexity. We employ the method within in a greedy algorithm for quickly identifying R. Our experimental results consider small- (≤250 nodes) and medium-sized (≤25,000 nodes) networks, where it is possible to compare to known optimal solutions or results obtained by other heuristics. Additionally, we show results using six real-world networks. The proposed algorithm can be easily extended to vertex- and edge-weighted variants of the CNDP.