Preprint
Article

This version is not peer-reviewed.

An Approximate Independent Set Solver: The Esperanza Algorithm

Submitted:

04 July 2026

Posted:

09 July 2026

You are already at the latest version

Abstract
The maximum independent set problem asks for the largest set of pairwise non-adjacent vertices in an undirected graph and is NP-hard in general. This paper describes Esperanza, an approximation algorithm that runs in \( O(n + m) \) time on a graph with \( n \) vertices and \( m \) edges. The starting point is a small observation about the bipartite double cover of the input graph: its maximum cut is trivially exact, and the freedom left in choosing that cut, namely flipping whole components, can be spent so that one side of the assignment becomes as small as possible. Projecting the opposite, large side back onto the original vertex set produces a generous candidate solution. The candidate is then repaired: on every edge whose two endpoints both survive in the candidate, the endpoint carrying more conflicts is deleted, with conflict counters updated on the fly. A final pass grows the repaired set into a maximal independent set, taking vertices in increasing order of degree. We prove that the output is always a maximal independent set and that on bipartite graphs its size is at least half the independence number, which gives a ratio of \( 2 \) there. Beyond the bipartite case we prove nothing about the ratio, and we say so plainly. What we offer instead is evidence. In experiments where every optimum was certified by integer programming, a reproducible run over \( 30{,}000 \) instances never produced a ratio above \( 2 \) (the mean was \( 1.049 \)), and the worst ratio we have ever seen is \( 2.5 \), on a small hand-crafted instance whose ratio survives, without growing, two natural amplification constructions. We conjecture that the approximation ratio is bounded by a universal constant, keep \( 5/2 \) only as the current record, examine how each family of graphs behaves relative to the conjectured bound, and sketch linear-time modifications that would eliminate every worst case we know of.
Keywords: 
;  ;  ;  ;  ;  

1. Introduction

Given an undirected graph G = ( V , E ) , an independent set is a subset S V in which no two vertices are joined by an edge. The maximum independent set (MIS) problem asks for such a set of largest possible cardinality; its size is the independence number α ( G ) , and we write OPT = α ( G ) throughout. The problem sits on Karp’s original list of NP-complete problems [1] and shows up wherever conflicts must be avoided: task scheduling, frequency assignment, the selection of non-interfering nodes in a network, the construction of error-correcting codes.
Since exact solutions are out of reach for general graphs unless P = NP , the practical question is how well one can approximate. The usual measure is the ratio ρ = OPT / | S | for a returned set S, so smaller is better and ρ = 1 means optimal. The known landscape is sobering. A greedy pass gives O ( Δ ) where Δ is the maximum degree, and the minimum-degree greedy of Halldórsson and Radhakrishnan reaches O ( n / log n )  [2]. Subgraph exclusion brings this to O ( n / ( log n ) 2 )  [3], and semidefinite programming achieves O ( n / log n ) with better bounds on special classes such as 3-colorable graphs [4]. Against all this stands Håstad’s lower bound: unless P = NP , no polynomial-time algorithm approximates MIS within n 1 ϵ for any ϵ > 0  [5]. Constant factors are only known to be attainable on restricted classes; bipartite graphs even admit an exact polynomial algorithm through König’s theorem, and bounded-degree or planar graphs have constant-factor schemes.
This paper describes Esperanza, an algorithm that runs in time O ( n + m ) and works in three stages. The first stage builds a seed. Every edge ( u , v ) of G is replaced by the two crossing edges ( ( u , 0 ) , ( v , 1 ) ) and ( ( u , 1 ) , ( v , 0 ) ) ; the graph B assembled this way is the bipartite double cover of G, and it is bipartite no matter what G looks like. Its maximum cut is therefore exact and cuts every edge. The cut is not unique, though: whole components of B may be flipped freely. Esperanza flips each component so that one fixed side of the assignment becomes as small as possible, then projects the opposite, large side back onto V. That projection is the seed. It is large by construction, but nothing forces it to be independent.
The second stage repairs the seed. Each seed vertex counts its neighbors inside the seed; call these its conflicts. The edge list is scanned once, and whenever an edge still has both endpoints in the seed, the endpoint with more conflicts is deleted and the counters of its neighbors are decremented on the spot. One deletion thus settles as many conflicts as the data allows. When the scan ends the seed is independent. The third stage grows this set: all vertices currently outside it, including those deleted a moment earlier, are sorted by degree with a counting sort and scanned from low degree to high, and any vertex with no neighbor in the set is added. The result is a maximal independent set.
Three facts about this pipeline are proved below: the output is always a maximal independent set (Theorem 1), the total running time is O ( n + m ) (Theorem 3), and on bipartite graphs the output contains at least half the vertices, so the ratio there is at most 2 (Theorem 2). For general graphs we prove no bound on the ratio, and we prefer to state that openly rather than bury it. What we can report is evidence from two stress studies in which every optimum was certified by a mixed-integer linear program. A targeted adversarial pass produced a worst ratio of exactly 2.5 , on a 9-vertex instance found by search, and that value refused to grow under two amplification constructions. A separate reproducible run over 30 , 000 certified instances never exceeded 2. Section 7 turns this into a precise conjecture (Conjecture 1), records 5 / 2 only as the current record (Remark 1), works through how each family of graphs behaves relative to the conjectured constant, and describes modifications that would remove every worst case we currently know.

