arXiv:2609.07304cs.DMSep 2026

Manuscript Offprint

arXiv:2609.07304

A simple algorithm for computing Hamilton paths on independent set polytopes

Jean Cardinal, Pia Herkenrath, Torsten Mütze, Francesco Verciani

JEAN CARDINAL, PIA HERKENRATH, TORSTEN MÜTZE, AND FRANCESCO VERCIANI

ABSTRACT. The independent set polytope, or stable set polytope, of a graph GG is the 0/1-polytope defined by the convex hull of the characteristic vectors of all independent sets of GG. We present a simple algorithm for computing a Hamilton path on the independent set polytope of a given nn-vertex graph GG with amortized delay O(n)\mathcal{O}(n). The independent sets are listed such that two consecutive sets differ either in removing a vertex, or adding a vertex and removing its neighbors from the independent set, i.e., the symmetric difference between two consecutive independent sets induces a star in GG. As applications of this result, we obtain an algorithm to compute a Hamilton path on the matching polytope of an mm-edge graph GG with worst-case delay O(m)\mathcal{O}(m), which lists all matchings of GG in such a way that the symmetric difference between two consecutive matchings is a path on at most three edges. Furthermore, we obtain an algorithm to compute a Hamilton path on the chain polytope and order polytope of an nn-element poset PP with amortized delay O(n)\mathcal{O}(n), which lists all antichains of PP or all ideals of PP, respectively, by star exchanges. Our algorithms are derived from the generic framework proposed by Merino and Mütze (FOCS'23+SICOMP'24) for computing Hamilton paths on arbitrary 0/1-polytopes, which uses a linear optimization procedure as a black box. Our algorithms bypass solving the computationally intractable maximum weight independent set problem by a simple and purely combinatorial greedy rule.

1. INTRODUCTION

Polytopes with vertex coordinates in {0,1}\{0,1\}, called 0/10/1-polytopes, are ubiquitous in combinatorial optimization. This is because the solutions of many interesting optimization problems can be described as 0/10/1-vectors, by considering the characteristic vectors of the underlying sets. For example, consider a graph GG with mm edges labeled 1,…,m1,\ldots,m, and let MM be a matching in GG, i.e., a set of edges, no two of which have a vertex in common. Then the characteristic vector of MM, denoted xM∈{0,1}mx^M \in \{0,1\}^m is defined as xeM=1x_e^M = 1 if e∈Me \in M and xeM=0x_e^M = 0 if e∉Me \notin M. The matching polytope of GG is defined as M(G):=conv({xM∣M matching in G})⊂Rm\mathcal{M}(G) := \mathrm{conv}(\{x^M \mid M \text{ matching in } G\}) \subset \mathbb{R}^m [Chv75]. The maximum weight matching problem is to maximize the linear objective function w⋅xw \cdot x for all x∈M(G)x \in \mathcal{M}(G), where w∈Rmw \in \mathbb{R}^m is the vector of weights assigned to the edges of GG. This problem has been a cornerstone of computer science research in the past decades, and can be solved efficiently with one of the many algorithms that are now taught in textbooks.

