Submitted:
22 September 2026
Posted:
23 September 2026
Read the latest preprint version here
Abstract
The Minimum Vertex Cover problem is NP-hard. Its classical polynomial-time approximation ratio is 2, and Khot and Regev showed that, assuming the Unique Games Conjecture (UGC), no polynomial-time algorithm can achieve a factor \(2-\varepsilon\) for any fixed \(\varepsilon>0\). We present FindVertexCover, a linear-time ensemble algorithm that runs seven independently valid vertex-cover heuristics on the input graph \(G=(V,E)\) and returns the smallest cover found, then prunes redundant vertices. Four of the seven candidates—and the final redundant-vertex pruning pass applied to each of them—adapt a published ensemble that proves an unconditional \(O(n+m)\) time and space bound and a worst-case approximation ratio at most 2 for every graph, where \(n=|V|\) and \(m=|E|\). \textsc{Salvador} extends that ensemble with two further linear-time candidates of its own and a sixth candidate, SolveVC, that reduces \(G\) to a linear-size planar forest core via a weighted Minimum Independent Dominating Set (MIDS) gadget and solves that gadget with an accuracy-controlled Baker-style PTAS whose layering width is \(k=\lceil 1/\varepsilon\rceil\); non-core edges are covered by a greedy repair step. At the package default \(\varepsilon=1\), the Baker layering width is \(k=1\) and the PTAS pass degenerates to its linear-time greedy baseline, so every one of the seven candidates—and hence the ensemble as a whole—runs in worst-case \(O(n+m)\) time; because one candidate is the classical maximal-matching heuristic, the ensemble unconditionally achieves approximation ratio at most 2 on every graph, a theorem rather than a conjecture. We conjecture a universal ratio bound \(R^\star<2\) for the default call; on a reproducible suite of 1,746 test graphs, ranging from exhaustively enumerated small graphs to random and adversarial graphs with up to 200,000 vertices, the observed ratio never exceeds $1.61$, well below the classical \(7/4\) mark. If a bound below 2 were proved for the ensemble, then, under the standard assumption \(\mathrm{P}\neq\mathrm{NP}\), the Khot–Regev UGC-based hardness theorem for Vertex Cover would force the Unique Games Conjecture to be false. An open-source implementation is released as the Salvador package (v0.0.7).
Keywords:
vertex cover
; approximation algorithm
; ensemble heuristics
; planar graphs
; baker-style decomposition
; unique games conjecture
MSC: 05C69; 05C70; 68Q25; 90C27
1. Introduction
The Minimum Vertex Cover (VC) problem is one of the twenty-one NP-complete problems identified by Karp [1]. Given an undirected graph , a set is a vertex cover if every edge of E has at least one endpoint in C; the goal is to find a minimum-cardinality vertex cover, denoted . Vertex cover is central to computer science, modelling guard placement, network monitoring, error-correcting codes, and serving as the canonical starting point for parameterised and approximation algorithms.
The approximation landscape for VC is unusually well charted. The classical maximal-matching algorithm achieves a 2-approximation in linear time [2]; LP-based refinements by Karakostas [3] and Karpinski and Zelikovsky [4] reach factor , which is but falls short of a constant . From the hardness side, Dinur and Safra [5] ruled out any ratio below under , and under the Unique Games Conjecture [6], Khot and Regev [7] showed that no polynomial-time algorithm can approximate Minimum Vertex Cover within factor for any fixed . Thus a proved constant sub-2 approximation ratio for a polynomial-time algorithm would have direct consequences for the Unique Games Conjecture, conditional on the standard belief that .
Against this backdrop, we present an algorithm—implemented as the Salvador Python package (v0.0.7)—that, on every instance we have tested under the default call , produces a vertex cover whose size is provably never more than twice the optimum and, empirically, far closer to it. The algorithm, called FindVertexCover, is an ensemble: it runs seven independently valid vertex-cover heuristics and returns the smallest cover among them, then a final pruning pass removes any remaining redundant vertices. Four of the seven candidates and the pruning pass adapt the ensemble published as the Hvala algorithm [8,9], which proves an unconditional time and space bound and worst-case approximation ratio at most 2; Salvador adds two further linear-time candidates of its own together with a sixth candidate, SolveVC, described below. The algorithm operates in three phases.
- 1.
- Preprocessing. Self-loops are discarded; isolated vertices are removed (they appear in no edge and need not be covered).
- 2.
- Ensemble of linear-time candidates. Six independent heuristics are run on the cleaned graph G: maximal matching, bucket-queue maximum-degree greedy, and a degree-1 weighted-reduction ("Hallelujah") heuristic (all three adapted from Hvala [8]); a Min-to-Min bucket heuristic and a primal-dual/local-ratio 2-approximation (both Salvador-specific); and SolveVC, which reduces G to a weighted MIDS instance on a planar forest-core gadget H and solves H with an accuracy-controlled Baker-style PTAS [10] of layering width , repairing non-core edges greedily. At the default , and the PTAS pass degenerates to its linear-time greedy baseline.
- 3.
- Linear-time pruning.PruneRedundantVertices (Hvala’s fourth strategy) makes a single forward pass over each candidate cover C and removes every vertex all of whose neighbours are already covered; it is applied to every one of the six candidates and to their union, and the smallest resulting cover is returned.
At the default every one of the seven candidates runs in worst-case time, where and , so the whole ensemble is : strictly linear, not merely near-linear. This holds in particular for the Min-to-Min heuristic, whose bucket-queue argument (Section 3) pops and processes one minimum-degree vertex per step, so its cover target is selected in time without rescanning a bucket.
Contributions
The main contributions of this paper are:
- A linear-time ensemble vertex-cover algorithm, four of whose seven candidates adapt the published Hvala ensemble [8], extended with a Min-to-Min heuristic, a primal-dual 2-approximation, and a planar forest-core reduction to a weighted MIDS gadget solved by an accuracy-controlled Baker-style PTAS. At the default every candidate—and hence the ensemble—runs in worst-case time.
- An unconditional (not merely conjectured) worst-case approximation ratio of at most 2 for the ensemble on every graph, inherited directly from the classical maximal-matching candidate together with the fact that taking the minimum over valid covers, then pruning, cannot increase cover size.
- An empirical conjecture (Conjecture 1) that the universal approximation ratio under the default call is well below the unconditional bound of 2, supported by a reproducible suite of test graphs (Section 7) on which the observed or bounded ratio never exceeds .
- A conditional UGC consequence: under , any proof of a universal ratio below 2 for this polynomial-time ensemble would refute the Unique Games Conjecture via the Khot–Regev hardness theorem.
- An open-source implementation, Salvador v0.0.7, in which the accuracy parameter still drives the Baker PTAS candidate but no longer the whole algorithm’s linear-time guarantee.
The paper is organised as follows. Section 3 describes the algorithm and provides pseudocode. Section 4 proves correctness. Section 5 analyses the approximation ratio and discusses consequences for the Unique Games Conjecture. Section 6 establishes the time complexity. Section 7 reports empirical results on a reproducible test suite. Section 8 concludes.
2. Research Data
The algorithm is implemented in the Python package Salvador, freely available on the Python Package Index [11]. The current version is v0.0.7; the accuracy parameter drives only the Baker-PTAS candidate’s layering (Remark 2), not the ensemble’s linear-time guarantee, which holds at the default regardless. Code metadata is summarised in Table 1, and the local reduction gadget of the SolveVC candidate is depicted in Figure 1.
3. Description of the Algorithm
Salvador’s entry point, FindVertexCover (Algorithm 1), is an ensemble: it computes six independently valid candidate covers by six different linear-time heuristics, prunes each with PruneRedundantVertices, additionally prunes their union to form a seventh candidate , and returns the smallest of the seven. Four of the six candidate heuristics—maximal matching (), bucket-queue maximum-degree greedy (), the degree-1 weighted-reduction heuristic (), and the pruning pass itself—adapt the ensemble published as the Hvala algorithm [8,9], which proves these run in time and space and that the best of them alone already achieves worst-case approximation ratio at most 2. Salvador adds two further linear-time candidates, the Min-to-Min heuristic () and a primal-dual/local-ratio 2-approximation (), and a sixth candidate () produced by SolveVC, the planar forest-core reduction to a weighted MIDS gadget described below. We present pseudocode for the main ensemble, each of the six candidates, and the pruning pass.
3.1. Main Ensemble
| Algorithm 1 FindVertexCover |
|
3.2. The Hvala-Adapted Candidates
Candidates , , and , and the pruning pass shared by all seven candidates, adapt the ensemble of Vega’s Hvala algorithm [8], which proves an unconditional time and space bound and worst-case approximation ratio at most 2 for every graph. MAXIMALMATCHINGCOVER (Hvala strategy 1) computes a maximal matching in time and returns both endpoints of every matched edge; this is the classical linear-time 2-approximation [2]. BUCKETDEGREEGREEDY (Hvala strategy 2, given as Algorithm 2) repeatedly removes a maximum-degree active vertex using a bucket queue indexed by degree, in amortized time; its worst-case approximation ratio is by Johnson’s classical bound [2], where is the maximum degree. REDUCTIONMAXDEGREEONE (Hvala strategy 3, the "Hallelujah heuristic") subdivides every edge into an auxiliary degree-1 instance, solves it exactly (a degree-1/star instance has a trivial optimum), and maps the solution back to G; because the auxiliary instance has vertices and edges, this runs in time.
| Algorithm 2 BucketDegreeGreedy — Hvala strategy 2 |
|
3.3. The Salvador-Specific Candidates
LINEARWEIGHTEDCOVER () is a single pass implementing the primal-dual/local-ratio method [12]: it scans every edge once, raises a dual variable at each endpoint up to the remaining slack, and adds an endpoint to the cover whenever its budget saturates; this is a standard 2-approximation.
MINTOMINCOVER (), given as Algorithm 3, repeatedly pops a single currently-minimum-degree active vertex v from a bucket queue and adds an arbitrary current neighbor of v to the cover, then updates degree buckets exactly as in Algorithm 2.
Remark 1.
(Why the bucket-queue argument stays linear). Algorithm 3 pops and processes exactly one minimum-degree vertex per outer-loop iteration and selects its covering neighbor in (an arbitrary, not degree-minimal, neighbor), with no rescan of a bucket at any step. Consequently the total number of bucket pushes and pops is by the same amortized argument as Algorithm 2 (Theorem 5), and the time per processed vertex stays within a constant factor regardless of graph regularity.
| Algorithm 3 MinToMinCover — linear-time-corrected |
|
3.4. Weighted MIDS Gadget and Planar Solve
Algorithm 4 () implements the reduction from Vertex Cover to weighted Minimum Independent Dominating Set on a planar core, invokes the -controlled Baker PTAS pass, and repairs non-core edges in one scan.
| Algorithm 4 SolveVC |
|
The pass BakerPtasWeightedIDS (Algorithm 5) is the accuracy-controlled weighted-IDS solver invoked by Salvador. It layers the gadget by BFS distance, removes each residue class modulo in turn, solves the remaining components exactly by tree-decomposition dynamic programming, greedily repairs the removed slab, and keeps the lightest independent dominating set found over the k shifts; the greedy maximal independent set of Algorithm 6 is the baseline and a safe fallback. Because the gadget H built from a forest core is itself a forest (Section 3), each component is a tree and the per-component solve ExactWeightedIDS is an exact linear-time tree dynamic program; which shifts the PTAS explores, however, depends on , so the decoded cover is parameter-sensitive and need not be monotone in .
Remark 2.
(On the accuracy parameter ). The public entry pointfind_vertex_coverfixes the default , which is the configuration analysed throughout this paper. The parameter controls only candidate ’s Baker layering width ; at the default , and reduces to the greedy maximal-independent-set baseline of Algorithm 6, which is what keeps —and hence the whole ensemble—strictly (Theorem 5). The gadget construction is itself ε-independent; ε enters only the IDS pass. Passing makes only more thorough (and costs an extra factor); it is intended for offline quality experiments on in isolation, not the default production call. ’s returned candidate depends on ε through the layer choices, and on the vertex ordering through the spanning-forest construction; the ensemble as a whole is comparatively insensitive to both, since provide independent coverage (Section 5.7). All claims below refer to the default call unless otherwise noted.
| Algorithm 5 BakerPtasWeightedIDS |
|
| Algorithm 6 GreedyWeightedMIS — baseline |
|
Figure 1 shows the local gadget introduced for each core edge in Algorithm 4. The nodes and are the weight-one cover-choice nodes, and are zero-weight pendant nodes, and the hub has penalty weight .
As illustrated in Figure 1, the gadget H is always planar because is a forest and H is a subdivision of augmented with pendant leaves ; subdivisions of planar graphs are planar, and appending pendant leaves preserves planarity. The hub weight enforces coverage inside the core: in any optimal MIDS for H, including a hub is more expensive than selecting all vertex nodes. The SpanningForestCore routine builds by Union-Find in one pass over E and records each cycle-closing edge in for the final repair scan.
3.5. Linear-Time Pruning
Algorithm 7 removes redundant vertices from a candidate cover in a single forward pass, running in total time.
| Algorithm 7 PruneRedundantVertices |
|
4. Correctness of the Algorithm
Theorem 1.
Algorithm 1 always returns a valid vertex cover of the input graph G.
Proof.
We must show that every edge has at least one endpoint in the output C. Isolated vertices are removed in preprocessing and appear in no edge, so they need not be covered. It suffices to show (a) each of is individually a valid vertex cover of the cleaned graph, (b) pruning a valid cover with Algorithm 7 leaves it valid, and (c) the union of valid covers is a valid cover, since the output is then over the sizes of seven vertex sets each shown valid by (a)–(c), and validity does not depend on which has minimum size.
(a) Each raw candidate is valid. takes both endpoints of every matched edge of a maximal matching M; every edge either belongs to M (both endpoints in ) or is not in M, in which case maximality of M forces at least one endpoint to already be matched by some edge of M (otherwise that edge could extend M), hence in . (Algorithm 2) processes vertices from highest to lowest current degree and never terminates while an active vertex has positive degree, so every edge is incident to some vertex added to before both endpoints could reach degree 0 un-covered. solves the exact degree-0/degree-1 auxiliary instance built from every original edge, so every original edge is represented by an auxiliary edge that is covered by construction. (Algorithm 3) adds, for every vertex v ever popped as the current minimum-degree active vertex, one of its active neighbors to the cover, which by the same maximal-matching-style argument as covers every edge incident to a processed vertex, and the loop runs until no active vertex remains. ’s primal-dual scan adds an endpoint of every edge whose slack is exhausted on both sides, which the local-ratio argument [12] guarantees for every edge. is shown valid below.
validity (core path). The Baker PTAS pass returns a feasible IDS S of the gadget H. The variable edge guarantees that at least one of is dominated for every . The repair loop then adds one endpoint of every core edge not yet covered by the decoded set , ensuring all core edges are covered.
validity (core and repair path). Let be the spanning-forest core, with and . The weighted MIDS pass and residual repair produce a cover valid for . Every edge in is inspected in the repair loop: if neither endpoint is in the running cover, the higher-degree endpoint is added. After the loop every edge of E has at least one endpoint in .
(b) Pruning preserves validity. A vertex is removed by Algorithm 7 only when every neighbour of v lies in C. In that case every edge incident to v is already covered by the neighbour side, so removing v leaves every edge covered.
(c) Unions of valid covers are valid. If and each cover every edge, then for every edge at least one of lies in (or in ), so covers as well; hence ’s starting union is valid before it, too, is pruned by (b). □
5. Approximation Ratio and Consequences for the Unique Games Conjecture
5.1. Structural Setup and Notation
Let be the input graph with and . Write for the size of a minimum vertex cover of G and let . Let be the spanning-forest core built by candidate (SolveVC), let H be its weighted MIDS gadget of Algorithm 4, and set .
5.2. An Unconditional Ratio-2 Guarantee for the Ensemble
Unlike the case-by-case bounds on the individual candidates below, the ensemble as a whole admits an immediate, unconditional worst-case guarantee.
Theorem 2.
(Unconditional ratio 2). For every undirected graph G, Algorithm 1 returns a vertex cover C with .
Proof.
Candidate takes both endpoints of every edge of a maximal matching M of G, so . Because M is a matching, any vertex cover must contain at least one endpoint of each of its disjoint edges, so , giving ; this is the classical linear-time 2-approximation [2], and it is exactly the bound Hvala proves for its own ensemble [8]. Algorithm 1 prunes (Theorem 1 shows pruning preserves validity and cannot increase size) and then returns the smallest of seven valid covers including the pruned , so . □
Theorem 2 holds unconditionally, for every and every graph; it does not depend on the planar forest-core machinery below at all. The role of the remaining candidates—and of the structural analysis in this section—is to explain why the ensemble is expected to do far better than this worst-case guarantee in practice (Section 5.7).
5.3. Gadget Cost Identity for the SolveVC Candidate
Lemma 1
(Cost identity). For any planar graph G with n vertices and gadget hub penalty , the minimum weighted MIDS cost of H equals : .
Proof.
Lower bound (). Let S be any feasible MIDS of H. For each hub , both and must be in S, so the edge is covered by . Any hub contributes weight , so any solution containing a hub has cost exceeding . Hence the minimum-cost MIDS contains no hub and is a valid vertex cover of G with .
Upper bound (). Let be an optimal vertex cover with . Define . Every hub has at least one of in because covers ; every variable-edge node is dominated by its companion. Thus is a valid MIDS of H with , giving . □
In Algorithm 4 the gadget is built from the spanning-forest core , so Lemma 1 applies with the core in the role of G, yielding . Because H is a forest, the per-component tree dynamic program is exact; the Baker PTAS, however, only explores the layer shifts, so at a fixed the decoded set is a near-minimum—not necessarily minimum—cover of the core. The total approximation loss is this layering slack plus the greedy repair of the non-core edges .
5.4. Elementary Bounds on the SolveVC Candidate
The next two results are stated for in isolation (they are properties of the candidate SolveVC produces before the ensemble compares it against ); they are superseded, as guarantees on the algorithm’s output, by Theorem 2, but they explain why is a useful candidate to include rather than redundant with –.
Proposition 1
(Elementary bounds on ). For every graph G with n vertices and m edges, the candidate cover produced by Algorithm 4 satisfies and is a valid vertex cover of G.
Proof.
Validity is Theorem 1 restricted to the path. The decoded core cover has size at most , each repair step adds at most one vertex and is triggered at most once per edge, so and ; pruning only removes vertices. □
5.5. Linear Core Guarantee for SolveVC
Theorem 3.
(Core cover guarantee). For any input graph G, Algorithm 4 covers every edge of the spanning-forest core before the final repair scan and covers every edge of G after the repair scan.
Proof.
The MIDS pass produces an independent dominating set of H. Decoding selects each v whose node appears in this set. If a core edge is not covered by the decoded set, the residual core-repair loop adds one endpoint, so all edges of are covered. The final repair loop scans and adds one endpoint for every still-uncovered edge, so every original edge is covered. □
5.6. Non-Planar Case
Lemma 2
(Subgraph optimality). .
Proof.
Any vertex cover of G is also a vertex cover of . □
Proposition 2
(Repair bound). For any input G, the path of Algorithm 4 adds at most one repair vertex per edge in after the core solve.
Proof.
The repair loop visits each edge in once. It does nothing when an endpoint is already in the candidate cover and otherwise adds exactly one endpoint. Thus the number of repair additions is at most . □
In practice the repair adds far fewer vertices than Proposition 2 suggests, because most removed edges are already covered by the near-optimal core solution on ; and even where overshoots, the ensemble as a whole is protected by Theorem 2 and by the other six candidates.
5.7. The Empirical Conjecture for the Ensemble
Because the seven candidates draw on structurally different techniques—maximal matching, degree-greedy, degree-1 reduction, Min-to-Min, primal-dual, and the planar forest-core MIDS reduction—and the ensemble takes the smallest of all seven after pruning, we expect the ensemble’s worst case to sit strictly below the unconditional bound of Theorem 2, which is attained only when every one of the seven candidates simultaneously realises its own worst case on the same instance.
Conjecture 1
(Universal ensemble approximation ratio). There is a constant such that, for every undirected graph G, Algorithm 1 with the default parameter returns a vertex cover C with
Conjecture 1 is not a theorem; Theorem 2 is the only unconditional bound proved in this paper. Section 7 reports empirical support for the conjecture: on a reproducible suite of test graphs, the observed or bounded ratio never exceeds .
5.8. Why the Ratio Stays Low Across Graph Classes
The ensemble’s low observed ratio rests on running several structurally different heuristics and taking the best. Four candidates are the Hvala ensemble (Section 3.2), whose worst case is for but 2 for alone; two are Salvador-specific 2-approximations (, ); and additionally exploits planar/forest structure via the weighted MIDS gadget (Section 5.2 onward). Because the gadget H built from the forest core is itself a forest, its per-component tree dynamic program is exact, so on graphs close to forests alone is already near-optimal (Lemma 1); on graphs where ’s non-core repair overshoots, one of typically does not, and the final redundancy-pruning pass removes any vertex all of whose incident edges are already covered from every candidate.
Classes Solved Optimally by Alone.
On stars the core is the whole star, whose minimum cover is the centre alone; the decode returns it. On a matching the core is the matching itself and the decode returns one endpoint per edge. Forests and trees (paths, caterpillars, spiders, brooms) and cycles are solved exactly because the gadget reproduces the tree optimum, and the ensemble inherits this exactly.
Dense and Degree-Heterogeneous Classes.
Complete graphs have ; the spanning-tree core is solved and the dense non-core edges are absorbed, returning the optimal -cover, and (maximal matching) independently gets within a factor 2. Wheels, barbell and lollipop graphs concentrate their optima on hub or clique vertices, captured by either (max-degree greedy) or the core.
Bipartite and Planar Classes.
For bipartite graphs Konig’s theorem makes equal to the maximum matching; on this class each provide independent coverage, so the ensemble does not depend solely on ’s core solve. Grids and other bounded-treewidth planar families remain mild for alone, since the forest core captures of the at most edges and only non-core edges reach the repair.
Large Adversarial Graphs.
Complete bipartite graphs, crown graphs ( minus a perfect matching), double stars joined by a bridge, a hierarchical greedy-tie-break stress construction, random regular graphs, Barabasi–Albert scale-free graphs, sparse Erdos–Renyi graphs, and Watts–Strogatz small-world graphs are designed to stress individual candidates (dense structure, high or irregular degree, small-world shortcuts); the ensemble’s minimum-over-seven-candidates guarantee (Theorem 2) still applies unconditionally to every one of them.
5.9. Conditional Consequence for the Unique Games Conjecture
Theorem 4.
(UGC consequence of a universal sub-2 bound). If Conjecture 1 were proved for some constant , then Algorithm 1 would be a polynomial-time -approximation for Minimum Vertex Cover. Consequently, under the standard assumption , the Unique Games Conjecture would be false.
Proof.
The runtime theorem (Theorem 5) gives worst-case time for the default fixed , in particular polynomial time. A proof of Conjecture 1 would therefore give a polynomial-time approximation ratio with . Khot and Regev [7], assuming the Unique Games Conjecture [6], showed that Vertex Cover is hard to approximate within factor for every fixed . Therefore, if , the simultaneous truth of UGC and Conjecture 1 would be impossible. Hence a proof of Conjecture 1 would refute UGC under . □
Remark 3.
Theorem 4 is conditional and, unlike Theorem 2, not unconditionally established here: Theorem 2 proves exactly, which is the UGC threshold itself and yields no contradiction (). Conjecture 1 neither disproves UGC nor proves an approximation theorem on its own; establishing it for some concrete , by whatever means, is what would trigger Theorem 4’s consequence. The empirical results of Section 7, while consistent with Conjecture 1, are evidence, not a proof, and do not by themselves establish any bound.
6. Runtime Analysis
Theorem 5.
For the default accuracy , Algorithm 1 runs in worst-case time , where and . For a fixed in general, candidate alone costs , where α is the inverse Ackermann function, so the whole ensemble costs for general ε and strictly at the default .
Proof.
We bound each of the seven candidates and the shared preprocessing and pruning; the ensemble cost is the sum of a constant number of -or-better terms.
Preprocessing. Removing self-loops and isolated vertices is one scan of the edge list and one scan of the vertex list, costing .
, maximal matching. A greedy maximal matching is computed in one scan of the edge list, [2].
, bucket-queue max-degree greedy (Algorithm 2). Standard bucket-queue argument: every push corresponds to an initial vertex or a degree decrement, and there are at most decrements in total, so there are pushes and pops, each ; total .
, degree-1 weighted reduction. The auxiliary star-like instance has vertices and edges (one auxiliary vertex per original edge occurrence), and the degree-0/degree-1 solver visits each auxiliary vertex once, total (the reduction is run twice, unweighted and weighted, a constant factor).
, Min-to-Min (Algorithm 3). By the same bucket-queue argument as : total pushes are n initial pushes plus at most degree-decrement pushes plus, for each real (non-stale) pop of a vertex v, at most one requeue of v itself (its degree strictly decreases by 1 whenever it is processed, since its chosen neighbor is removed), giving pushes and pops overall; each pop does work (a stale check, or an arbitrary-neighbor selection followed by the standard -amortized degree-bucket update). Total (see also Remark 1).
, primal-dual weighted cover. One pass over the edge list with work per edge, .
,SolveVC(Algorithm 4).SpanningForestCore initialises the disjoint-set forest in and performs mUnion/Find pairs, one per edge; with union by rank and path halving this costs in the worst case, tight for path-compression heuristics [13]. For a forest core with edges, the gadget H has vertices and edges, so H is built in ; crucially H is itself a forest, hence of treewidth 1. BakerPtasWeightedIDS uses shifts; each shift removes one BFS residue class, splits the rest into components, and solves each by the tree dynamic program ExactWeightedIDS, which runs in time linear in component size since H is a forest, so one shift costs , and the pass costs over k shifts. At the default , and BakerPtasWeightedIDS returns the greedy baseline GreedyWeightedMIS directly (Algorithm 5, line 2), skipping the layering loop entirely, so this phase is rather than . The repair loops inspect each edge of and of once with degree look-ups, . Total for : at , and for general .
Pruning.PruneRedundantVertices (Algorithm 7) builds the adjacency map in and makes one pass of total work ; it is applied to each of and once more to their union, a constant number (7) of passes.
Summing over a constant number (7) of candidates plus preprocessing and pruning, every term is except ’s union-find pass, which contributes the extra factor common to all disjoint-set algorithms with path compression. Since for all n of practical relevance (indeed for all n up to far beyond the number of atoms in the observable universe), the ensemble is for every fixed in the sense that matters computationally, and strictly (no factor at all) at the default , since the layering loop is skipped. □
Remark 4.
Because the gadget H built by is a forest, the minimum-weight independent dominating set of H can in fact be computed exactly in time by a single tree dynamic program, making the Baker layering unnecessary in principle; the layered PTAS is retained because the implementation reuses the general bounded-treewidth solver, and at the default it is bypassed anyway (Algorithm 5, line 2). The union-find factor in can likewise be removed by building the spanning-forest core with a depth-first traversal, yielding a strictly candidate (matching –) if desired. The scaling study of Section 7 empirically confirms this near-linear growth, fitting wall-clock time against with on two doubling-size graph families.
7. Reproducible Experiment
To assess the empirical conjecture of Section 5.7 (Conjecture 1), we ran the Salvador package (v0.0.7, default ) on a reproducible two-part suite of test graphs, under Python 3.12.3 and NetworkX 3.6.1 with a fixed random seed (20260627). The suite and its driver script are distributed with the package.
7.1. Part A: Small Graphs with a Known Optimum
Part A collects small graphs for which is known exactly, either via Konig’s theorem on bipartite instances or by exact branch-and-bound search otherwise: graphs of order at most 7 drawn exhaustively from the graph atlas, bipartite hill-climbing and obstruction instances, bipartite and non-bipartite grids, random bipartite and general graphs, and relabeling/vertex-order stress instances. Table 2 reports, for every family, the ratio of the returned cover to the exact optimum.
7.2. Part B: Large and Adversarial Graphs
Exact optima are infeasible to compute at the scale of Part B, so we instead certify a provable upper bound on the approximation ratio: for each instance we compute a maximal-matching lower bound (Theorem 2’s proof) and report , a conservative upper bound on that is exact on the bipartite families, where by Konig’s theorem. Table 3 reports, for ten families of large and adversarial graphs (complete bipartite graphs, crown graphs, double stars joined by a bridge, a hierarchical greedy-tie-break stress construction, random 3-, 6-, and 12-regular graphs, Barabasi–Albert scale-free graphs, sparse Erdos–Renyi graphs, and Watts–Strogatz small-world graphs), the largest instance size reached, the resulting ratio upper bound, and the wall-clock time.
Across the 28 Part B instances the ratio upper bound never exceeds , attained on a random 12-regular graph at vertices and edges; since this bound is computed from a maximal-matching lower bound on a non-bipartite family, the true ratio may be smaller still. Combined with Part A, the observed or bounded ratio across all test graphs never exceeds , well below the classical mark and substantially below the unconditional worst-case bound of 2 (Theorem 2).
7.3. Scaling Study
To check the runtime bound of Theorem 5 empirically, we ran the ensemble on two families of doubling size—4-regular graphs and Barabasi–Albert graphs with attachment parameter 3—from up to , and fit wall-clock time against by ordinary least squares. The fit is close to linear: for the 4-regular family and for the Barabasi–Albert family, consistent with the linear-time bound of Theorem 5.
8. Conclusion
We have presented the Salvador algorithm, an ensemble approximate solver for the Minimum Vertex Cover problem that runs seven independently valid linear-time heuristics and returns the smallest cover found, then prunes redundant vertices. Four of the seven candidates and the pruning pass adapt the published Hvala ensemble [8]; Salvador adds a Min-to-Min heuristic, a primal-dual 2-approximation, and a planar forest-core reduction to a weighted MIDS gadget solved by an accuracy-controlled Baker-style PTAS. The algorithm always returns a valid vertex cover (Theorem 1), unconditionally achieves approximation ratio at most 2 on every graph (Theorem 2), and runs in worst-case time at the default (Theorem 5)—strictly linear, not merely near-linear, because the Baker layering degenerates to its greedy baseline at and because every candidate, including the Min-to-Min heuristic (Remark 1), admits an amortized bucket-queue argument.
We conjecture (Conjecture 1) a universal ratio bound for the ensemble under the default call, strictly below the unconditional bound of Theorem 2. On a reproducible suite of test graphs (Section 7), spanning exhaustively enumerated small graphs with known optima and large adversarial graphs up to vertices, the observed or bounded ratio never exceeds , well under the classical mark, lending empirical support to the conjecture. The theoretical consequence of this conjecture is UGC-focused rather than a direct complexity-class equality claim: if Conjecture 1 were proved for some , then Salvador would be a polynomial-time -approximation, and by the Khot–Regev UGC-based hardness theorem for Vertex Cover [7], such a proof would refute the Unique Games Conjecture under the standard assumption .
Future work includes: (i) establishing or refuting Conjecture 1, whether by a tighter structural analysis of which candidate wins on which graph class or by a large-scale computational search for adversarial instances; (ii) isolating adversarial graph families that push the ensemble ratio closest to the unconditional ceiling of 2 from Theorem 2; (iii) a tight worst-case-complexity proof for the Min-to-Min candidate (Remark 1) beyond the bucket-queue argument given here; and (iv) extending the weighted MIDS framework and the ensemble methodology to dominating set, independent set, and set cover. The implementation is freely available as the Salvador package (v0.0.7) on PyPI [11].
References
- Karp, R.M. Reducibility Among Combinatorial Problems. In 50 Years of Integer Programming 1958–2008: From the Early Years to the State-of-the-Art; Springer: Berlin, Germany, 2010; pp. 219–241. [Google Scholar] [CrossRef]
- Papadimitriou, C.H.; Steiglitz, K. Combinatorial Optimization: Algorithms and Complexity; Courier Corporation: North Chelmsford (MA), 1998. [Google Scholar]
- Karakostas, G. A Better Approximation Ratio for the Vertex Cover Problem. ACM Trans. Algorithms 2009, 5, 1–8. [Google Scholar] [CrossRef]
- Karpinski, M.; Zelikovsky, A. Approximating Dense Cases of Covering Problems. In Proceedings of the DIMACS Series in Discrete Mathematics and Theoretical Computer Science, Providence, Rhode Island, 1996; Vol. 26, pp. 147–164. [Google Scholar]
- Dinur, I.; Safra, S. On the Hardness of Approximating Minimum Vertex Cover. Ann. Math. 2005, 162, 439–485. [Google Scholar] [CrossRef]
- Khot, S. On the Power of Unique 2-Prover 1-Round Games. In Proceedings of the Proceedings of the 34th Annual ACM Symposium on Theory of Computing, Montreal, Québec, Canada, 2002; pp. 767–775. [Google Scholar] [CrossRef]
- Khot, S.; Regev, O. Vertex Cover Might Be Hard to Approximate to Within 2-ϵ. J. Comput. Syst. Sci. 2008, 74, 335–349. [Google Scholar] [CrossRef]
- Vega, F. An Approximate Solution to the Minimum Vertex Cover Problem: The Hvala Algorithm. Gauge Freedom J. 2026, 1. [Google Scholar] [CrossRef]
- Vega, F. Hvala: Approximate Vertex Cover Solver. 2026. Available online: https://pypi.org/project/hvala.
- Baker, B.S. Approximation algorithms for NP-complete problems on planar graphs. J. ACM 1994, 41, 153–180. [Google Scholar] [CrossRef]
- Vega, F. Salvador: Approximate Vertex Cover Solver. 2026. Available online: https://pypi.org/project/salvador.
- Bar-Yehuda, R.; Even, S. A local-ratio theorem for approximating the weighted vertex cover problem. In Analysis and Design of Algorithms for Combinatorial Problems;Annals of Discrete Mathematics; Elsevier, 1985; Vol. 25, pp. 27–46. Available online: http://www.cs.technion.ac.il/~reuven/PDF/vc_lr.pdf.
- Tarjan, R.E. Efficiency of a good but not linear set union algorithm. J. ACM 1975, 22, 215–225. [Google Scholar] [CrossRef]
Figure 1.
Local weighted-MIDS gadget for a core edge . Selecting or corresponds to paying for a vertex-cover endpoint, while selecting the heavy hub incurs penalty .
Figure 1.
Local weighted-MIDS gadget for a core edge . Selecting or corresponds to paying for a vertex-cover endpoint, while selecting the heavy hub incurs penalty .

