Papers
Topics
Authors
Recent
Search
2000 character limit reached

Median-Closed Semilinear Constraints

Updated 7 July 2026
  • Median-closed semilinear constraints are defined by semilinear relations preserved by the coordinatewise median, forming a tractable class for CSPs over ℚ.
  • Their characterization via bijunctive formulas called 'bends' enables efficient variable elimination and strong polynomial-time decision procedures.
  • The work establishes a sharp tractability boundary, as adding non-median-preserving relations leads to NP-hardness in semilinear CSPs.

Median-closed semilinear constraints are semilinear relations over the rationals that are preserved by the coordinatewise median operation. In the setting of constraint satisfaction problems (CSPs) over Q\mathbb{Q}, they define a natural non-convex tractable class strictly larger than the convex semilinear case. Semilinear relations are exactly Boolean combinations of linear half-spaces, and convex semilinear relations are precisely those preserved by taking averages. The central result for median-closed semilinear constraints is that their CSP admits a polynomial-time, indeed strongly polynomial, decision procedure, while any proper semilinear expansion by a relation not preserved by median yields NP-hardness. This places median-closure at a sharp tractability boundary for a large family of linear-arithmetic constraints (Bodirsky et al., 2018).

1. Formal setting and basic definitions

The domain is Q\mathbb{Q}. A kk-ary relation RQkR \subseteq \mathbb{Q}^k is semilinear if it is definable by a quantifier-free formula over (Q;+,1,)(\mathbb{Q}; +,1,\leq); equivalently, it is a finite Boolean combination of closed half-spaces. A typical presentation is

R=ij(aijxbij),R = \bigvee_i \bigwedge_j \left(a_{ij}^{\top} x \leq b_{ij}\right),

with rational vectors aija_{ij} and rational scalars bijb_{ij}.

For x,y,zQnx,y,z \in \mathbb{Q}^n, the coordinatewise median is defined by

med(x,y,z)k=median(xk,yk,zk),\operatorname{med}(x,y,z)_k = \operatorname{median}(x_k,y_k,z_k),

where Q\mathbb{Q}0 is the middle element of Q\mathbb{Q}1. A relation Q\mathbb{Q}2 is median-closed if Q\mathbb{Q}3 implies Q\mathbb{Q}4. Equivalently, Q\mathbb{Q}5 is a polymorphism of the relational structure whose relations include Q\mathbb{Q}6 (Bodirsky et al., 2018).

This notion sits between purely geometric and algebraic viewpoints. On the geometric side, semilinear sets generalize polyhedra by allowing arbitrary Boolean combinations of linear inequalities. On the algebraic side, preservation by median is a polymorphism condition that constrains allowable relations. The resulting class is non-convex in general, but still structurally rigid enough to support a polynomial-time CSP algorithm.

2. Relation to convexity and representative examples

Convex semilinear relations form the classical tractable case: their CSP is polynomial-time equivalent to linear programming. In this setting, convexity is characterized by preservation under averaging. Median-closed semilinear relations properly generalize this class, showing that tractability is not confined to convexity (Bodirsky et al., 2018).

The paper identifies several important examples contained in the median-closed class. These include all TVPI constraints, that is, linear inequalities of the form Q\mathbb{Q}7 with at most two variables per inequality. They also include unary constraints Q\mathbb{Q}8 for arbitrary finite Q\mathbb{Q}9; for instance, kk0 can be enforced by a formula such as kk1. Another family consists of disjunctive bounds such as kk2, or more generally kk3, where each comparison symbol can be one of kk4.

These examples are significant because none of them need be convex. Finite-domain-like unary restrictions and simple disjunctions of bounds are typically outside the convex framework, yet they remain median-invariant. A plausible implication is that median-closure captures a robust form of “discrete-looking” structure inside rational semilinear geometry without requiring integrality constraints, whose addition is known to render the problem NP-complete.

3. Bijunctive structure and the role of bends

The tractability proof begins by exploiting the fact that the coordinatewise median is a majority operation, satisfying identities such as kk5. In the infinite-domain universal-algebraic theory, invariance under a majority operation implies 2-decomposability. In the semilinear setting, this yields a concrete syntactic characterization: a semilinear relation kk6 is median-closed if and only if it can be expressed as a conjunction of “bends” (Bodirsky et al., 2018).

