a b s t r a c tFor a simple graph G with n vertices and m edges, the inequality M 1 (G)/n ≤ M 2 (G)/m, where M 1 (G) and M 2 (G) are the first and the second Zagreb indices of G, is known as the Zagreb indices inequality. A set S is good if for every graph whose degrees of vertices are in S, the inequality holds. We characterize that an interval [a, a + n] is good if and only if a ≥ n(n−1) 2 or [a, a + n] = [1, 4]. We also present an algorithm that decides if an arbitrary set S of cardinality s is good, which requires O(s 2 log s) time and O(s) space.