Documentation

CslibFrontier.Computability.Complexity.Problems.Graph.Matching.Instance

Matching as minimum-defect edge CSP #

Each distinct declared vertex chooses exactly one incident edge or its private unmatched port. Original edges use the even names 2 * i, where i is their normalized edge-list position; the private port of a vertex named v uses 2 * v + 1. A second unary constraint pins each private port false. Every scope is nonempty, including isolated vertices. Names are retained in binary; no interval below a raw vertex name is enumerated.

Mutually true original edges form a matching. Counting true endpoints gives 2 * matched edges + defects = distinct vertices, so minimizing defects maximizes matching cardinality. The solver is the even-delta-matroid algorithm of [KKR18].

Nonempty choice scope: one private unmatched port and the incident normalized edges.

Instances For

    An exactly-one choice at every vertex, with every private unmatched port pinned false. This instance always has a valid local labeling; consistency is not required by optimization.

    Instances For

      An original edge belongs to a choice scope precisely at its two original endpoints.

      An unmatched port appears in exactly its own vertex's choice scope.

      All generated choice scopes are duplicate-free, for arbitrary raw graph data.

      Original edge positions have the same occurrence count under even tagging.

      Each declared vertex's private port occurs exactly twice.

      theorem Cslib.Complexity.Graph.mem_vars_matchingInstance (G : Graph) {x : ℕ} :
      x ∈ G.matchingInstance.vars ↔ (∃ i < G.edgeList.length, x = 2 * i) ∨ ∃ v ∈ G.vertices, x = 2 * v + 1

      Every generated variable is an original edge position or a declared private port.

      The optimizer's two-occurrence guard follows internally on every raw graph.

      Each generated relation is a nonempty even delta-matroid on its actual scope positions.