---
title: Perfect Sandwich Problem in Graphs
url: https://www.emergentmind.com/topics/perfect-sandwich-problem
type: topic
---

# Perfect Sandwich Problem in Graphs

The **Perfect Sandwich Problem** is the graph sandwich problem for the class of **perfect graphs**: given two graphs on the same vertex set, \(G_1=(V,E_1)\) and \(G_2=(V,E_2)\) with \(E_1\subseteq E_2\), determine whether there exists an intermediate graph \(G=(V,E)\) such that \(E_1\subseteq E\subseteq E_2\) and \(G\) is perfect [2510.09128][2507.21987]. 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 \(P\) nor known to be NP-hard [2510.09128].

## 1. Formal definition and equivalent encodings

For a graph class \(\mathcal C\), the sandwich problem \(\mathrm{SP}(\mathcal C)\) asks whether an input pair \((V,E_1)\), \((V,E_2)\) with \(E_1\subseteq E_2\) admits some \(E\) satisfying
\[
E_1 \subseteq E \subseteq E_2
\]
such that \((V,E)\in\mathcal C\) [2510.09128]. When \(\mathcal C\) is the class of perfect graphs, \(\mathrm{SP}(\mathcal C)\) is the Perfect Sandwich Problem [2510.09128].

An equivalent formulation uses a triple \((V,E,N)\), where \(E\) is the set of forced edges, \(N\) is the set of forbidden edges, \(E\cap N=\varnothing\), and all remaining pairs are free [2510.09128]. In this encoding, the question is whether there exists a graph \((V,E')\) such that \(E\subseteq E'\), \(E'\cap N=\varnothing\), and \((V,E')\) is perfect.

This formulation places the problem between several better-known modification problems. If \(E_2\) is the complete graph, the problem becomes **perfect completion**; if \(E_1=E_2\), 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 [2507.21987].

## 2. Perfect graphs and obstruction theory

A graph \(G\) is **perfect** if every induced subgraph \(H\subseteq G\) satisfies
\[
\chi(H)=\omega(H),
\]
where \(\chi\) is chromatic number and \(\omega\) is clique number [2507.21987]. 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 [2507.21987].

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 [2507.21987].

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 [2510.09128]. 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 [2510.09128]. For a graph \(H\), one forms the complete \(2\)-edge-coloured graph \(H^\ast\) whose blue edges are the adjacencies of \(H\) and whose red edges are its non-adjacencies. The injective CSP of \(H^\ast\) coincides with the sandwich problem for the class \(\mathrm{Age}(H)\) of finite induced subgraphs of \(H\) [2510.09128].

More generally, if a graph class \(\mathcal C\) is hereditary, has the joint embedding property, is preserved by split blow-ups, and has a universal graph \(H\in\mathcal C\), then
\[
\mathrm{SP}(\mathcal C)=\mathrm{injCSP}(H^\ast)=\mathrm{CSP}(H^\ast)
\]
[2510.09128]. 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 [2510.09128].

Accordingly, the Perfect Sandwich Problem is a CSP for some infinite \(2\)-edge-coloured graph \(H^\ast\) [2510.09128]. 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 \(P\) versus NP-hardness question [2510.09128].

## 4. Complexity landscape and classified subclasses

The general Perfect Sandwich Problem remains open, but several natural bounded or hereditary subclasses have been completely classified [2510.09128]. The sharpest result concerns clique-bounded perfect graphs.

| Class | \(k\le 3\) | \(k\ge 4\) |
|---|---|---|
| \(K_k\)-free perfect graphs | in \(P\) | NP-complete |
| \(\{P_4,K_k\}\)-free graphs | in \(P\) | NP-complete |
| \(\{P_4,I_k\}\)-free graphs | in \(P\) | NP-complete |

All of these problems are in \(NP\) because recognition of the corresponding classes is polynomial-time [2510.09128].

