Skip to content

[Model] MinimumMatrixDomination #840

@isPANN

Description

@isPANN

Motivation

MATRIX DOMINATION (P324) from Garey & Johnson, A12 MS12. Find the minimum number of non-zero entries in a binary matrix needed to dominate all other non-zero entries. NP-complete (Yannakakis and Gavril, 1980; G&J cites 1978 preprint). Related to edge dominating set in bipartite graphs: viewing M as a biadjacency matrix, dominating entries correspond to dominating edges.

Associated rules:

Definition

Name: MinimumMatrixDomination
Reference: Garey & Johnson, Computers and Intractability, A12 MS12

Mathematical definition:

INSTANCE: An n×n matrix M with entries from {0,1}.
OBJECTIVE: Find a subset C of non-zero entries of M with minimum |C| such that for every non-zero entry (i,j) of M, either (i,j) ∈ C or there exists an entry (i',j') ∈ C sharing a row (i = i') or column (j = j') with (i,j).

Variables

  • Count: s (one per non-zero entry; only 1-entries are candidates)
  • Per-variable domain: {0, 1}
  • Meaning: Whether each non-zero entry (i,j) is selected into the dominating set C. The objective minimizes |C| while ensuring every 1-entry not in C shares a row or column with some entry in C.

Schema (data type)

Type name: MinimumMatrixDomination
Variants: none

Field Type Description
matrix Vec<Vec<bool>> The n×n binary matrix M

Notes:

  • This is an optimization problem: Value = Min<usize>.
  • Key getter methods: num_rows() (= n), num_cols() (= n), num_ones() (= number of 1-entries).

Complexity

  • Decision complexity: NP-complete (Yannakakis and Gavril, 1980; transformation from MINIMUM MAXIMAL MATCHING). NP-complete even when M is upper triangular.
  • Best known exact algorithm: O*(2^s) by brute-force enumeration of subsets of 1-entries, where s = number of non-zero entries.
  • Concrete complexity expression: "2^num_ones" (for declare_variants!)
  • References:
    • M. Yannakakis, F. Gavril (1980). "Edge Dominating Sets in Graphs." SIAM J. Appl. Math. 38(3), pp. 364-372.

Extra Remark

Full book text:

INSTANCE: An n×n matrix M with entries from {0,1}, and a positive integer K.
QUESTION: Is there a set of K or fewer non-zero entries in M that dominate all others, i.e., a subset C ⊆ {1,2,...,n}×{1,2,...,n} with |C| ≤ K such that M_ij = 1 for all (i,j) ∈ C and such that, whenever M_ij = 1, there exists an (i',j') ∈ C for which either i = i' or j = j'?
Reference: [Yannakakis and Gavril, 1978]. Transformation from MINIMUM MAXIMAL MATCHING.
Comment: Remains NP-complete even if M is upper triangular.

How to solve

  • It can be solved by (existing) bruteforce. (Enumerate all subsets of 1-entries; return the smallest dominating set.)
  • It can be solved by reducing to integer programming. (Binary variables x_{ij} for each 1-entry; for each 1-entry (i,j): x_{ij} + Σ_{(i,j') in C} x_{i,j'} + Σ_{(i',j) in C} x_{i',j} ≥ 1; minimize Σ x_{ij}. Companion rule issue to be filed separately.)
  • Other:

Example Instance

Input: 6×6 binary matrix M (adjacency matrix of path graph P_6):

     0  1  2  3  4  5
0  [ 0  1  0  0  0  0 ]
1  [ 1  0  1  0  0  0 ]
2  [ 0  1  0  1  0  0 ]
3  [ 0  0  1  0  1  0 ]
4  [ 0  0  0  1  0  1 ]
5  [ 0  0  0  0  1  0 ]

Non-zero entries (10 total): (0,1), (1,0), (1,2), (2,1), (2,3), (3,2), (3,4), (4,3), (4,5), (5,4).

Optimal dominating set: C = {(0,1), (1,0), (3,4), (4,3)}, |C| = 4.

  • (1,2): shares row 1 with (1,0) ∈ C ✓
  • (2,1): shares column 1 with (0,1) ∈ C ✓
  • (2,3): shares row 2 with... no. Shares column 3 with (4,3) ∈ C ✓
  • (3,2): shares row 3 with (3,4) ∈ C ✓
  • (4,5): shares row 4 with (4,3) ∈ C ✓
  • (5,4): shares column 4 with (3,4) ∈ C ✓

Optimal value: Min(4). No 3-entry dominating set exists (verified exhaustively).

Python validation script
from itertools import combinations

ones = [(0,1),(1,0),(1,2),(2,1),(2,3),(3,2),(3,4),(4,3),(4,5),(5,4)]

def dominates(C, ones):
    C_set = set(C)
    for (i,j) in ones:
        if (i,j) in C_set: continue
        if any(ci == i or cj == j for ci,cj in C_set): continue
        return False
    return True

# Find minimum
for k in range(1, 11):
    found = [c for c in combinations(ones, k) if dominates(c, ones)]
    if found:
        assert k == 4
        print(f"Minimum dominating set size: {k} ({len(found)} solutions)")
        break

# Verify specific solution
C = [(0,1),(1,0),(3,4),(4,3)]
assert dominates(C, ones)
print("Specific solution verified")

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