2. Research Data

The algorithm is implemented in Python under the name Esperanza: Approximate Independent Set Solver and is available on the Python Package Index [6]. Table 1 lists the code metadata.

3. The Esperanza Algorithm

Algorithms 1–4 give the pseudo-code. They were written to follow the reference implementation [6] line by line, so a reader can move between paper and source without translation: Algorithm 1 is find_independent_set, Algorithm 2 is max_cut_bipartite, Algorithm 3 is maxcut_bipartite_min_side_linear, and Algorithm 4 is maximize_solution. The edge gadget behind the seed stage is drawn in Figure 1.
Algorithm 1  FindIndependentSet ( G )
Require: 
Undirected graph G = ( V , E )
Ensure: 
A maximal independent set S V
1:
if | V | = 0 or | E | = 0 thenreturnV
2:
end if
3:
G G . copy ( ) ; remove all self-loops from G
4:
I iso { v V : deg ( v ) = 0 } ; remove I iso from G
5:
if | V ( G ) | = 0 thenreturn I iso
6:
end if
7:
S M a x C u t B i p a r t i t e ( G ) ▹ Algorithm 2
8:
S M a x i m i z e S o l u t i o n ( G , S ) ▹ Algorithm 4
9:
return S I iso
Algorithm 2 MaxCutBipartite ( G ) — double-cover Max-Cut seed
Require: 
Undirected graph G = ( V , E ) with no self-loops and no isolated vertices
Ensure: 
A seed set S V (not necessarily independent)
1:
B empty graph ▹ bipartite double cover
2:
for each edge ( u , v ) E  do
3:
    add edges ( ( u , 0 ) , ( v , 1 ) ) and ( ( u , 1 ) , ( v , 0 ) ) to B▹ gadget of Figure 1
4:
end for
5:
R M a x C u t M i n S i d e ( B , 1 ) ▹ Algorithm 3; B is always bipartite
6:
return S { u V : ( u , i ) R . side 0 for some i { 0 , 1 } }
Algorithm 3 MaxCutMinSide ( B , s ) — exact bipartite Max-Cut minimizing side s
Require: 
Undirected graph B; side s { 0 , 1 } to minimize
Ensure: 
A maximum-cut assignment of B cutting all edges, with side s of minimum size
1:
for each s t a r t V ( B ) not yet colored do
2:
    if  deg ( s t a r t ) = 0  then
3:
        assign s t a r t to side s 1 ▹ isolated vertices do not affect the cut
4:
        continue
5:
    end if
6:
    BFS from s t a r t , 2-coloring its component into classes P 0 and P 1
7:
    if some edge joins two vertices of equal color then
8:
        return infeasibleB not bipartite; never happens for double covers
9:
    end if
10:
    assign the smaller of P 0 , P 1 to side s and the larger to side s 1 ▹ the only freedom in a maximum cut is flipping whole components
11:
end for
12:
return the assignment (sides 0 and 1)
Algorithm 4 MaximizeSolution ( G , S ) — repair and grow
Require: 
Undirected graph G = ( V , E ) ; candidate set S V
Ensure: 
A maximal independent set of G
1:
Phase 1 (repair):
2:
for each u S do conflicts [ u ] | N ( u ) S |
3:
end for
4:
for each edge ( u , v ) E  do
5:
    if  u v and u S and v S  then