Table 1.
Code metadata for the Salvador package (v0.0.7).
| Nr. | Code metadata description | Metadata |
|---|---|---|
| C1 | Current code version | v0.0.7 |
| C2 | Permanent link to code repository | https://github.com/frankvegadelgado/salvador |
| C3 | Permanent link to reproducible capsule | https://pypi.org/project/salvador/ |
| C4 | Legal Code License | MIT License |
| C5 | Code versioning system used | git |
| C6 | Languages, tools, and services used | Python ≥ 3.12, NetworkX ≥ 3.4.2, NumPy ≥ 2.2.1, SciPy ≥ 1.15.0 |
| C7 | Compilation requirements and dependencies | Python, NetworkX, NumPy, SciPy |
Table 2.
Part A: ratio of the returned cover to the exact optimum, by family. Every one of the instances was solved exactly () and every returned cover was valid; the run completed in seconds.
Table 2.
Part A: ratio of the returned cover to the exact optimum, by family. Every one of the instances was solved exactly () and every returned cover was valid; the run completed in seconds.
| Family | Instances | Mean ratio | Max ratio |
|---|---|---|---|
| Graph atlas () | 1245 | 1.000 | 1.000 |
| Bipartite hill-climb (exact) | 80 | 1.000 | 1.000 |
| Random general (exact, ) | 173 | 1.000 | 1.000 |
| Random bipartite (exact) | 99 | 1.000 | 1.000 |
| Grids, bipartite (exact) | 64 | 1.000 | 1.000 |
| Relabel / order stress (exact) | 56 | 1.000 | 1.000 |
| Bipartite obstruction (exact) | 1 | 1.000 | 1.000 |
| Overall | 1718 | 1.000 | 1.000 |
Table 3.
Part B: ratio upper bound and wall-clock time on the largest instance of each of the ten large/adversarial families (28 instances in total, up to vertices and edges). Every returned cover was valid.
Table 3.
Part B: ratio upper bound and wall-clock time on the largest instance of each of the ten large/adversarial families (28 instances in total, up to vertices and edges). Every returned cover was valid.
| Family | Max n | Max ratio u.b. | Max time (s) |
|---|---|---|---|
| Random 12-regular | 200,000 | 1.604 | 39.74 |
| Watts–Strogatz small-world | 50,000 | 1.438 | 3.14 |
| Random 6-regular | 200,000 | 1.448 | 24.05 |
| Barabasi–Albert scale-free | 200,000 | 1.354 | 23.18 |
| Sparse Erdos–Renyi (avg. degree 4) | 200,000 | 1.278 | 16.40 |
| Random 3-regular | 200,000 | 1.274 | 14.26 |
| Complete bipartite | 1,600 | 1.000 | 8.95 |
| Crown graph | 1,600 | 1.000 | 9.03 |
| Double star + bridge | 200,002 | 1.000 | 6.28 |
| Hierarchical star trap | 152,917 | 1.000 | 5.27 |
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2026 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (http://creativecommons.org/licenses/by/4.0/).
Copyright: This open access article is published under a Creative Commons CC BY 4.0 license, which permit the free download, distribution, and reuse, provided that the author and preprint are cited in any reuse.