Perfect Sandwich Problem in Graphs
- The Perfect Sandwich Problem is the challenge of completing an intermediate graph from a lower and upper edge set so that the result is a perfect graph free of odd holes and antiholes.
- It leverages the Strong Perfect Graph Theorem and obstruction theory to reformulate the problem as a constraint satisfaction problem using infinite 2-edge-colored templates.
- Exact algorithms based on integer programming and cutting-plane methods provide insights despite the overall computational complexity remaining open.
The Perfect Sandwich Problem is the graph sandwich problem for the class of perfect graphs: given two graphs on the same vertex set, and with , determine whether there exists an intermediate graph such that and is perfect (Bodirsky et al., 10 Oct 2025, Erdem et al., 29 Jul 2025). It is a central open problem in graph sandwich complexity: it is known to be a CSP in the infinite-template sense, and several natural subclasses admit complete complexity classifications, but the general problem is neither known to be in nor known to be NP-hard (Bodirsky et al., 10 Oct 2025).
1. Formal definition and equivalent encodings
For a graph class , the sandwich problem asks whether an input pair , 0 with 1 admits some 2 satisfying
3
such that 4 (Bodirsky et al., 10 Oct 2025). When 5 is the class of perfect graphs, 6 is the Perfect Sandwich Problem (Bodirsky et al., 10 Oct 2025).
An equivalent formulation uses a triple 7, where 8 is the set of forced edges, 9 is the set of forbidden edges, 0, and all remaining pairs are free (Bodirsky et al., 10 Oct 2025). In this encoding, the question is whether there exists a graph 1 such that 2, 3, and 4 is perfect.
This formulation places the problem between several better-known modification problems. If 5 is the complete graph, the problem becomes perfect completion; if 6, it collapses to recognition of perfect graphs; and, more generally, it is a constrained completion problem in which only a designated subset of non-edges may be added (Erdem et al., 29 Jul 2025).
2. Perfect graphs and obstruction theory
A graph 7 is perfect if every induced subgraph 8 satisfies
9
where 0 is chromatic number and 1 is clique number (Erdem et al., 29 Jul 2025). The structural characterization used throughout the modern theory is the Strong Perfect Graph Theorem: a graph is perfect if and only if it has no induced odd hole and no induced odd antihole (Erdem et al., 29 Jul 2025).
This obstruction-based description is fundamental for sandwich formulations. In a perfect sandwich instance, the free pairs must be assigned so that the completed graph avoids both families of forbidden induced subgraphs simultaneously. That interaction is substantially subtler than ordinary perfect-graph recognition, which is polynomial-time, because the input does not specify a single graph but a family of admissible completions (Erdem et al., 29 Jul 2025).
The same obstruction theory also explains why perfect graphs fit naturally into model-theoretic and CSP frameworks. Odd holes and odd antiholes are point-determining obstructions, and this implies that the class of perfect graphs is preserved by blow-ups in the sense used in the CSP reduction for sandwich problems (Bodirsky et al., 10 Oct 2025). A plausible implication is that perfectness is structurally stable under the duplications relevant for the sandwich-to-CSP translation, even though the resulting CSP remains difficult to classify in the unrestricted perfect-graph case.
3. CSP representation
A central development is the encoding of graph sandwich problems as constraint satisfaction problems over infinite 2-edge-coloured templates (Bodirsky et al., 10 Oct 2025). For a graph 3, one forms the complete 4-edge-coloured graph 5 whose blue edges are the adjacencies of 6 and whose red edges are its non-adjacencies. The injective CSP of 7 coincides with the sandwich problem for the class 8 of finite induced subgraphs of 9 (Bodirsky et al., 10 Oct 2025).
More generally, if a graph class 0 is hereditary, has the joint embedding property, is preserved by split blow-ups, and has a universal graph 1, then
2
(Bodirsky et al., 10 Oct 2025). Perfect graphs satisfy this framework: they are hereditary, their minimal obstructions are odd holes and odd antiholes, and those obstructions are point-determining, which yields the required blow-up closure (Bodirsky et al., 10 Oct 2025).
Accordingly, the Perfect Sandwich Problem is a CSP for some infinite 3-edge-coloured graph 4 (Bodirsky et al., 10 Oct 2025). The importance of this reformulation is conceptual rather than merely notational. It moves the problem into infinite-domain CSP theory, where pp-constructions, polymorphisms, and Datalog-style tractability criteria become relevant. At present, however, this representation has not produced a full complexity dichotomy for perfect graphs themselves; the corresponding polymorphism structure is not yet understood well enough to decide the open 5 versus NP-hardness question (Bodirsky et al., 10 Oct 2025).
4. Complexity landscape and classified subclasses
The general Perfect Sandwich Problem remains open, but several natural bounded or hereditary subclasses have been completely classified (Bodirsky et al., 10 Oct 2025). The sharpest result concerns clique-bounded perfect graphs.
| Class | 6 | 7 |
|---|---|---|
| 8-free perfect graphs | in 9 | NP-complete |
| 0-free graphs | in 1 | NP-complete |
| 2-free graphs | in 3 | NP-complete |
All of these problems are in 4 because recognition of the corresponding classes is polynomial-time (Bodirsky et al., 10 Oct 2025).
For 5-free perfect graphs, the threshold at 6 is structural. 7-free perfect graphs are exactly bipartite graphs, so the only nontrivial tractable bounded-clique perfect case is the bipartite sandwich problem (Bodirsky et al., 10 Oct 2025). Once 8, NP-completeness follows from a general theorem for classes of the form 9-free when every 0-free graph is perfect (Bodirsky et al., 10 Oct 2025).
The same framework yields hardness for several nearby hereditary classes. In particular, the sandwich problem for 1-free graphs is NP-complete, resolving an open problem of Alvarado, Dantas, and Rautenbach (2019), and 2 is NP-complete for all 3, with 4-free already NP-complete for every 5 (Bodirsky et al., 10 Oct 2025).
These results are notable because they show that restricting perfect graphs by forbidding large cliques or simple induced subgraphs does not generally simplify the sandwich problem. They also delimit the open case: the unresolved difficulty is specifically the unbounded-clique class of all perfect graphs. This remains striking given that sandwich problems for odd-hole-free and even-hole-free graphs are already known to be NP-complete, while the simultaneous odd-hole-free and odd-antihole-free case has not been classified (Erdem et al., 29 Jul 2025).
5. Exact algorithms and integer programming
Although the asymptotic complexity is open, exact algorithmic methods now exist for substantial finite instances (Erdem et al., 29 Jul 2025). The main approach is an integer programming model based directly on the Strong Perfect Graph Theorem. For each unordered vertex pair 6, a binary variable 7 records whether that pair is an edge in the output graph. Perfectness is enforced by forbidding every odd-hole configuration 8 and every odd-antihole configuration 9 through inequalities of the form
0
and analogously for odd antiholes (Erdem et al., 29 Jul 2025).
For the Perfect Sandwich Problem specifically, the model uses variables only for optional edges 1; mandatory edges are fixed to 2, forbidden edges to 3, and the ILP is solved as a pure feasibility problem rather than an optimization problem (Erdem et al., 29 Jul 2025). A cutting-plane algorithm starts with few constraints, solves the current master problem, explicitly searches the candidate graph for odd holes and odd antiholes, adds the violated inequalities, and repeats (Erdem et al., 29 Jul 2025).
A problem-specific preprocessing step, Precheck, detects obvious infeasibility. If the input graph already contains an odd hole or odd antihole that cannot be destroyed by adding any optional chord, the instance is immediately rejected (Erdem et al., 29 Jul 2025). This is specific to sandwich instances, because edges may be added only within 4, and no deletions are allowed.
The reported computational study used Erdős–Rényi inputs and solved random perfect sandwich instances up to about 5 vertices (Erdem et al., 29 Jul 2025). The empirical pattern was strongly monotone in the optional-edge density: with optional density 6, all instances were infeasible; with optional density 7, feasible instances were extremely rare, occurring only twice and only at input density 8; the main experiments therefore concentrated on optional densities 9, 0, and 1 (Erdem et al., 29 Jul 2025). Larger graphs were less likely to admit perfect sandwiches, whereas denser optional sets and denser input graphs made feasibility more common (Erdem et al., 29 Jul 2025). These are algorithmic and experimental results rather than complexity-theoretic ones, but they constitute the first exact general framework for nontrivial perfect sandwich instances (Erdem et al., 29 Jul 2025).
6. Related uses and neighboring sandwich problems
The graph-theoretic Perfect Sandwich Problem should be distinguished from several adjacent uses of the phrase. In the matrix-partition literature, “perfect sandwich” is not a standard technical term, but the analogous decision problem is the sandwich problem for 2-partitions: given lower and upper graphs, does some intermediate graph admit an 3-partition? For this class, there is a complete 4 versus NP-complete classification via CSPs of reflexive complete 5-edge-coloured graphs, and the dichotomy is polynomial-time checkable from the matrix 6 (Barsukov et al., 10 Feb 2026). That problem is structurally close to graph sandwiching, but it is not the same as sandwiching into perfect graphs.
A distinct informal usage appears in geometric partition theory. There, “perfect sandwich” can refer to exact or prescribed hyperplane cuts of multiple ingredients, as in the discrete Ham Sandwich problem and the 7-Ham-Sandwich theorem. The discrete Ham Sandwich problem and 8-thief necklace splitting are PPA-complete (Filos-Ratsikas et al., 2018), whereas the 9-Ham-Sandwich search problem, under well-separated input and uniqueness assumptions, lies in UEOPL (Chiu et al., 2020). Subsequent work gave combinatorial and topological proofs of the 0-Ham-Sandwich theorem using grid unique sink orientations and rainbow arrangements, and showed that realizability of rainbow arrangements and realizability of grid USOs are 1-complete (Borzechowski et al., 11 Feb 2026). These problems share the theme of interpolating between lower and upper structural constraints, but they belong to a different research lineage than the Perfect Sandwich Problem for perfect graphs.
In perfect-graph algorithmics, another neighboring motif is the use of Lovász’s sandwich theorem rather than graph sandwich problems proper. For weak modular products, if the product graph is perfect, then the clique number, Lovász number, and chromatic number coincide, which yields polynomial-time graph isomorphism testing for those cases; a complete classification of when the weak modular product is perfect shows, however, that all such instances already fall into graph classes with polynomial-time isomorphism algorithms (Dervovic, 2018). This is again a “perfect sandwich” viewpoint, but not the technical Perfect Sandwich Problem.
The modern literature therefore uses the phrase in more than one way. In the precise technical sense, however, the Perfect Sandwich Problem remains the open decision problem of completing a partial graph specification to a perfect graph, and its importance lies in the unresolved gap between strong structural theory, powerful CSP reductions, exact exponential-time methods, and the absence of a final complexity classification (Bodirsky et al., 10 Oct 2025, Erdem et al., 29 Jul 2025).