6:
         w u if conflicts [ u ] conflicts [ v ] elsev▹ on ties, the first endpoint is deleted
7:
         S S { w }
8:
        for each x N ( w ) with x conflicts do conflicts [ x ] conflicts [ x ] 1
9:
        end for
10:
        delete conflicts [ w ]
11:
    end if
12:
end for
13:
Phase 2 (grow):
14:
bucket every u V S by deg ( u ) ▹ counting sort, O ( n )
15:
for d = 0 to Δ ( G )  do
16:
    for each u in bucket d do
17:
        if  N ( u ) S = then S S { u }
18:
        end if
19:
    end for
20:
end for
21:
returnS
A word on what the seed actually contains, since this drives everything else. Suppose a connected component of G is bipartite, with classes X and Y where | X | | Y | . Its double cover then falls apart into two disjoint copies of the component, and once each copy has its smaller class pushed to side 1, the projection of side 0 recovers exactly the larger class Y. If the component is non-bipartite the picture changes completely: its double cover is connected, both bipartition classes project onto the full vertex set, and the seed simply contains every vertex of the component. So on bipartite inputs the seed is already a large independent set, while on non-bipartite inputs the seed does almost nothing and the repair rule carries the whole weight. That rule deletes, on each conflicting edge, whichever endpoint currently has more conflicts, so a single deletion resolves as much as it can; vertices lost in this phase are not gone for good, since the grow phase reconsiders them.

4. Correctness of the Algorithm

Theorem 1. 
Algorithm 1 (FindIndependentSet) always outputs a maximal independent set of G restricted to its non-isolated vertices, together with all isolated vertices. In particular, the output is a valid independent set: for all u , v in the output, ( u , v ) E .
Proof. 
The trivial cases are quickly dispatched: if | V | = 0 or | E | = 0 the output V is independent and maximal, and if only isolated vertices remain after preprocessing then I iso is independent (all degrees are 0) and maximal.
Now consider Phase 1 of Algorithm 4. It only ever removes vertices. Take any edge ( u , v ) E and look at the moment it is scanned: either both endpoints are still in S, in which case one of them is deleted, or at least one endpoint has already left S. Membership can only shrink during this phase, so from that moment until the phase ends, at most one endpoint of ( u , v ) belongs to S. Every edge is scanned exactly once, hence no edge survives with both endpoints inside S, and the set is independent when Phase 1 terminates. The incremental counter updates play no role in this argument; they decide which endpoint is deleted, not whether one is.
Phase 2 adds a vertex u only after verifying N ( u ) S = , so no edge inside S is ever created, and by induction on the additions the set stays independent. Maximality also follows from the structure of the phase: every vertex outside S at its start is placed in a bucket and scanned once. A vertex that is not added had, at scan time, a neighbor inside S; that neighbor never leaves, because the phase performs no removals. Every vertex outside the final S therefore has a neighbor in S.
Finally, the vertices of I iso have degree 0 in G, so appending them keeps the set independent, and they belong to every maximal independent set anyway.    □

5. A Provable Ratio of 2 on Bipartite Graphs

