We deal with the critical node problem (CNP) in a graph [Formula: see text], in which a given number [Formula: see text] of nodes are removed to minimize the connectivity of the residual graph in some sense. Several ways to minimize some connectivity measurement have been proposed, including minimizing the connectivity index(MinCI), maximizing the number of components, minimizing the maximal component size. We propose two classes of CNPs by combining the above measurements together. The objective is to minimize the sum of connectivity indexes and the total degrees in the residual graph. The CNP with an upper-bound [Formula: see text] on the maximal component size is denoted by MSCID-CS and the one with an extra upper-bound [Formula: see text] on the number of components is denoted by MSCID-CSN. They are generalizations of the MinCI, which has been shown NP-hard for general graphs. In particular, we study the case where [Formula: see text] is a tree. Two dynamic programming algorithms are proposed to solve the two classes of CNPs. The time complexities of the algorithms for MSCID-CS and MSCID-CSN are [Formula: see text] and [Formula: see text], respectively, where [Formula: see text] is the number of nodes in [Formula: see text]. Computational experiments are presented which show the effectiveness of the algorithms.