---
title: Quasi-Hamiltonian Path Problem Overview
url: https://www.emergentmind.com/topics/quasi-hamiltonian-path-problem
type: topic
---

# Quasi-Hamiltonian Path Problem Overview

Searching arXiv for recent papers on the quasi-Hamiltonian path problem and closely related formulations.
The quasi-Hamiltonian path problem concerns directed paths that cover every color-class of a semicomplete multipartite digraph at least once. For a semicomplete multipartite digraph \(D=(V,A)\) with unique partition \(C(D)=\{V_1,\dots,V_c\}\) into maximal independent sets and independence number \(\alpha(D)=\max\{|V_1|,\dots,|V_c|\}\), a directed path \(P\) is quasi-Hamiltonian if, for every color-class \(V_i\in C(D)\), \(1\le |V(P)\cap V_i|\le |V_i|\). When \(\alpha(D)=1\), this notion coincides with the usual Hamiltonian-path notion. Every semicomplete multipartite digraph contains a quasi-Hamiltonian path, but deciding whether there exists such a path with prescribed start and end vertices is NP-complete even for semicomplete multipartite digraphs with independence number exactly \(3\) [2507.15667].

## 1. Formal setting and basic notions

In the semicomplete multipartite setting, the vertex set is partitioned into maximal independent sets, also called color-classes or parts. The partition is unique and is denoted
\[
C(D)=\{V_1,\dots,V_c\},
\]
with
\[
\alpha(D)=\max\{|V_1|,\dots,|V_c|\}.
\]
A quasi-Hamiltonian path is therefore not required to visit every vertex; it is required to meet every color-class at least once. Equivalently, for each \(V_i\in C(D)\),
\[
1\le |V(P)\cap V_i|\le |V_i|.
\]
This distinction is central: in a multipartite digraph, quasi-Hamiltonicity is a coverage condition over parts rather than a vertex-exhaustion condition over \(V\) [2507.15667].

The principal decision version is the \((s,t)\)-QHP problem. Given an SMD \(D=(V,A)\) and specified vertices \(s,t\in V\), the question is whether there exists an \((s,t)\)-path \(P\) such that for every color-class \(C\in C(D)\),
\[
1\le |V(P)\cap C|\le |C|.
\]
Because every semicomplete multipartite digraph contains a quasi-Hamiltonian path, the endpoint-constrained formulation is the nontrivial algorithmic variant. A common misconception is to treat QHP as merely a relaxed Hamiltonian-path problem; the definition shows that the object being covered is the set of color-classes, not necessarily the whole vertex set.

## 2. The \((a,b,\alpha)\)-color-constrained framework

A broader formulation introduced for semicomplete multipartite digraphs is the \((a,b,\alpha)\)-color-constrained path problem, abbreviated \((a,b,\alpha)\)-CCP. An instance consists of an SMD \(D=(V,A)\) in which all color-classes have the same size \(\alpha\), two vertices \(s,t\in V\), and the question whether there exists an \((s,t)\)-path \(P\) satisfying
\[
a\le |V(P)\cap C|\le b
\]
for every color-class \(C\in C(D)\) [2507.15667].

This framework subsumes several standard and nonstandard path problems. Choosing \((a,b,\alpha)=(1,1,1)\) recovers the Hamiltonian-path problem in tournaments. Choosing \((a,b,\alpha)=(1,\alpha,\alpha)\) yields the quasi-Hamiltonian path problem for general SMDs. Choosing \((a,b,\alpha)=(0,\alpha-1,\alpha)\) enforces that each part loses at least one vertex in the path. The framework also captures the path-version of cycle problems discussed in the same line of work. A plausible implication is that the main combinatorial source of difficulty is not multipartiteness alone, but the interaction between path routing and lower/upper coverage bounds imposed on each color-class.

## 3. Complexity landscape

