Skip to content

[Model] MinimumWeightDecoding #923

@isPANN

Description

@isPANN

Motivation

MINIMUM WEIGHT DECODING (MS7) from Garey & Johnson, A1.2. Given a binary matrix H (parity check matrix) and a syndrome vector s, find a binary vector x satisfying Hx = s over GF(2) that minimizes the Hamming weight (number of ones). This is the fundamental nearest-codeword problem in coding theory — it asks for the minimum-weight error pattern consistent with a given syndrome. NP-hard (Berlekamp, McEliece, van Tilborg 1978). Applications in error-correcting codes, cryptography (McEliece cryptosystem), and lattice problems.

Definition

Name: MinimumWeightDecoding
Reference: Garey & Johnson, Computers and Intractability, A1.2 MS7; Berlekamp, McEliece, van Tilborg 1978

Mathematical definition:

INSTANCE: n×m binary matrix H (over GF(2)), binary vector s of length n.
OBJECTIVE: Find a binary vector x of length m satisfying Hx ≡ s (mod 2) that minimizes the Hamming weight |x| = Σ x_j.

Variables

  • Count: m (one per column of H)
  • Per-variable domain: {0, 1}
  • Meaning: Each variable x_j indicates whether column j of H is included in the linear combination. The constraint is that the sum (mod 2) of selected columns equals s. The objective is to minimize the number of selected columns.

Schema (data type)

Type name: MinimumWeightDecoding
Variants: none (unique input structure)

Field Type Description
matrix Vec<Vec<bool>> n×m binary matrix H (parity check matrix)
target Vec<bool> Binary syndrome vector s of length n

Complexity

  • Best known exact algorithm: NP-hard (Berlekamp, McEliece, van Tilborg 1978, transformation from 3-Dimensional Matching). The best known algorithms use information set decoding: Becker, Joux, May, and Meurer (EUROCRYPT 2012) achieve O*(2^(0.0494 · num_cols)) for rate-1/2 codes. More recent nearest-neighbor-based approaches improve this further.
  • Complexity string: "2^(0.0494 * num_cols)"

Extra Remark

Full book text:

INSTANCE: n×m binary matrix A, binary n-vector ȳ, positive integer K ≤ m.
QUESTION: Is there a binary m-vector x̄ having at most K ones and satisfying Ax̄ = ȳ over GF(2) (equivalently, Ax̄ ≡ ȳ (mod 2))?

Reference: [Berlekamp, McEliece, and van Tilborg, 1978]. Transformation from 3-DIMENSIONAL MATCHING.
Comment: The problem of computing the minimum Hamming distance of a linear code is a special case.

Note: The original G&J formulation is a decision problem with threshold K. We use the equivalent optimization formulation: minimize the Hamming weight of x subject to Hx = s over GF(2).

How to solve

  • It can be solved by (existing) bruteforce. (Enumerate all 2^m binary vectors; check GF(2) constraint; return the one with minimum Hamming weight.)
  • It can be solved by reducing to integer programming. (Binary variables with modular arithmetic constraints linearized via integer slack variables; minimize Hamming weight.) See companion issue [Rule] MinimumWeightDecoding to ILP #968.
  • Other:

Reduction Rule Crossref

Example Instance

Input:
Matrix H (3×4 over GF(2)):

1 0 1 1
0 1 1 0
1 1 0 1

Syndrome vector s = (1, 1, 0).

All feasible solutions (Hx ≡ s mod 2):

  • x = (0, 0, 1, 0), weight 1: H·x = (1, 1, 0) ✓
  • x = (0, 1, 0, 1), weight 2: H·x = (1, 1, 0) ✓
  • x = (1, 1, 0, 0), weight 2: H·x = (1, 1, 0) ✓
  • x = (1, 0, 1, 1), weight 3: H·x = (1, 1, 0) ✓

The search space has 2^4 = 16 binary vectors, of which 4 satisfy the GF(2) constraint. The feasible solutions have 3 distinct Hamming weights (1, 2, 3).

Optimal solution: x = (0, 0, 1, 0) — selecting only column 3 of H, which equals s.

Expected Outcome

Optimal value: Min(1) — the minimum Hamming weight of a feasible vector is 1. There are 4 feasible solutions with 3 distinct weight values (1, 2, 3), and a unique optimal solution.

Metadata

Metadata

Assignees

No one assigned

    Labels

    GoodAn issue passed all checks.modelA model problem to be implemented.

    Type

    No type

    Projects

    Status

    Done

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions