Manuscript Offprint
arXiv:2608.29274A Simplified Analysis of the Good-Bad -Approximation Algorithm for Some Minimum-Cost Graph Problems
Abstract
In this paper, we consider an easy greedy approximation algorithm, the good-bad algorithm, introduced by Couëtoux [Cou11] for finding a minimum-cost set of edges such that every connected component has at least vertices. Couëtoux proves that the good-bad algorithm achieves a 3/2-approximation for this problem. Davis and Williamson [DW12] extend this result to the more general problem of finding a minimum-cost edge set that contains at least one edge from every cut satisfying where is downward monotone; that is, implies for every nonempty subset . The original problem corresponds to when . We give a simplified analysis of the good-bad algorithm for downward monotone functions.
1 Introduction
Consider the following problem, which we will refer to as LOWER CAPACITATED TREE PARTITIONING. Given an undirected graph with nonnegative edge costs for all , and a positive integer , the goal is to find a minimum-cost edge set such that each connected component of has at least vertices. If , the problem is min-cost edge cover, and if , it is minimum spanning tree; both of these problems are known to be polynomial-time solvable. However, for any other constant value of , LOWER CAPACITATED TREE PARTITIONING is known to be NP-hard: Imielińska et al. [IKK93] establish this for , while Bazgan et al. [BCT11] prove it for and, more generally, show that the problem is APX-hard for every constant .
Imielińska et al. [IKK93] give a 2-approximation algorithm for this problem through a natural adaptation of Kruskal's algorithm [Kru56]. As in Kruskal's algorithm, edges are considered in nondecreasing order of cost; however, an edge between two distinct components is selected only when at least one of the components has size less than k. The performance guarantee of the algorithm is tight. Other 2-approximation algorithms based on edge deletion (instead of, or in addition to, edge insertion) are given by Laszlo and Mukherjee [LM05; LM06], who also perform some experimental comparisons.
Goemans and Williamson [GW94] show that the algorithm of Imielińska et al. can be extended to obtain a 2-approximation algorithm for a broad class of graph problems characterized by a downward monotone function . Specifically, is downward monotone if implies for every nonempty subset . A set of edges is feasible for the problem defined by if for every nontrivial subset , where is the set of edges with exactly one endpoint in . For example, the LOWER CAPACITATED TREE PARTITIONING corresponds to the function where if and only if . For this larger class of problems, similar to before, the algorithm processes the edges in nondecreasing order of cost, and adds an edge whenever it connects two distinct components and such that or . The edge-deletion algorithm of Laszlo and Mukherjee [LM05; LM06] also provides a 2-approximation guarantee for these problems [LM08]. Goemans and Williamson [GW94] show that several graph problems can be modeled with downward monotone functions, including some location-design and location-routing problems; for example, they consider a problem in which every connected component
In fact, Goemans and Williamson [GW94] consider the more general setting of integer-valued downward monotone functions , whereas we restrict our attention to binary-valued functions.
not only must have at least vertices, but also must have an open depot from a subset , where there is a cost for opening the depot to serve the component.
Couëtoux [Cou11] gives a 3/2-approximation algorithm for LOWER CAPACITATED TREE PARTITIONING. In any partial solution constructed by the algorithm, let us call a connected component small if it has fewer than k vertices in it, and big otherwise. We call an edge good if it joins two small components into a big component, and bad otherwise. The algorithm behaves similarly to the Imielińska et al. algorithm in that it considers adding edges to the solution in nondecreasing order of cost. However, when it considers adding an edge e to the solution at cost , it also considers all good edges of cost . If such a good edge exists, it adds the cheapest one; otherwise, it adds the edge e. The intuition for the algorithm is that we want to try to decrease the number of small components of a partial solution until there is no small components left. A good edge decreases this number by two, whereas a bad edge decreases it by only one. It is therefore reasonable to pay up to twice as much for a good edge as for a bad edge. We will refer to this algorithm as the good-bad algorithm. Davis and Williamson [DW12] show that the natural extension of the good-bad algorithm to downward monotone functions, in which a component C is small if and big if also obtains a 3/2-approximation guarantee.
In this paper, we provide a simpler analysis of the good-bad algorithm based on a straightforward charging argument. Couëtoux's analysis relies on a more intricate charging scheme, whereas Davis and Williamson use a primal-dual framework that compares the algorithm's cost directly with the optimal solution rather than with the value of a dual solution. We believe that our analysis is considerably simpler than these previous approaches. Moreover, its clean structure allows us to derive tighter guarantees in certain cases.
In the next section, we give a formal presentation of the good-bad algorithm, and in Section 3, we show that it obtains a 3/2-approximation guarantee.
2.1 The Algorithm
For a partial solution , let us call a connected component of small if , and big if . For an edge , let denote the decrease in the number of small connected components resulting from adding to .
An edge is available with respect to , if , or equivalently, if its two endpoints belong to different connected components, at least one of which is small. An available edge is called good if , or equivalently, if it merges two small components into a big component. Otherwise, is called bad. A bad edge therefore either merges two small components into another small component or joins a small component and a big component, resulting in a big component. In either case, . Consequently,
The good-bad algorithm starts from , and iteratively adds available edges until no small connected components remain. At each iteration, given the current partial solution , the algorithm selects an available
Couëtoux et al. [CDW13] wrote a joint journal version of these results.
By the downward monotonicity of h, any set containing a big component must itself be big.
Algorithm 1: Good-Bad Algorithm
Input: Graph along with edge costs .
Output: A subset of edges such that every connected component of is big.
1
2 , the set of small components of .
3 while do
4
5 the set of small components of .
6 return
edge that minimizes the cost-to-benefit ratio . In other words, the algorithm selects the cheapest good edge whenever for every bad edge ; otherwise, it selects the cheapest available bad edge. Algorithm 1 is a formal description of this procedure.
We will denote the final output of good-bad algorithm by . Note that is feasible for our problem. To see this, consider any cut . If , then , since . Otherwise, , so is a union of connected components of . At termination, every connected component is big and therefore satisfies . Since , downward monotonicity implies that . Hence, . Thus, every cut requirement is satisfied, and is feasible.
3 Analysis of the Algorithm
Consider an optimal solution and let denote its connected components in an arbitrary order. Note that as , each connected component is a tree. For each component , let be an edge with maximum cost in , that is . Writing , we view as birooted at and , and denote the set of its roots by . Birooted components were also used by Davis and Williamson [DW12] in their analysis. For each vertex , we define its depth, denoted by depth( ), as its distance to the nearest root in . For every we use par( ) to denote its parent in birooted .
We next define a strict total order on . We first order vertices according to the index of the component to which they belong and then, within each component, according to their depth. Specifically, for vertices and , if , or if and depth() < depth(). Vertices belonging to the same component and having the same depth are ordered according to an arbitrary fixed tie-breaking rule.
For the analysis, we inductively maintain a unique representative for each small component of , while every other vertex has already been eliminated and assigned a price. Initially, each vertex with is designated as the representative of the singleton component . Each vertex with is eliminated and assigned price . Whenever the algorithm adds an edge to , we update the representatives and prices according to the following scheme.
-
If is a good edge; let and be the small components connects and and be their unique representatives, respectively. We eliminate both representatives and assign each a price of ; that is, . In this case, merging and produces a big component, which has no representative.
-
If is a bad edge connecting a small component with the unique representative and a big component with no representative; we eliminate and assign it a price of , that is, . Thus, the resulting big component has no representative.
-
If is a bad edge connecting two small components and with representatives and ; we eliminate the representative among that appears later in the order , and
Since the edge costs are nonnegative, we might have cycles including 0-cost edges, but such edges can be ignored w.l.o.g.
assign it a price of . The other vertex then will be the representative of the newly merged small component. For instance, if , we let , eliminate , and let be the representative of the new component.
Observe that, upon termination of the algorithm, as every connected component is big, every vertex has been eliminated and assigned a price. Furthermore, whenever an edge is added to the solution, a total price of is assigned to one or two representatives, which are then eliminated. Since an eliminated representative is never assigned another price, we will have at the end.
Lemma 1. At every iteration of the algorithm, the representative of each small connected component is the vertex satisfying for all .
Proof. The proof proceeds by a straightforward induction on the size of the partial solution.
Lemma 2. Suppose that v is eliminated and assigned a price during an iteration, and let F denote the partial solution immediately before that iteration. Then, for every edge available at that iteration, it holds that
Proof. In the iteration when is eliminated, Algorithm 1 selects an edge minimizing the cost-to-benefit ratio , meaning for every edge available at that iteration. From the charging scheme we have if is good, and , if is bad, meaning , and completing the proof.
Lemma 3. For every non-root vertex , the edge remains available until is eliminated in the charging scheme.
Proof. Note that, an edge remains available whenever its endpoints lie in distinct connected components and at least one of these components is small. Suppose that v is eliminated at iteration t. Thus, v is the unique representative of the component containing v throughout all iterations preceding t, and in particular, this component must always be small. Thus, it suffices to show that the two components containing v and par(v) do not merge prior to t.
Assume for the sake of contradiction that the components containing and merge at some iteration . Let and denote the components containing and , respectively, immediately before this merge, and let denote the resulting component.
As is eliminated later at iteration , and it remains to be the representative of its component until iteration , components and must be small. Since is small, is also small and therefore has a representative . By Lemma 1 it holds that . On the other hand, because and belong to the same and depth() < depth(), it holds that . By transitivity, we obtain . So, it follows from the charging scheme that would have been eliminated at iteration , contradicting the assumption that is eliminated at iteration .
Corollary 1. For every vertex , it holds that where .
Proof. By Lemma 3, is available right before elimination of , and therefore, by Lemma 2 we get .
Lemma 4. For every optimal tree and , it holds that where is the maximum-cost edge in .
Proof. Consider the iteration in which is eliminated, and let be the connected component containing before the elimination. Note that cannot contain all of . Indeed, since is big, downward monotonicity would imply that is also big, meaning all vertices of , including , would already be eliminated.
For non-root vertices , this can be directly concluded from Corollary 1, but the included proof works for both roots and non-root vertices.
Since , , and is connected, there exists an edge . As , the endpoints of belong to different connected components at the current iteration, one of which is . Because is small, must be available. By Lemma 2 and since is a maximum-cost edge, we get .
Lemma 5. For every optimal component with roots it holds that
where .
Proof. Fix an optimal component , and let denote its root set. Recall that is a maximum-cost edge of . Let and denote the sub-trees of containing and , respectively.
As is a maximum-cost edge, for every we have . Let be the first iteration at which either or is eliminated, and assume without loss of generality that is eliminated at iteration . Since every connected component has a unique non-eliminated vertex, its representative, and neither nor has been eliminated before iteration , the two vertices must belong to distinct small components immediately prior to iteration . Denote these components by and , respectively, and let be the partial solution of the algorithm right before iteration . We consider the following two cases:
- Case 1. There exists some edge or at the beginning of iteration . Endpoints of belong to different connected components at the current iteration, one of which is or , and as and are small, must be available. By Lemma 2 we know , and by Lemma 4 we have . Since , we have , implying
- Case 2. There does not exist any edge or . In this case, we must have , meaning is big by downward monotonicity. Thus, connects two small connected components and to form a big component, and therefore, it is a good edge. By Lemma 2, we know , and by Lemma 4 we have implying
Theorem 1. The good-bad algorithm achieves an approximation ratio of 3/2.
Proof. Summing the inequality , established in Corollary 1 over all non-root vertices of a component gives:
For the roots of the component, by Lemma 5, the assigned prices satisfy . Combining with Eq. (2) the total price assigned to all vertices in is bounded by
Summing this across all components , we get . Finally, recall that from the charging scheme we had , completing the proof.
Proposition 2. The good-bad algorithm achieves an approximation ratio of where .
Proof. In the proof of Lemma 5, fixing with the maximum-cost edge , we bound in two cases:
• Case 1. .
• Case 2. .
Both of these bounds are at most . Combining this new bound with Eq. (2) gives us
Summing the above inequality across all components results in an approximation ratio of .
Corollary 2. The good-bad algorithm achieves an approximation ratio of where .
Proof. It is directly implied from Theorem 1 and Proposition 2.
We note that by using Corollary 2, we can derive that for unweighted LOWER CAPACITATED TREE PARTITIONING, the good-bad algorithm has an approximation ratio of , since for each optimal component . Indeed, each edge has weight 1, and each component must have at least edges. However, Bagzan, Couëtoux, and Tuza [BCT11] have already observed that any spanning tree is a -approximation to the problem: any feasible solution will have at least connected components, so the optimal solution must have at least edges, so that for a spanning tree the approximation ratio is at most .
4 Conclusion
In this paper, we gave a simple alternative proof that the good-bad algorithm of Couëtoux [Cou11] achieves an approximation ratio of 3/2 for downward monotone functions. Many network-design problems admit relatively simple 2-approximation algorithms, but breaking the factor-2 barrier is often difficult, as in Steiner forest [AGH+25] and connectivity augmentation [TZ23]. For downward monotone functions, by contrast, both the algorithm and the analysis yielding the 3/2-approximation are simple. This raises the question of whether ideas from the good-bad algorithm or our charging analysis could lead to simpler algorithms with approximation guarantees below 2 for Steiner forest, connectivity augmentation, or related problems.
Acknowledgments
AI was used to improve the writing of parts of this paper. The authors assume responsibility for all content.
References
[AGH+25] Ali Ahmadi, Iman Gholami, MohammadTaghi Hajiaghayi, Peyman Jabbarzade, and Mohammad Mahdavi. "Breaking a Long-Standing Barrier: 2-ε Approximation for Steiner Forest". In: Proceedings of the 66th IEEE Annual Symposium on Foundations of Computer Science. 2025, pp. 373–444. DOI: 10.1109/FOCS63196.2025.00023. URL: https://doi.org/10.1109/FOCS63196.2025.00023.
[BCT11] Cristina Bazgan, Basile Couëtoux, and Zsolt Tuza. "Complexity and approximation of the Constrained Forest problem". In: Theoretical Computer Science 412 (2011), pp. 4081–4091.
[CDW13] Basile Couëtoux, James M. Davis, and David P. Williamson. "A 3/2-Approximation Algorithm for Some Minimum-Cost Graph Problems". In: Mathematical Programming B 150 (2013), pp. 19–34.
[Cou11] Basile Couëtoux. “A Approximation for a Constrained Forest Problem”. In: Algorithms – ESA 2011, 19th Annual European Symposium. Ed. by Camil Demetrescu and Magnús M. Halldórsson. Lecture Notes in Computer Science 6942. Springer, 2011, pp. 652–663.
[DW12] James M. Davis and David P. Williamson. “A Dual-Fitting -Approximation Algorithm for Some Minimum-Cost Graph Problems”. In: Algorithms – ESA 2012, 20th Annual European Symposium. Ed. by Leah Epstein and Paolo Ferragina. Lecture Notes in Computer Science 7501. Springer, 2012, pp. 373–382.
[GW94] Michel X. Goemans and David P. Williamson. “Approximating minimum-cost graph problems with spanning tree edges”. In: Operations Research Letters 16 (1994), pp. 183–189.
[IKK93] Celina Imielińska, Bahman Kalantari, and Leonid Khachiyan. “A greedy heuristic for a minimum-weight forest problem”. In: Operations Research Letters 14 (1993), pp. 65–71.
[Kru56] J.B. Kruskal. “On the shortest spanning subtree of a graph and the traveling salesman problem”. In: Proceedings of the American Mathematical Society 7 (1956), pp. 48–50.
[LM05] Michael Laszlo and Sumitra Mukherjee. “Another greedy heuristic for the constrained forest problem”. In: Operations Research Letters 33 (2005), pp. 629–633.
[LM06] Michael Laszlo and Sumitra Mukherjee. “A class of heuristics for the constrained forest problem”. In: Discrete Applied Mathematics 154 (2006), pp. 6–14.
[LM08] Michael Laszlo and Sumitra Mukherjee. “An approximation algorithm for network design problems with downwards-monotone demand functions”. In: Optimization Letters 2 (2008), pp. 171–175.
[TZ23] Vera Traub and Rico Zenklusen. “A -Approximation Algorithm for Weighted Connectivity Augmentation”. In: Proceedings of the 55th Annual ACM Symposium on Theory of Computing. 2023, pp. 1820–1833. DOI: 10.1145/3564246.3585122. URL: https://doi.org/10.1145/3564246.3585122.