The big three encoding problems
The big three encoding problems are:
- Boolean satisfiability (SAT);
- Constraint Satisfaction Problem (CSP);
- Integer Linear Programming (ILP).
There is nothing particularly special about these problems with respect to NP-complete problems.
Constraint Satisfaction Problem
Instance
A CSP instance is a triple
where:
- is a finite set of variables;
- is a finite set of values, called the domain;
- is a finite set of constraints.
Each constraint consists of:
- a scope with ;
- a relation .
Thus, a constraint is a pair specifying which tuples of values are allowed on the variables in its scope.
Satisfying an instance
An assignment satisfies a CSP instance if, for every constraint ,
The CSP asks whether the input instance is satisfiable.
3-colouring
For a graph, 3-colouring can be encoded as a CSP with one variable for every vertex and one binary inequality constraint for every edge.
The relation for every edge is
For the graph below,
where has scope and relation .
3-SAT
Encode the formula
The CSP instance has
and one constraint for the clause:
where
In the shorthand notation of the clause, : there is one constraint for each clause, and here there is only one clause in .
SAT
Given a propositional formula
we obtain the CSP instance
Each clause is represented by a constraint relation over the variables occurring in that clause.
Dichotomy theorem
Definition
Link to originalDichotomy Theorem (Constraint Satisfaction)
For every finite domain and finite constraint language over ,
Here, is fixed and contains the CSP instances whose constraint relations belong to . Moreover, the languages yielding problems in P can be characterised exactly; every other finite language yields an NP-complete problem.
Formerly the Feder–Vardi dichotomy conjecture, the theorem was proved independently by Bulatov and Zhuk.
An NP-intermediate candidate: Graph Isomorphism
Definition
Link to originalGraph Isomorphism Problem
The graph isomorphism problem is the decision problem of determining whether two finite graphs have the same structure up to a relabelling of their vertices.
Instance: two finite graphs and .
Question: does there exist a bijection such that, for every ,
Equivalently, the question is whether under a graph isomorphism. The corresponding language is
Graph Isomorphism is in NP, but it is not known whether it is in or NP-complete. The theorem of Ladner says only that, if , some NP-intermediate problem exists; it does not show that Graph Isomorphism is such a problem.
Graph Isomorphism now has a quasipolynomial-time algorithm, but whether it has a polynomial-time algorithm remains open. Its structure gives reasons to doubt that it is merely another undiscovered NP-hard problem: a simple local algorithm rejects almost all non-isomorphic graph pairs.
Colour refinement
Colour refinement starts by assigning every vertex the same colour. At each round, a vertex receives a new colour determined by its current colour and the multiset of colours in its neighbourhood:
Run the refinement on both graphs using shared colour identifiers, and compare their final colour signatures
If the signatures differ, the graphs cannot be isomorphic. Equal signatures mean only that colour refinement did not distinguish them; they may still be non-isomorphic.
The algorithm is therefore a sound rejection test, not a complete isomorphism test. Each round sees one more layer of local structure. In fact, captures the isomorphism type of the rooted neighbourhood tree revealed around to depth . Local agreement can nevertheless hide a global difference.
For example, the cycle and the disjoint union are not isomorphic, but every vertex in both graphs has two neighbours. Colour refinement assigns the same colour to every vertex at every round.
Colour refinement is also called 1-dimensional Weisfeiler–Leman refinement. It runs in polynomial time and distinguishes almost all large graphs, even though simple regular graphs can defeat it completely.
Integer Linear Programming
Definition
Link to originalInteger Linear Programming
Integer linear programming is the optimisation problem of maximising a linear objective over integer solutions to a system of linear inequalities. It is linear programming with the additional restriction . Given
the values , , and are fixed input data. The optimisation chooses the decision vector . The vector contains the objective coefficients:
Thus, is the value contributed by one unit of variable .
The feasible solutions and objective are
Both the constraints and objective must be linear, so terms such as are excluded; allowing them gives the broader integer programming problem. Equalities can be replaced by two opposing inequalities, and minimisation can be converted to maximisation by negating the objective.
Decision Version
The decision version additionally receives a target and asks
Normalisations
Products such as are not linear and therefore cannot occur.
GkV
Variants and complexity
| Problem | Variable values | Constraints and objective | Complexity |
|---|---|---|---|
| Linear Programming (LP) | rational or real | linear | polynomial-time solvable |
| ILP | integer | linear | strongly NP-complete |
| IP | integer | possibly non-linear | undecidable in general |
ILP membership in NP uses the small-solution property: every yes-instance has a solution whose binary encoding is polynomial in the input size.
NP-hardness reductions
Given Subset Sum instance , introduce integer variables and impose
Integrality forces , and
Since Subset Sum is weakly NP-hard, this reduction proves ordinary NP-hardness but does not by itself prove strong NP-hardness.
Given Vertex Cover instance , introduce an integer variable for each vertex and impose
The vertices with form a cover of size at most , so
This strengthens the lower bound to strong NP-hardness and, with membership in NP, strong NP-completeness.