Lemma 1 
(Seed size on bipartite graphs). Let G be bipartite with no isolated vertices. Then the seed S returned by Algorithm 2 is the union, over the connected components of G, of the larger bipartition class of each component. Consequently, S is an independent set of G and | S | n / 2 .
Proof. 
Let H be a connected component of G with bipartition classes X and Y, | X | | Y | . The double cover of H consists of two disjoint connected components, H 1 on vertex set ( X × { 0 } ) ( Y × { 1 } ) and H 2 on ( X × { 1 } ) ( Y × { 0 } ) , each isomorphic to H. In H 1 the smaller class X × { 0 } goes to side 1 and Y × { 1 } to side 0; in H 2 the smaller class X × { 1 } goes to side 1 and Y × { 0 } to side 0. Projecting side 0 onto V yields exactly Y, the larger class of H. A bipartition class is an independent set, classes of distinct components are non-adjacent, and the larger class of each component holds at least half of that component’s vertices; summing over components gives | S | n / 2 .    □
Theorem 2 
(Bipartite 2-approximation). On every bipartite graph G, Algorithm 1 returns an independent set S with OPT / | S | 2 .
Proof. 
Isolated vertices contribute identically to OPT and to | S | , so assume G has none. By Lemma 1 the seed is already independent; Phase 1 of Algorithm 4 therefore finds no conflicting edge and deletes nothing, and Phase 2 can only add vertices. Hence | S | n / 2 , and since OPT = α ( G ) n we conclude OPT / | S | n / ( n / 2 ) = 2 .    □
Corollary 1. 
On the complete bipartite graph K a , b with a b , the algorithm returns exactly the larger class, which is optimal: the ratio is 1.
Proof. 
By Lemma 1 the seed is the larger class Y, and | Y | = b = α ( K a , b ) . In the grow phase every vertex of the smaller class is adjacent to all of Y, so nothing is added and the output is Y itself.    □
Theorem 2 is the only ratio theorem in this paper. Away from bipartite graphs, Section 4 guarantees maximality and nothing more, and a maximal independent set by itself carries no constant-factor guarantee on arbitrary graphs. What actually happens on general inputs is the subject of Section 7.

6. Runtime Analysis

Theorem 3 
(Time complexity). Algorithm 1 runs in O ( n + m ) worst-case time, where n = | V | and m = | E | , using adjacency lists.
Proof. 
Preprocessing (copying the graph, removing self-loops, extracting isolated vertices) costs O ( n + m ) .
For the seed, the double cover B has 2 n vertices and 2 m edges, where n counts the non-isolated vertices, and one pass over E builds it. The BFS 2-coloring visits every vertex and edge of B once, and choosing the smaller class per component plus projecting side 0 back onto V are plain linear scans. All of this is O ( n + m ) .
The repair phase computes the initial conflict counts by scanning the adjacency lists of the seed vertices, at total cost at most u deg ( u ) = 2 m . The edge scan touches each edge once. When a vertex w is deleted, its adjacency list is scanned once to decrement counters; since no vertex is deleted twice, all decrement work together is again bounded by 2 m .
The grow phase buckets at most n vertices by degree, a counting sort with keys in { 0 , , Δ } { 0 , , n 1 } , and then tests each remaining vertex once against its adjacency list. Reinserting the isolated vertices costs O ( n ) . Each stage is linear, so the whole pipeline is O ( n + m ) .    □
It is worth noting what this avoids: no matching computation (Hopcroft–Karp alone would cost O ( n m ) on bipartite inputs), no repeated cover refinement, no sorting beyond a counting sort. The algorithm is a fixed number of linear passes over the graph.

7. Empirical Study of the Approximation Ratio

With no ratio theorem available beyond bipartite graphs, we tested the implementation against optima certified by a mixed-integer linear program. For each instance G the exact independence number was obtained by solving
max v V x v subject to x u + x v 1 ( u , v ) E , x v { 0 , 1 } ,
to provable optimality, and the reported ratio is ρ = OPT / | ALG | with | ALG | the size of the set returned by FindIndependentSet.
Two studies were run. The first was a targeted pass over hand-picked families: a 9-vertex, 20-edge adversarial instance found by search, which is the worst case we know; two amplification families built from it, namely disjoint copies and independent blow-ups (each vertex replaced by an independent cluster of t copies, each edge by a complete join between clusters); classical extremal graphs (stars, complete graphs, complete bipartite graphs); and random ensembles, for which the largest ratio across all samples is reported. The second study is fully automated and lives in the car/ folder of the repository [6]. Invoked as python car/experiment.py, it generates 30 , 000 instances (random G ( n , p ) , random bipartite, random regular, stars, complete and complete bipartite graphs, plus an amplification family applied to the worst small connected bases discovered during the run itself), certifies every optimum through SciPy’s milp interface, re-verifies the independence of every returned set, and writes out the per-instance CSV, per-family summaries, a table, and the edge list of the worst instance encountered.

7.1. Results

