Tutorials › Graph Theory (Undergraduate) › Greedy Independent Sets and Degree Guarantees

Complexity of Graph Problems · Tutorial 750 of 799

Greedy Independent Sets and Degree Guarantees

Learn why every greedy maximal independent set has a size guarantee determined by the graph’s maximum degree, and how to interpret that guarantee as an approximation ratio.

Advanced 10 min read

What You'll Learn

  • Define maximal and maximum independent sets and distinguish them.
  • Trace the greedy independent-set algorithm, including the vertices deleted at each step.
  • Prove that the algorithm returns a maximal independent set.
  • Prove the lower bound n/(Delta+1) for graphs of maximum degree Delta.
  • Derive the corresponding approximation guarantee for maximum independent set.
  • Recognize why a maximal independent set need not be maximum.

Greedy Selection and Maximality

An independent set is a collection of vertices with no edges between them. Finding a largest such collection is an optimization problem, but a simple greedy procedure always finds an independent set that cannot be enlarged by adding another vertex. The distinction matters: being impossible to enlarge one vertex at a time does not mean the set is largest among all independent sets. Nevertheless, the graph’s maximum degree gives a guaranteed lower bound on the size of every such maximal set.

Throughout, graphs are finite and simple. For a graph \(G=(V,E)\), write \(n=|V|\), and, when \(V\) is nonempty, let \(\Delta=\Delta(G)\) be its maximum vertex degree. A set \(I\subseteq V\) is independent if no edge has both endpoints in \(I\). It is maximal if it is independent and no strictly larger independent set contains it. It is maximum if its size is at least that of every independent set. The maximum possible size is denoted by \(\alpha(G)\).

Definition: The greedy independent-set algorithm starts with all vertices available. It repeatedly chooses any available vertex \(v\), adds \(v\) to \(I\), and removes \(v\) and every available neighbor of \(v\). It stops when no vertices remain.

Different choices can produce different outputs. The guarantee proved below holds for every order of choices, not only for an order chosen by a special rule. We assume \(n\geq 1\), so \(\Delta\) is defined. The empty graph on no vertices has the empty independent set, but the expression involving its maximum degree is not needed here.

Theorem: On every nonempty finite simple graph, the greedy independent-set algorithm terminates and returns a maximal independent set.

Proof. Each step removes at least the chosen vertex from the available set, so the algorithm terminates after at most \(n\) steps. No two chosen vertices are adjacent: after choosing \(v\), every available neighbor of \(v\) is removed and cannot be chosen later. Thus the output \(I\) is independent. At termination, every vertex outside \(I\) must have been removed as a neighbor of some chosen vertex; otherwise it would still be available. Therefore every vertex outside \(I\) is adjacent to a vertex in \(I\). Adding any outside vertex to \(I\) would create an edge within the set, so \(I\) is maximal. \(\square\)

The procedure can be implemented in polynomial time. For example, keep track of available vertices and, when a vertex is selected, scan its adjacency list to remove its available neighbors. Each vertex is selected at most once, and the scans involve at most a polynomial number of operations in \(n+|E|\). The guarantee is therefore useful as a constructive algorithmic result, not merely as an existence statement.

The Degree Bound

Each selected vertex accounts for the vertices it removes. Those groups of removed vertices are disjoint and together contain all of \(V\). If \(v\) is selected, it removes at most itself and its neighbors, hence at most \(\deg(v)+1\leq\Delta+1\) vertices. Counting all vertices by these groups gives the size bound.

Theorem: If \(G\) is a nonempty graph with \(n\) vertices and maximum degree \(\Delta\), then every maximal independent set \(I\) satisfies $$ |I|\geq \frac{n}{\Delta+1}. $$ In particular, the greedy algorithm returns a set of at least this size.

Proof. Run the greedy algorithm and let its selected vertices, in order, be \(v_1,\ldots,v_k\). For each \(i\), let \(R_i\) be the vertices removed at the step when \(v_i\) is selected, including \(v_i\) itself. Every vertex is removed at exactly one step, so the sets \(R_1,\ldots,R_k\) partition \(V\). The vertices in \(R_i\) are all in the closed neighborhood of \(v_i\), consisting of \(v_i\) and its neighbors. Consequently, $$ |R_i|\leq \deg(v_i)+1\leq\Delta+1. $$ Summing over the \(k=|I|\) steps yields $$ n=\sum_{i=1}^k |R_i|\leq k(\Delta+1)=|I|(\Delta+1). $$ Since \(\Delta+1>0\), division gives \(|I|\geq n/(\Delta+1)\). The proof applies to every maximal independent set because the same counting argument can be made by assigning each vertex outside the set to one of its neighbors in the set. \(\square\)

The inequality is a real-valued lower bound: the integer size of \(I\) must therefore be at least \(\lceil n/(\Delta+1)\rceil\), where \(\lceil x\rceil\) is the least integer greater than or equal to \(x\). An equivalent count that retains more information about the selected vertices is \(n\leq\sum_{v\in I}(\deg(v)+1)\). Replacing each degree in that sum by the common upper bound \(\Delta\) gives the stated estimate.

From a Size Bound to an Approximation Guarantee

For a maximization problem, a \(\rho\)-approximation guarantee means that the algorithm’s output has value at least \(\mathrm{OPT}/\rho\), where \(\mathrm{OPT}\) is the optimum value and \(\rho\geq1\). For maximum independent set, the optimum is \(\alpha(G)\). Since \(\alpha(G)\leq n\), the degree bound immediately implies \(|I|\geq\alpha(G)/(\Delta+1)\). In fact, the same guarantee follows directly by comparing an optimum independent set with \(I\).

Corollary: On a nonempty graph of maximum degree \(\Delta\), the greedy algorithm is a \((\Delta+1)\)-approximation for maximum independent set: its output \(I\) satisfies $$ |I|\geq \frac{\alpha(G)}{\Delta+1}. $$

Proof. Let \(S\) be a maximum independent set, so \(|S|=\alpha(G)\). Maximality of \(I\) means that every vertex of \(G\), whether in \(I\) or outside it, is either in \(I\) or adjacent to a vertex of \(I\). Assign each \(x\in S\) to one such vertex \(v\in I\) with \(x=v\) or \(xv\in E\). For a fixed \(v\), at most \(\deg(v)+1\leq\Delta+1\) vertices can be assigned to it, since they must lie in its closed neighborhood. Counting the assigned vertices gives \(|S|\leq(\Delta+1)|I|\), which rearranges to the claimed inequality. \(\square\)

This is a degree-dependent guarantee: when \(\Delta\) is bounded by a fixed constant, the factor \(\Delta+1\) is constant. If the maximum degree grows with the number of vertices, the guarantee also grows; it should not then be described as a constant-factor approximation independent of the input size. The guarantee is valid without requiring a particular choice rule, but it does not say that all choices have the same output size.

Worked Example: A Triangle and a Separate Edge

Let \(G\) have vertex set \(V=\{1,2,3,4,5\}\) and edge set \(E=\{12,23,13,45\}\). Its degrees are \(\deg(1)=\deg(2)=\deg(3)=2\) and \(\deg(4)=\deg(5)=1\), so \(\Delta=2\). Run the algorithm by choosing \(1\) first, then \(4\) if it remains available.

StepAvailable before choiceChoiceRemovedAvailable after
1\(\{1,2,3,4,5\}\)\(1\)\(\{1,2,3\}\)\(\{4,5\}\)
2\(\{4,5\}\)\(4\)\(\{4,5\}\)\(\varnothing\)

The output is \(I=\{1,4\}\), of size \(2\). It is independent because \(14\notin E\), and maximal because the excluded vertices \(2,3,5\) are adjacent to \(1,1,4\), respectively. Substitution into the degree bound gives \(n/(\Delta+1)=5/(2+1)=5/3\), and \(2\geq5/3\). The output is also maximum: the triangle contributes at most one vertex to any independent set, and the edge \(45\) contributes at most one, so no independent set has more than \(1+1=2\) vertices. The output attains that count.

Worked Example: Choosing the Center of a Star

Let \(G\) have vertex set \(V=\{c,a,b,d\}\) and edge set \(E=\{ca,cb,cd\}\), the star \(K_{1,3}\). The center has degree \(\deg(c)=3\), and each of the three leaves has degree \(1\), so \(n=4\) and \(\Delta=3\). Choose \(c\) first.