A bend is a formula of the form

kk7

where each bound kk8 is one of kk9, RQkR \subseteq \mathbb{Q}^k0, RQkR \subseteq \mathbb{Q}^k1, or RQkR \subseteq \mathbb{Q}^k2, and where RQkR \subseteq \mathbb{Q}^k3. In effect, bends provide a bijunctive syntax for median-closed semilinear constraints.

For higher arity, a median-closed RQkR \subseteq \mathbb{Q}^k4-ary relation decomposes into 2-ary projections of this form together with possible unary bounds. The algorithmic consequence is that satisfiability can be decided by working with these bijunctive constraints. This is the structural core of the result: the polymorphism condition is translated into a normal form that supports propagation and elimination.

The significance of this characterization extends beyond syntax. It identifies a precise analogue, for semilinear relations over RQkR \subseteq \mathbb{Q}^k5, of the role that bijunctive formulas play in finite-domain CSP classifications. This suggests a Schaefer-style perspective in which median is the governing polymorphism of a maximal tractable non-convex class.

4. Polynomial-time algorithm

The algorithm generalizes classical work on TVPI feasibility by Aspvall–Shiloach and Hochbaum–Naor, which in turn relies on Shostak’s characterization of unsatisfiable TVPI systems via certain cycles and paths. For general bends, the paper introduces the notion of a “handcuff”: two cycles of bends attached by a path. Its key theorem states that a conjunction of bends is satisfiable if and only if it is free of handcuff refutations (Bodirsky et al., 2018).

On top of this characterization, the paper defines a strongly polynomial subroutine RQkR \subseteq \mathbb{Q}^k6 for a satisfiable set RQkR \subseteq \mathbb{Q}^k7 of bends. The subroutine decides in RQkR \subseteq \mathbb{Q}^k8 arithmetic steps whether RQkR \subseteq \mathbb{Q}^k9 remains satisfiable, where (Q;+,1,)(\mathbb{Q}; +,1,\leq)0 is the number of variables and (Q;+,1,)(\mathbb{Q}; +,1,\leq)1 the number of bends. The mechanism alternates between two operations. First, bound propagation derives stronger bounds on one variable from a bend and a current bound on another variable. Second, cycle detection analyzes a closed propagation cycle at some variable (Q;+,1,)(\mathbb{Q}; +,1,\leq)2 by computing the corresponding residue bend and using it to strengthen the bound at (Q;+,1,)(\mathbb{Q}; +,1,\leq)3. If no contradiction arises after (Q;+,1,)(\mathbb{Q}; +,1,\leq)4 rounds, the instance is handcuff-consistent and hence globally satisfiable.

This propagation procedure is embedded into a variable-elimination scheme in the style of Hochbaum–Naor. For a chosen variable (Q;+,1,)(\mathbb{Q}; +,1,\leq)5, one computes the breakpoints

(Q;+,1,)(\mathbb{Q}; +,1,\leq)6

at which the strongest disjunct in a bend involving (Q;+,1,)(\mathbb{Q}; +,1,\leq)7 can change, and then performs a binary search over the set (Q;+,1,)(\mathbb{Q}; +,1,\leq)8 to find the largest (Q;+,1,)(\mathbb{Q}; +,1,\leq)9 such that R=ij(aijxbij),R = \bigvee_i \bigwedge_j \left(a_{ij}^{\top} x \leq b_{ij}\right),0 is still satisfiable. On the interval R=ij(aijxbij),R = \bigvee_i \bigwedge_j \left(a_{ij}^{\top} x \leq b_{ij}\right),1, every bend involving R=ij(aijxbij),R = \bigvee_i \bigwedge_j \left(a_{ij}^{\top} x \leq b_{ij}\right),2 reduces to one of its three disjuncts, so R=ij(aijxbij),R = \bigvee_i \bigwedge_j \left(a_{ij}^{\top} x \leq b_{ij}\right),3 appears only in linear inequalities or trivial bounds. One can then eliminate R=ij(aijxbij),R = \bigvee_i \bigwedge_j \left(a_{ij}^{\top} x \leq b_{ij}\right),4 by Fourier–Motzkin elimination in quadratic time in the number of remaining bends.