In this work, we focus on the independent set polytope of a graph GG, also known as stable set polytope [Chv75]. Specifically, an independent set in a graph GG is a set of vertices that spans no edges, and the independent set polytope is defined as P(G):=conv({xU∣\mathcal{P}(G) := \mathrm{conv}(\{x^U \mid

(Jean Cardinal) COMPUTER SCIENCE DEPARTMENT, UNIVERSITÉ LIBRE DE BRUXELLES, BELGIUM (Pia Herkenrath) INSTITUT FÜR MATHEMATIK, UNIVERSITÄT KASSEL, GERMANY (Torsten Mütze) INSTITUT FÜR MATHEMATIK, UNIVERSITÄT KASSEL, GERMANY (Francesco Verciani) INSTITUT FÜR MATHEMATIK, UNIVERSITÄT KASSEL, GERMANY E-mail addresses: jean.cardinal@ulb.be, pherkenrath@mathematik.uni-kassel.de, tmuetze@mathematik.uni-kassel.de, francesco.verciani@mathematik.uni-kassel.de. This project was supported by German Science Foundation grant 522790373.

U independent set in G}G\}; see Figure 1 (a). We note that matchings of GG can be seen as independent sets in the line graph L(G)L(G), the graph that has a vertex for every edge of GG, and an edge between vertices corresponding to edges of GG that are incident to each other. Consequently, the matching polytope of GG equals the independent set polytope of L(G)L(G). For example, the independent set polytope of the 5-vertex path shown in Figure 1 equals the matching polytope of the 6-vertex (=5-edge) path. Unlike the aforementioned maximum weight matching problem, which is polynomial-time solvable, the corresponding optimization problem on the independent set polytope is NP-hard, as it includes the maximum cardinality independent set problem on GG as a special case (all weights equal to 1).

Combinatorial 0/1-polytopes as the ones discussed before encode interesting information about the underlying combinatorial objects. For example, the edges of the matching polytope connect pairs of matchings whose symmetric difference is an alternating path or cycle. Similarly, the edges of the independent set polytope connect pairs of independent sets whose symmetric difference induces a connected subgraph. The structure of these polytopes has also been studied extensively with the goal of understanding the aforementioned apparent dichotomy between tractability and intractability of the corresponding optimization problems.

1.1. Hamilton paths on 0/1-polytopes. In this work, we consider the problem of computing a Hamilton path on the independent set polytope of a given graph GG. The goal is to visit every vertex of the polytope exactly once, such that any two consecutive vertices are connected by an edge. Combinatorially, we aim to compute every independent set of GG exactly once, such that

Figure

(a)

(b)

(c)

FIGURE 1. (a) Independent set polytope of the 5-vertex path, with vertices numbered 1, ..., 5 from left to right. Characteristic vectors of independent sets of the path are bitstrings of length 5 that avoid two adjacent 1s. Edges of the polytope corresponding to star exchanges are solid, the others dashed. The shading highlights the two faces of the polytope in which the last bit is either 0 or 1. (b) Hamilton path computed by Algorithm I on the independent set polytope from the left, with initial vertex x~=00000\tilde{x} = 00000. The edges are colored according to the length of the prefix change, and the algorithm changes the shortest possible prefix that leads to a new vertex. (c) Vertices listed in the order of the Hamilton path, with 0-bits and 1-bits visualized as white and black squares, respectively, revealing the genlex property.

the symmetric difference between any two consecutive independent sets induces a connected subgraph of GG. One crucial property of such a listing algorithm is its delay, which is the time needed to compute the next vertex of the polytope, that is, the next independent set of GG. We note that listings of combinatorial objects subject to some minimum-change condition are also known as Gray codes in the literature [Sav97, Müt23].

By a classical result of Naddef and Pulleyblank [NP84], every 0/1-polytope admits a Hamilton path. Recently, Merino and Mütze developed a generic algorithm for computing a Hamilton path on any 0/1-polytope [MM23, MM24], which was subsequently improved by Fink, Hladík, Merino, Mička and Mütze [FHM⁺26]. Their algorithm uses as a black box an algorithm for solving the linear optimization problem over the corresponding polytope, and the resulting delay is given by the time to solve the linear optimization problem. As mentioned before, linear optimization over the independent set polytope is hard, so this approach does not directly give an efficient algorithm for computing a Hamilton path on the independent set polytope.

1.2. Our results. Our main contribution is a simple algorithm for computing a Hamilton path on the independent set polytope P(G)\mathcal{P}(G) of a given graph GG; see Figure 1 (b)+(c). The algorithm comes in a basic variant and an improved variant for faster speed (see Algorithms I and I* and Theorems 2 and 3 below). The algorithm has a number of desirable features:

  • It works for every graph GG, and for every labeling of the vertex set of GG with integers 1,…,n1, \ldots, n, which gives additional freedom that can be exploited in some applications.

  • It works for every starting vertex of the polytope, i.e., for every initial independent set.

  • The algorithm is purely combinatorial: it does not perform any polyhedral or numerical computations, and also does not rely on solving the corresponding (hard) optimization problem, and it can be implemented with few lines of code.

  • The resulting amortized delay is linear in the number of vertices of GG.

  • To move from one independent set to the next, the algorithm applies one of two operations, referred to as a star exchange: either remove a vertex of GG, or add a vertex of GG and remove all its neighbors from the current independent set. Consequently, the subgraph of GG induced by the symmetric difference between two consecutive independent sets is always a star. This also yields an algorithmic proof that the subgraph of the independent set polytope corresponding to star exchanges admits a Hamilton path.

  • The computed ordering of independent sets has the so-called genlex property, which means that characteristic vectors with the same suffix appear consecutively.

We also present the following applications of our algorithm.

  • By applying this algorithm to the nn-vertex graph without edges, we recover the well-known binary reflected Gray code (Section 3.1). By applying the algorithm to paths and cycles, we obtain Gray codes for Fibonacci and Lucas words, respectively (Theorem 4).

  • As vertex covers of a graph GG are complements of independent sets of GG, we also obtain an algorithm for computing a Hamilton path on the vertex cover polytope of GG (Section 3.2).

  • As mentioned before, matchings in a graph GG are independent sets in its line graph L(G)L(G). We thus obtain an algorithm for computing a Hamilton path on the matching polytope M(G)\mathcal{M}(G), where any two consecutive matchings differ in an alternating path of length at most 3 (see Algorithm M and Theorem 5). The (worst-case) delay is O(m)\mathcal{O}(m), where mm is the number of edges of GG.

  • Antichains in a poset PP are independent sets in the comparability graph of PP. We thus obtain an algorithm for computing a star exchange Hamilton path on Stanley's [Sta86] chain polytope C(P)\mathcal{C}(P) (see Algorithm A* and Theorem 6). In every step, either an element is removed

4 A SIMPLE ALGORITHM FOR COMPUTING HAMILTON PATHS ON INDEPENDENT SET POLYTOPES

from the current antichain, or an element is added and all elements in its downset are removed. The amortized delay per visited antichain is O(n)\mathcal{O}(n), where nn is the number of elements of PP. Similarly, we obtain an algorithm for computing a star exchange Hamilton path on Stanley's order polytope O(P)\mathcal{O}(P) (Theorem 7), with amortized delay O(n)\mathcal{O}(n) per visited ideal of PP. In every step, either a maximal element from the ideal is removed together with all elements that are uniquely covered by it, or an element is added together with its downset.

1.3. Related work. As our algorithm lists all independent sets of a given graph, one may wonder naturally about listing only the maximum independent sets, or only the inclusion-maximal ones. In fact, the maximum independent set polytope is a facet of the independent set polytope, obtained by intersecting it with a hyperplane that fixes the cardinality of the sets. As the maximum independent set problem is NP-hard in general graphs, there is likely no polynomial delay algorithm for listing maximum independent sets. Tsukiyama, Ide, Ariyoshi and Shirakawa [TIAS77] give an algorithm for listing all inclusion-maximal independent sets with delay O(mn)\mathcal{O}(mn) (see also [CN85]), where here and in the following, mm and nn denote the number of edges and vertices of an input graph, respectively. This was later improved by Makino and Uno [MU04]. Johnson, Yannakakis and Papadimitriou [JYP88] provided an algorithm for listing all inclusion-maximal independent sets in lexicographic order with delay O(mn)\mathcal{O}(mn).

Kashiwabara, Masuda, Nakajima and Fujisawa [KMNF92] list maximum independent sets of a bipartite graph GG with delay O(1)\mathcal{O}(1), but not according to the associated polytope. Using the aforementioned reduction to an optimization problem, Merino and Mütze [MM24] obtained an algorithm for computing a Hamilton path on the independent set polytope and maximum independent set polytope of a bipartite graph, with delay O(mn)\mathcal{O}(m\sqrt{n}) and O(mn)\mathcal{O}(mn), respectively.¹ Recall that the algorithm for the independent set polytope presented here has only amortized delay O(n)\mathcal{O}(n) and works for general graphs.

Merino and Mütze [MM24] also gave an algorithm for computing Hamilton paths on the matching polytope M(G)\mathcal{M}(G) and perfect matching polytope of any graph GG, with delay O(mn)\mathcal{O}(m\sqrt{n}) and O(mnlog⁡n)\mathcal{O}(m\sqrt{n}\log n), respectively. For the matching polytope, our new algorithm with delay O(m)\mathcal{O}(m) improves on this. For comparison, the algorithm of Uno [Uno01] lists perfect matchings of a bipartite graph with delay O(log⁡n)\mathcal{O}(\log n), but not according to the polytope.

The authors of [MM24] also obtained an algorithm for computing Hamilton paths on the chain polytope C(P)\mathcal{C}(P) and order polytope O(P)\mathcal{O}(P) of any poset PP, with delay O(n2.5/log⁡n)\mathcal{O}(n^{2.5}/\sqrt{\log n}) and O(n4)\mathcal{O}(n^4), respectively, where nn is the number of element of PP. The amortized delay O(n)\mathcal{O}(n) reported in this paper is a considerable improvement.

In the following, we describe a number of results on listing ideals of a poset in kk-Gray code order, which means that the symmetric difference of any two consecutive ideals has size at most kk. Note that a 1-Gray code is necessarily a Hamilton path on the order polytope, but a kk-Gray code for k≥2k \geq 2 is in general not. By considering the maximal elements of the ideals, a 1-Gray code for ideals also gives a Hamilton path on the chain polytope C(P)\mathcal{C}(P) (see Section 3.4 below for details).

Koda and Ruskey [KR93] proved that ideals of a poset whose Hasse diagram is a forest of trees rooted at a minimal element admits a 1-Gray code that can be computed with delay O(1)\mathcal{O}(1).

Pruesse and Ruskey [PR93] proved that the ideals of any poset admit a 2-Gray code, computable with delay O(n)\mathcal{O}(n). Habib, Nourine, Steiner [HNS97] present a 2-Gray code for interval orders that can be computed with delay O(1)\mathcal{O}(1). For general posets PP, Habib, Medina, Nourine, Steiner [HMNS01] presented another 2-Gray code, computable with delay that is linear in the

¹The delays stated here are without the log⁡n\log n factor that can be saved as described in [FHM⁺26].

maximum down-degree of the Hasse diagram of PP, but each ideal appears twice in the listing. In a recent breakthrough, Brenner and Fink [BF26] presented an algorithm for listing the ideals and antichains of any poset with amortized delay O(1)\mathcal{O}(1), even in 3-Gray code order. As mentioned before, these Gray codes are in general not Hamilton paths on the associated polytopes.

1.4. Outline. In Section 2 we present our basic algorithm for computing a Hamilton path on the independent set polytope, and an improved variant of the algorithm for higher speed. In Section 3 we discuss in detail the aforementioned applications of our algorithm. At the end of this paper in Section 4, we present an extensive experimental comparison of both variants of our algorithm on a variety of input graphs.