StepAvailable before choiceChoiceRemovedAvailable after
1\(\{c,a,b,d\}\)\(c\)\(\{c,a,b,d\}\)\(\varnothing\)

The output \(I=\{c\}\) is independent and maximal, since each excluded leaf is adjacent to \(c\). The bound evaluates to \(n/(\Delta+1)=4/(3+1)=1\), so the output meets it exactly. On the other hand, \(\{a,b,d\}\) is independent and has size \(3\); no independent set can include both \(c\) and a leaf, so this is maximum and \(\alpha(G)=3\). The approximation guarantee requires \(|I|\geq\alpha(G)/(\Delta+1)=3/(3+1)=3/4\), which the output of size \(1\) satisfies. Its optimum-to-output ratio is \(3/1=3\).

Worked Example: Different Orders on a Path

Let \(G\) have vertex set \(V=\{1,2,3,4,5\}\) and edge set \(E=\{12,23,34,45\}\), so \(G=P_5\). The endpoint degrees are \(1\) and the three interior degrees are \(2\); hence \(n=5\) and \(\Delta=2\). First choose \(3\), then choose \(1\) and \(5\) as they remain available.

StepAvailable before choiceChoiceRemovedAvailable after
1\(\{1,2,3,4,5\}\)\(3\)\(\{2,3,4\}\)\(\{1,5\}\)
2\(\{1,5\}\)\(1\)\(\{1\}\)\(\{5\}\)
3\(\{5\}\)\(5\)\(\{5\}\)\(\varnothing\)

This order gives \(I=\{1,3,5\}\), with size \(3\). It is independent, and vertices \(2\) and \(4\) are adjacent to \(1,3\) and \(3,5\), respectively, so it is maximal. Its size is maximum: among the disjoint adjacent pairs \(\{1,2\}\) and \(\{3,4\}\), an independent set can take at most one vertex from each, and it can take at most the remaining vertex \(5\). Thus its size is at most \(1+1+1=3\), attained by \(I\).

Now change the order: choose \(2\) first and then \(4\). The first choice removes \(\{1,2,3\}\), leaving \(\{4,5\}\); choosing \(4\) removes \(\{4,5\}\). The output is \(\{2,4\}\), a maximal independent set of size \(2\). The degree bound is \(5/(2+1)=5/3\), and \(2\geq5/3\). The two orders show that the algorithm guarantees maximality and a lower bound, not the same set or size for every order.

Common Mistakes and When the Bound Helps

Using \(\Delta\) instead of \(\Delta+1\). Each chosen vertex accounts for itself as well as its neighbors. In the star example, replacing the denominator by \(\Delta\) would give \(n/\Delta=4/3\), incorrectly claiming that every maximal independent set has at least \(4/3\) vertices. The algorithm’s output \(\{c\}\) has size \(1\). The correct count includes the chosen vertex: its closed neighborhood has size at most \(\Delta+1\), and the correct bound is \(4/(3+1)=1\).

Confusing maximal with maximum. A maximal set cannot be enlarged by adding a single outside vertex; a maximum set has the largest size among all independent sets. In the star example, \(\{c\}\) is maximal but not maximum, since replacing the center by all three leaves gives a larger independent set. The degree guarantee does not assert that the greedy output is maximum.

The bound is useful because it needs only a maximum-degree estimate, not knowledge of an optimal independent set. It gives a predictable baseline for a simple polynomial-time algorithm. When a graph has many isolated vertices or low-degree vertices, particular greedy choices may do substantially better than the worst-case estimate; the theorem uses the common upper bound \(\Delta\), so it need not capture those finer features.

Check Your Understanding

Use the definitions and counting argument to answer the following questions.

  1. In a nonempty graph of maximum degree \(4\) with \(n=18\), what lower bound does the theorem give for the size of every maximal independent set?
  2. Explain why each vertex outside the output of the greedy algorithm is adjacent to a selected vertex.
  3. For the graph with \(V=\{1,2,3,4\}\) and \(E=\{12,23,34\}\), run the algorithm by choosing \(2\) first. State the output and verify that it is maximal.
  4. Why does the bound imply a \((\Delta+1)\)-approximation even though it is expressed using \(n\), rather than \(\alpha(G)\)?
  5. Give an example of a maximal independent set that is not maximum, and identify an independent set of larger size in the same graph.