The main dichotomy for \((a,b,\alpha)\)-CCP is nearly complete. If either \((a,b)=(0,\alpha)\) or \(\alpha=1\), then \((a,b,\alpha)\)-CCP is solvable in polynomial time. Otherwise, if \(\alpha\ge 3\) and \((a,b)\notin\{(0,\alpha),(\alpha,\alpha)\}\), then \((a,b,\alpha)\)-CCP is NP-complete. For every fixed \(\alpha\ge 3\), all pairs \((a,b)\) with \(0\le a\le b\le \alpha\), except the trivial reachability case \((0,\alpha)\) and the pure Hamiltonian case \((\alpha,\alpha)\), yield NP-complete \((a,b,\alpha)\)-CCP [2507.15667].

| Setting | Complexity status | Remarks |
|---|---|---|
| \((0,\alpha,\alpha)\)-CCP | Polynomial time | Reachability |
| \(\alpha=1\) | Polynomial time | Tournaments; \((1,1,1)\) solved in \(O(n^5)\) |
| Fixed \(\alpha\ge 3\), \((a,b)\notin\{(0,\alpha),(\alpha,\alpha)\}\) | NP-complete | Nearly complete dichotomy |

Specializing to quasi-Hamiltonian paths gives a standalone hardness result: deciding whether an SMD \(D\) with \(\alpha(D)=3\) admits an \((s,t)\)-quasi-Hamiltonian path is NP-complete. This clarifies an otherwise potentially misleading point: the unrestricted existence of a quasi-Hamiltonian path in an SMD is guaranteed, but the endpoint-prescribed version remains computationally difficult already at independence number \(3\). Notable open problems are the Hamiltonian path problem on semicomplete multipartite digraphs and the quasi-Hamiltonian path problem restricted to semicomplete multipartite digraphs with independence number \(2\).

## 4. Reduction mechanisms for NP-completeness

For \(\alpha=3\), hardness is obtained by reductions from \(1\)-in-\(3\)-SAT or more general \((a,b)\)-\(3\)-SAT variants. The core construction uses variable gadgets that force a binary routing choice and clause color-classes whose bounded-coverage constraints enforce the corresponding satisfiability condition [2507.15667].

When \(b\le 2\), the reduction uses a \(B\)-gadget \(B[s^i,t^i,p_i,q_i]\). This gadget has exactly two internally vertex-disjoint paths from \(s^i\) to \(t^i\), one visiting a \(y\)-chain of length \(p_i\) and one visiting a \(z\)-chain of length \(q_i+1\), arranged so that no \((s^i,t^i)\)-path can mix \(y\)- and \(z\)-vertices. By coloring these vertex-sets together with an extra dummy vertex, the construction keeps color-classes of size at most \(3\). For the case \(b=3\), the reduction uses the classical \(W\)-gadget of Bang-Jensen, Maddaloni and Simonsen, which again has exactly two natural \((s^i,t^i)\)-subpaths, through the \(T\)-clique or the \(F\)-clique.

Clause enforcement is handled by turning each clause \(C_j\) into a color-class whose three vertices correspond to three literal appearances in appropriate gadget positions. The covering bounds then force that each clause-class contributes between \(a\) and \(b\) hits. Chaining is achieved by identifying \(t^i\) with \(s^{i+1}\), or by adding an explicit arc, so that any global \((s,t)\)-path must traverse the variable gadgets in sequence. The analysis shows that any valid \((s,t)\)-path induces a truth assignment by selecting exactly one route through each gadget, and conversely any assignment with the desired clause-counts yields a path.

The extension from \(\alpha=3\) to \(\alpha\ge 4\) is obtained by padding with new dummy vertices and a small inductive gadget that increases every color-class by one while incrementing both \(a\) and \(b\) by \(1\). This gives the lifting step required for the full dichotomy.

## 5. Structural results for independence number at most \(2\)

For \(\alpha(D)\le 2\), the known NP-hardness reductions do not apply; the constructions inherently need parts of size \(3\). In this regime, the literature develops sufficient conditions for the existence of quasi-Hamiltonian \((x,y)\)-paths in \(2\)-strong SMDs, closely paralleling classical tournament arguments [2507.15667].