Table 2 collects the targeted pass. The rows to look at first are the adversary and its amplifications:
5 2 10 4 20 8 40 16 .
Disjoint copies leave the ratio at exactly 2.5 , and so do independent blow-ups with t = 2 , 5 , 10 . Neither amplification produced superconstant growth, and no certified instance above 2.5 turned up anywhere in the pass.
The large run tells a similar story at scale. With its default parameters ( 30 , 000 instances, seed 42) the car/ driver finished in 212 seconds; Table 3 gives the per-family figures. The worst ratio in the entire run was 2.000 , first reached by a dense random graph with 15 vertices and 84 edges, and the overall mean was 1.049 . Nothing exceeded 2. The in-run amplification family, assembled from copies and blow-ups of the worst random bases the run itself had found, once more reproduced its base ratios without beating them.

7.2. Reading the Numbers

Why does the ratio refuse to blow up? On bipartite inputs the answer is Lemma 1: the seed alone already holds at least n / 2 vertices, against α ( G ) n , and complete bipartite graphs come out exactly optimal (Corollary 1). The random bipartite figures, worst case 1.286 and mean 1.004 , sit far inside the proven ceiling of 2.
Stars deserve a comment because they are the classical trap for maximal-independent-set heuristics: pick the center of K 1 , n 1 and the ratio is nearly n. Esperanza does not step into it. The center accumulates every conflict, the repair rule deletes the endpoint with more conflicts, so the center is removed and the leaves survive. All 2 , 000 certified stars came out at ratio 1.000 .
On non-bipartite connected graphs the double cover is connected, the seed degenerates to the whole vertex set, and everything depends on the repair phase. This is why a genuinely bad instance has to be subtle: it must trick the conflict-count deletion rule itself, edge by edge, into keeping the wrong vertices. Our 9-vertex adversary manages exactly that, forcing repair to retain two vertices where the optimum has five. And its amplifications cannot make matters worse, for a structural reason: disjoint copies are repaired independently of one another, and an independent blow-up scales ALG and OPT by the same factor t. The 2 , 000 in-run amplified instances of Table 3 confirm the mechanism on fresh material.

7.3. A Constant Approximation Ratio Conjecture

Everything above points in one direction: the ratio behaves like a constant. Thirty thousand randomized certified instances never crossed 2; the one instance family that reaches 2.5 was found by deliberate search, and two amplification constructions failed to push it higher. We take the plunge and state our central claim, as a conjecture:
Conjecture 1 
(Constant approximation ratio). There is a universal constant c such that, for every undirected graph G, Algorithm 1 returns an independent set S with α ( G ) / | S | c .
Remark 1 
(The candidate value c = 5 / 2 ). The worst certified ratio we have ever observed is exactly 5 / 2 , attained by the 9-vertex adversary of Table 2 and matched, never beaten, by its copies and blow-ups; the 30 , 000 -instance run of Table 3 stayed at or below 2. So 5 / 2 is the natural candidate for the constant c in Conjecture 1. Its status should not be overstated, however. It is the record of a finite search, nothing more. Some family that interacts with the conflict-count deletion rule in a way our amplifications do not could, in principle, push past it.
We stop short of a theorem, and for a definite reason. The code guarantees only that its output is a maximal independent set (Theorem 1), and maximality by itself buys no constant factor on arbitrary graphs. A proof of Conjecture 1 would have to lean on the double-cover seed and the deletion rule together, not on maximality. The stakes of such a proof are also worth spelling out: MIS cannot be approximated within n 1 ϵ for any ϵ > 0 unless P = NP [5], so a polynomial-time constant-factor algorithm for all graphs would be a major theoretical event [7]. Precisely because the claim would be so strong, the burden of proof is high, and stress evidence, however stubborn under amplification, does not meet it.

7.4. Family Behavior Against the Conjectured Constant, and How to Overcome it

