Removing loops from binary constraint graphs #
A loop of a binary constraint graph is an edge occurrence whose two ends are the same vertex u,
with a relation R on the label of u taken twice. Cslib.PCP.Encoded.Graph.deloop doubles
the vertex numbers: vertex v becomes 2 v, every edge between distinct vertices keeps its
relation, and a loop at u becomes an edge from 2 u to the fresh vertex 2 u + 1. Its relation
checks R on the label of 2 u alone and ignores the label of 2 u + 1. The result is loopless,
and every labelling τ of it violates exactly as many edges as the labelling v ↦ τ (2 v) of the
original graph. So the two graphs have the same value (unsatVal_deloop).
Dinur's preprocessing deliberately adds loops, so the hard binary CSP instances of
Cslib.Complexity.GapTwoCSP_npHard are not loopless; loop removal prepares them for the incidence
construction of Label Cover, whose output then has no parallel edges. The construction is a library
adaptation to the executable graph API.
Main definitions #
Cslib.PCP.Encoded.Graph.deloop: replace every loop by an edge to a fresh vertex.
Main results #
Cslib.PCP.Encoded.Graph.isLoopless_deloop: the result is loopless.Cslib.PCP.Encoded.Graph.unsatVal_deloop: the value is unchanged.Cslib.PCP.Encoded.Graph.satisfiable_deloop_iff: so is satisfiability.Cslib.PCP.Encoded.Graph.isPolyTime_deloop: polynomial-time compilation for a fixed finite alphabet, under the framed graph and table encodings.
Loop removal keeps the declared vertices: endpoints below n go below 2 n.
The result of loop removal is loopless.
A labelling of the result violates exactly as many edges as its restriction v ↦ τ (2 v) to
the doubled original vertices violates in the original graph.
Loop removal keeps the value. A labelling of the original graph lifts to the result by
reading the label of v at 2 v and 2 v + 1, and a labelling of the result restricts to the
even vertices; both keep the number of violated edges.
Loop removal keeps satisfiability.
Loop removal is polynomial-time for every fixed finite alphabet: it rewrites each edge record, reading its unary endpoints and its complete relation table.