One theorem states that if \(D\) is a \(2\)-strong SMD, \(x,y,z\) are distinct vertices, neither \(x\) nor \(y\) lies in any \(2\)-cycle, both \(D-x\) and \(D-y\) remain \(2\)-strong, \(D-\{x,y,z\}\) is not \(2\)-strong, and \(\chi(D-\{x,y,z\})\ge 4\), then \(D\) contains an \((x,y)\)-quasi-Hamiltonian path. Another theorem states that if \(D\) is a \(2\)-strong SMD with \(|V|\ge 5+5\alpha(D)\) and \(\alpha(D)\le 2\), \(x,y\) are distinct vertices, neither lies in a \(2\)-cycle, \(y\Rightarrow x\), \(D-x\) and \(D-y\) remain \(2\)-strong, and every \(2\)-separator of \(x\) and \(y\) is trivial, then \(D\) has an \((x,y)\)-quasi-Hamiltonian path.

The associated proof sketches use longest quasi-Hamiltonian paths, linear-decomposition, arc-shortcut arguments, merging lemmas, and the “\(3\)-internally-disjoint-paths \(\Rightarrow\) QHP” condition. Although no full polynomial-time algorithm is given for QHP when \(\alpha(D)=2\), the structural theorems mirror the key steps in the \(O(n^5)\) algorithm of Bang-Jensen–Manoussakis–Thomassen for tournaments. The stated algorithmic consequence is therefore suggestive rather than definitive: QHP in SMDs with \(\alpha\le 2\) may be decidable in polynomial time by recursively reducing to smaller digraphs, checking \(2\)-strong connectivity, enumerating \(2\)-separators, and applying merging and linear-decomposition in \(O(n^2)\) or \(O(n^5)\) time.

## 6. Relations to Hamiltonian path and adjacent formulations

For independence number at most \(2\), Hamiltonian-path structure is substantially sharper than the current quasi-Hamiltonian picture. A biorientation of the complete graph minus a disjoint union of paths of length at most \(2\) is unilaterally connected if and only if it has a Hamiltonian path. Applied to SMDs with \(\alpha(D)\le 2\), this yields the corollary that a semicomplete multipartite digraph \(D\) with \(\alpha(D)\le 2\) is unilaterally connected if and only if it has a Hamiltonian path. Hence the Hamiltonian-path problem in this regime can be solved in \(O(n^2)\) time by checking unilateral connectivity via linear-decomposition [2507.15667].

An adjacent but distinct line of work studies Hamiltonian paths and cycles with precedence constraints given by a partial order on the vertex set. In that model, one asks for a Hamiltonian path or cycle whose vertex order extends a partial order \(\le_P\). For the path problem, a permutation \(\pi\) is a \(\pi\)-extension of \(\le_P\) if \(u\le_P v\Rightarrow \pi(u)<\pi(v)\), and the path must visit each vertex exactly once along graph edges while respecting this extension. This is not the same as quasi-Hamiltonian color-class coverage. The width-theoretic results are correspondingly different: POHPP is NP-complete for graphs of pathwidth \(4\), polynomial-time solvable on graphs of pathwidth \(3\) and treewidth \(2\), and NP-complete on rectangular grid graphs of height at least \(7\) [2506.23790].

## 7. Open questions

The boundary cases left unresolved are structurally narrow but conceptually important. The \((s,t)\)-Hamiltonian-path problem in semicomplete multipartite digraphs of unbounded \(\alpha(D)\), corresponding to the case \((a,b,\alpha)=(\alpha,\alpha,\alpha)\), is not known to be in \(P\) nor shown NP-complete. The pure quasi-Hamiltonian path problem on SMDs with \(\alpha(D)=2\) also remains open: neither hardness nor a complete polynomial-time algorithm is currently available [2507.15667].

Within the Schaefer-style classification, the small cases \((1,1,2)\) and \((1,2,2)\) remain unclassified beyond the Hamiltonian-path case. Closing these gaps would complete the complexity map of \((a,b,\alpha)\)-CCP. The present structural evidence for \(\alpha(D)\le 2\) suggests a possible polynomial-time theory, but that implication remains provisional rather than established.

Source: https://www.emergentmind.com/topics/quasi-hamiltonian-path-problem