It is useful to sort the tested families by how close they come to the conjectured bound. At the safe end sit the families with proofs: bipartite graphs cannot exceed 2 (Theorem 2) and in practice average 1.004 ; stars, complete graphs, and complete bipartite graphs were solved exactly on all 4 , 000 certified instances, the stars because repair deletes the center, the complete bipartite graphs by Corollary 1. None of these can threaten the conjecture.
The middle ground belongs to random graphs. Dense G ( n , p ) is the hardest natural regime, since there the seed is the whole vertex set and repair does all the work; it reached a worst ratio of 2.000 (mean 1.043 ), as did random regular graphs (mean 1.079 ). Close to the candidate constant, but strictly below it.
Only one family sits exactly at 5 / 2 : the hand-crafted adversary and its derivatives. As discussed above, its amplifications are ratio-invariant by construction, which is why the plateau holds rather than climbs.
Can the adversarial families be defeated outright? Yes, and cheaply. Four modifications preserve the linear or near-linear running time while removing the known worst cases. (i) Components of constant size can be solved exactly: a component on at most c 0 vertices takes O ( 2 c 0 ) = O ( 1 ) time by enumeration, and taking c 0 9 wipes out the 9-vertex adversary along with all its disjoint copies, which are nothing but constant-size components. (ii) Blow-ups collapse under twin contraction: false twins (vertices with identical neighborhoods) can be grouped in O ( n + m ) time by neighborhood hashing, the algorithm run on the contracted graph, and the chosen clusters re-expanded, so no blow-up can ever do worse than its base. (iii) The adversary depends on one particular deletion sequence; permuting the edge-scan order and randomizing tie-breaks over r independent repair passes, keeping the best outcome, costs O ( r ( n + m ) ) and makes that single bad sequence unlikely to survive every restart. (iv) A local-search pass that swaps one solution vertex for two non-adjacent outsiders costs O ( m Δ ) per round and is near-linear on bounded-degree graphs. The first two of these already neutralize, provably, every certified worst case in Table 2 and Table 3; the record of 5 / 2 would then belong to whatever the strengthened algorithm’s worst case turns out to be, which at present nobody knows. Integrating these variants and re-certifying them is left for future work, along with two more open threads: understanding structurally what makes the 9-vertex adversary tick, and benchmarking against DIMACS complement graphs and real-world networks.

8. Conclusion

Esperanza (v0.0.4) approximates the maximum independent set in O ( n + m ) time by seeding from an exact maximum cut of the bipartite double cover, repairing the seed through conflict-count deletions, and growing the result to maximality in ascending order of degree. The guarantees are exactly the ones we could prove: the output is always a maximal independent set, the running time is linear, and on bipartite graphs the ratio is at most 2, with equality to the optimum on complete bipartite graphs.
For general graphs the paper claims a constant approximation ratio only as a conjecture. The supporting evidence is a pair of MILP-certified studies: a reproducible 30 , 000 -instance run that never exceeded ratio 2 (mean 1.049 ), and a hand-crafted 9-vertex instance at ratio 2.5 whose disjoint copies and independent blow-ups reproduce, but never exceed, that value. We keep 5 / 2 strictly as the current record rather than a bound, since maximality alone implies no constant and the hardness of approximating MIS [5] places a heavy burden of proof on any constant-factor claim [7]. We also showed that the known worst cases are fragile: exact handling of constant-size components and twin contraction, both compatible with linear time, would already eliminate every certified adversarial family. Between its speed, its transparency, and the sharpness of the open question it raises, the algorithm seems to us equally at home in a production pipeline and in a classroom.

References

  1. Karp, R.M. Reducibility among Combinatorial Problems. In Complexity of Computer Computations; Miller, R.E., Thatcher, J.W., Bohlinger, J.D., Eds.; Plenum: New York, USA, 1972; pp. 85–103. [Google Scholar] [CrossRef]
  2. Halldórsson, M.M.; Radhakrishnan, J. Greed is good: Approximating independent sets in sparse and bounded-degree graphs. Algorithmica 1997, 18, 145–163. [Google Scholar] [CrossRef]
  3. Boppana, R.; Halldórsson, M.M. Approximating maximum independent sets by excluding subgraphs. BIT Numer. Math. 1992, 32, 180–196. [Google Scholar] [CrossRef]
  4. Karger, D.R.; Motwani, R.; Sudan, M. Approximate graph coloring by semidefinite programming. J. ACM 1998, 45, 246–265. [Google Scholar] [CrossRef]
  5. Håstad, J. Clique is hard to approximate within n1-ϵ. Acta Math. 1999, 182, 105–142. [Google Scholar] [CrossRef]
  6. Vega, F. Esperanza: Approximate Independent Set Solver. Version 0.0.4, Available online: https://pypi.org/project/esperanza. (accessed on 4 July 2026).
  7. Fortnow, L. Fifty years of P vs. NP and the possibility of the impossible. Commun. ACM 2022, 65, 76–85. [Google Scholar] [CrossRef]