For \(K_k\)-free perfect graphs, the threshold at \(k=3\) is structural. \(K_3\)-free perfect graphs are exactly bipartite graphs, so the only nontrivial tractable bounded-clique perfect case is the bipartite sandwich problem [2510.09128]. Once \(k\ge 4\), NP-completeness follows from a general theorem for classes of the form \((\mathcal F\cup\{K_k\})\)-free when every \(\mathcal F\)-free graph is perfect [2510.09128].

The same framework yields hardness for several nearby hereditary classes. In particular, the sandwich problem for \(\{I_4,P_4\}\)-free graphs is NP-complete, resolving an open problem of Alvarado, Dantas, and Rautenbach (2019), and \(\mathrm{SP}(\{P_n,K_k\}\text{-free})\) is NP-complete for all \(n,k\ge 4\), with \(\{P_5,K_k\}\)-free already NP-complete for every \(k\ge 3\) [2510.09128].

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 [2507.21987].

## 5. Exact algorithms and integer programming

Although the asymptotic complexity is open, exact algorithmic methods now exist for substantial finite instances [2507.21987]. The main approach is an integer programming model based directly on the Strong Perfect Graph Theorem. For each unordered vertex pair \(\{i,j\}\), a binary variable \(x_{ij}\) records whether that pair is an edge in the output graph. Perfectness is enforced by forbidding every odd-hole configuration \(S\) and every odd-antihole configuration \(\overline S\) through inequalities of the form
\[
\sum_{\{i,j\}\in E(S)}(1-x_{ij})+\sum_{\{i,j\}\in \overline E(S)}x_{ij}\ge 1,
\]
and analogously for odd antiholes [2507.21987].

For the Perfect Sandwich Problem specifically, the model uses variables only for optional edges \(E_2\setminus E_1\); mandatory edges are fixed to \(1\), forbidden edges to \(0\), and the ILP is solved as a pure feasibility problem rather than an optimization problem [2507.21987]. 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 [2507.21987].

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 [2507.21987]. This is specific to sandwich instances, because edges may be added only within \(E_2\setminus E_1\), and no deletions are allowed.

The reported computational study used Erdős–Rényi inputs and solved random perfect sandwich instances up to about \(130\) vertices [2507.21987]. The empirical pattern was strongly monotone in the optional-edge density: with optional density \(0.25\), all instances were infeasible; with optional density \(0.50\), feasible instances were extremely rare, occurring only twice and only at input density \(0.75\); the main experiments therefore concentrated on optional densities \(0.70\), \(0.80\), and \(0.90\) [2507.21987]. Larger graphs were less likely to admit perfect sandwiches, whereas denser optional sets and denser input graphs made feasibility more common [2507.21987]. These are algorithmic and experimental results rather than complexity-theoretic ones, but they constitute the first exact general framework for nontrivial perfect sandwich instances [2507.21987].

## 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 \(M\)-partitions: given lower and upper graphs, does some intermediate graph admit an \(M\)-partition? For this class, there is a complete \(P\) versus NP-complete classification via CSPs of reflexive complete \(2\)-edge-coloured graphs, and the dichotomy is polynomial-time checkable from the matrix \(M\) [2602.09576]. 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 \(\alpha\)-Ham-Sandwich theorem. The discrete Ham Sandwich problem and \(2\)-thief necklace splitting are PPA-complete [1805.12559], whereas the \(\alpha\)-Ham-Sandwich search problem, under well-separated input and uniqueness assumptions, lies in UEOPL [2003.09266]. Subsequent work gave combinatorial and topological proofs of the \(\alpha\)-Ham-Sandwich theorem using grid unique sink orientations and rainbow arrangements, and showed that realizability of rainbow arrangements and realizability of grid USOs are \(\exists\mathbb{R}\)-complete [2602.10795]. 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 [1809.09939]. 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 [2510.09128][2507.21987].

Source: https://www.emergentmind.com/topics/perfect-sandwich-problem