Identifying critical nodes in undirected graphs: Complexity results and polynomial algorithms for the case of bounded treewidth