Figure 1. The Max-Cut gadget of the seed stage (Algorithm 2, line 3). Every edge ( u , v ) of G becomes the crossing pair ( ( u , 0 ) , ( v , 1 ) ) and ( ( u , 1 ) , ( v , 0 ) ) in the double cover B. The two copies of a vertex are never adjacent, so B is bipartite whatever the input, its maximum cut is exact and cuts both gadget edges, and Algorithm 3 spends the remaining per-component freedom on making side 1 small. The seed is the projection of side 0 back onto V.
Figure 1. The Max-Cut gadget of the seed stage (Algorithm 2, line 3). Every edge ( u , v ) of G becomes the crossing pair ( ( u , 0 ) , ( v , 1 ) ) and ( ( u , 1 ) , ( v , 0 ) ) in the double cover B. The two copies of a vertex are never adjacent, so B is bipartite whatever the input, its maximum cut is exact and cuts both gadget edges, and Algorithm 3 spends the remaining per-component freedom on making side 1 small. The seed is the projection of side 0 back onto V.
Preprints 221665 g001
Table 1. Code metadata for the Esperanza package.
Table 1. Code metadata for the Esperanza package.
Nr. Code metadata description Metadata
C1 Current code version v0.0.4
C2 Permanent link to code/repository https://github.com/frankvegadelgado/esperanza
C3 Permanent link to Reproducible Capsule https://pypi.org/project/esperanza/
C4 Legal Code License MIT License
C5 Code versioning system used git
C6 Languages, tools, and services used Python
C7 Compilation requirements and dependencies Python ≥ 3.12, NetworkX ≥ 3.4.2,
NumPy ≥ 2.2.1, SciPy ≥ 1.15.0
Table 2. MILP-certified stress results for FindIndependentSet. ALG is the size of the returned independent set; OPT is the MILP-certified independence number; ρ = OPT / ALG . For random ensembles, the worst (largest) ratio over all samples is reported.
Table 2. MILP-certified stress results for FindIndependentSet. ALG is the size of the returned independent set; OPT is the MILP-certified independence number; ρ = OPT / ALG . For random ensembles, the worst (largest) ratio over all samples is reported.
Family / instance n m ALG OPT ρ
9-vertex adversary 9 20 2 5 2 . 5
2 disjoint adversary copies 18 40 4 10 2 . 5
4 disjoint adversary copies 36 80 8 20 2 . 5
8 disjoint adversary copies 72 160 16 40 2 . 5
independent blow-up, t = 2 18 80 4 10 2 . 5
independent blow-up, t = 5 45 500 10 25 2 . 5
independent blow-up, t = 10 90 2000 20 50 2 . 5
star K 1 , 99 100 99 99 99 1.0
complete graph K 60 60 1770 1 1 1.0
complete bipartite K 20 , 80 100 1600 80 80 1.0
random G ( n , p ) , n = 10 , p = . 35 , worst of 300 10 17 3 5 1.667
random G ( n , p ) , n = 12 , p = . 50 , worst of 300 12 28 3 5 1.667
random G ( n , p ) , n = 14 , p = . 65 , worst of 200 14 60 2 4 2.0
random bipartite, n = 30 , p = . 20 , worst of 100 30 50 15 17 1.133
random bipartite, n = 60 , p = . 10 , worst of 50 60 80 31 34 1.097
Table 3. Per-family results of the reproducible 30 , 000 -instance MILP-certified run (python car/experiment.py, seed 42). ρ = OPT / ALG .
Table 3. Per-family results of the reproducible 30 , 000 -instance MILP-certified run (python car/experiment.py, seed 42). ρ = OPT / ALG .
Family Instances Worst ρ Mean ρ
random G ( n , p ) 15,000 2.000 1.043
random bipartite 6,000 1.286 1.004
random regular 3,000 2.000 1.079
star 2,000 1.000 1.000
amplified (in-run) 2,000 2.000 1.288
complete 1,000 1.000 1.000
complete bipartite 1,000 1.000 1.000
overall 30,000 2.000 1.049
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.
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.
Prerpints.org logo

Preprints.org is a free preprint server supported by MDPI in Basel, Switzerland.

Subscribe

© 2026 MDPI (Basel, Switzerland) unless otherwise stated

Accessibility

Disclaimer

Terms of Use

Privacy Policy

Privacy Settings