No new breakpoints are created, and there are R=ij(aijxbij),R = \bigvee_i \bigwedge_j \left(a_{ij}^{\top} x \leq b_{ij}\right),5 propagation calls per eliminated variable. Since each propagation call costs R=ij(aijxbij),R = \bigvee_i \bigwedge_j \left(a_{ij}^{\top} x \leq b_{ij}\right),6 arithmetic operations and elimination contributes an additional R=ij(aijxbij),R = \bigvee_i \bigwedge_j \left(a_{ij}^{\top} x \leq b_{ij}\right),7 work overall, the full algorithm is strongly polynomial, essentially R=ij(aijxbij),R = \bigvee_i \bigwedge_j \left(a_{ij}^{\top} x \leq b_{ij}\right),8. The paper also states that the arithmetic is performed on input numbers of size R=ij(aijxbij),R = \bigvee_i \bigwedge_j \left(a_{ij}^{\top} x \leq b_{ij}\right),9.

5. Maximal tractability and the hardness boundary

The tractability result is maximal in the semilinear setting. If aija_{ij}0 is a semilinear relation not preserved by median, then there exist tuples aija_{ij}1 whose coordinatewise median lies outside aija_{ij}2. Let aija_{ij}3 be the finite set of all coordinates appearing in these tuples. Restricting aija_{ij}4 to aija_{ij}5 produces a finite-domain relation aija_{ij}6 that is not preserved by the median polymorphism on aija_{ij}7 (Bodirsky et al., 2018).

The argument then invokes finite-domain clone theory and CSP complexity. On any finite linearly ordered domain aija_{ij}8, the clone generated by median is a minimal majority clone, and adjoining any relation that violates median-invariance yields an NP-hard finite-domain CSP. The paper cites this in connection with work of Pöschel–Kalužnin and Bulatov–Jeavons–Krokhin. By embedding the resulting finite language back into aija_{ij}9, it follows that

bijb_{ij}0

is already NP-hard.

In this sense, median-closed semilinear relations form a maximal tractable class: one cannot enlarge the class by adding any non-median-closed semilinear relation without crossing into NP-hardness. This is stronger than merely proving that a particular algorithm works; it identifies an exact frontier. A common oversimplification is to treat semilinear CSP tractability over bijb_{ij}1 as essentially equivalent to convexity. The maximality theorem shows that there exists a larger, natural non-convex region of tractability, but only up to the median boundary.

The result fits into a broader program of classifying the complexity of semilinear constraint languages over bijb_{ij}2. The paper explicitly places it alongside the search for an infinite-domain analogue of Schaefer-style classifications and notes the parallel with the finite-domain dichotomy associated with Bulatov and Zhuk (Bodirsky et al., 2018).

One implication concerns the relationship with linear programming. Convex semilinear CSPs are exactly those preserved by the averaging operation bijb_{ij}3, and their complexity is polynomial-time equivalent to linear programming. Median-closed constraints strictly extend this convex regime while remaining in bijb_{ij}4. This separates the geometric notion of convexity from the algebraic notion of median preservation and shows that the latter can still support efficient decision procedures.

Another implication concerns submodularity in the valued-CSP setting. The paper states that submodular cost functions on bijb_{ij}5 must have supports preserved by both bijb_{ij}6 and bijb_{ij}7, and therefore also by median. Consequently, the feasibility part of submodular semilinear VCSPs reduces to a median-closed semilinear CSP and is polynomial-time solvable.

The paper also records an open problem: whether similarly maximal tractable classes exist for max-closed or min-closed semilinear relations. Each of these classes strictly contains the median-closed one, but their tractability remains unresolved. This suggests that the median case is both a completed classification point and a benchmark for subsequent work on broader non-convex semilinear polymorphism classes.

Definition Search Book Streamline Icon: https://streamlinehq.com
References (1)

Topic to Video (Beta)

No one has generated a video about this topic yet.

Whiteboard

No one has generated a whiteboard explanation for this topic yet.

Follow Topic

Get notified by email when new papers are published related to Median-Closed Semilinear Constraints.