Source: 3-DIMENSIONAL MATCHING (3DM)
Target: 3-MATROID INTERSECTION
Motivation: Establishes NP-completeness of 3-matroid intersection by exhibiting 3DM as a canonical special case in which each of the three matroids is a partition matroid over one coordinate of the triples. The reduction is the textbook witness that, while 2-matroid intersection is polynomial-time solvable (Edmonds), adding a third matroid jumps to NP-hardness — and it does so already for the simplest combinatorial matroids (partitions). This makes 3-matroid intersection the natural matroid-theoretic home for 3DM, hypergraph matching, and related "triple packing" problems.
Reference: Garey & Johnson, Computers and Intractability, SP11, p. 223; Lawler, Combinatorial Optimization: Networks and Matroids (1976), Ch. 9.
GJ Source Entry
[SP11] 3-MATROID INTERSECTION
INSTANCE: Three matroids M_1 = (E, I_1), M_2 = (E, I_2), M_3 = (E, I_3) on a common finite ground set E, each specified by an independence oracle (or equivalent compact description), positive integer K ≤ |E|.
QUESTION: Is there a subset X ⊆ E with |X| ≥ K such that X ∈ I_1 ∩ I_2 ∩ I_3?
Reference: [Lawler, 1976]. Transformation from 3-DIMENSIONAL MATCHING.
Comment: Polynomial for k = 2 matroids (Edmonds' matroid intersection theorem). NP-complete already when all three matroids are partition matroids.
Reduction Algorithm
Summary:
Given a 3DM instance with disjoint sets X, Y, Z of size q each and a collection T ⊆ X × Y × Z of triples, construct a 3-MATROID INTERSECTION instance (E, M_1, M_2, M_3, K) as follows:
-
Ground set: E := T. Each triple t = (x, y, z) becomes one ground-set element.
-
Partition matroid M_1 (X-coordinate): Partition E by first coordinate. For each x ∈ X let block B^X_x := { t ∈ T : t = (x, ·, ·) }. Declare S ⊆ E independent in M_1 iff |S ∩ B^X_x| ≤ 1 for every x ∈ X. (Equivalently: no two chosen triples share their X-element.)
-
Partition matroid M_2 (Y-coordinate): Same construction with blocks B^Y_y := { t ∈ T : t = (·, y, ·) }.
-
Partition matroid M_3 (Z-coordinate): Same construction with blocks B^Z_z := { t ∈ T : t = (·, ·, z) }.
-
Threshold: K := q.
All three matroids are partition matroids with per-block capacity 1, so each can be described in O(|T|) space and admits a constant-time independence oracle.
Correctness:
- (⇒) If M ⊆ T is a 3DM matching of size q, then |M| = q and M uses each X-, Y-, Z-element at most once. Hence M is independent in M_1, M_2, M_3, giving a common independent set of size K = q.
- (⇐) If X ⊆ E is common independent of size ≥ K = q in all three matroids, no two of its triples share any coordinate. So |X| triples cover q distinct X-elements, q distinct Y-elements, q distinct Z-elements; since |X| = |Y| = |Z| = q, they cover all of X ∪ Y ∪ Z. Therefore X is a perfect 3-dimensional matching.
The transformation is computable in O(|T|) time and is many-one (witness-preserving): the selected triples are literally the matching.
Size Overhead
Symbols:
- q = |X| = |Y| = |Z| (each side of the 3DM instance)
- m = |T| =
num_triples (number of input triples)
| Target metric (code name) |
Polynomial (using symbols above) |
ground_size (= |E|) |
m |
num_matroids |
3 |
k (independence threshold) |
q |
Derivation:
- Ground set is exactly the set of triples: |E| = |T| = m.
- Each matroid is the partition matroid associated with one of the three coordinate sides; it has q blocks of total size m and uniform capacity 1, so its description is O(m + q) = O(m).
- Threshold K equals the side length q of the 3DM instance (a perfect matching has exactly q triples).
- Overall construction: O(m) time, O(m) space, 3 matroids — strictly linear overhead.
Validation Method
- Closed-loop test (YES instance): Take any 3DM instance with a known perfect matching, run the reduction, solve 3-MATROID INTERSECTION with brute force over subsets of E, confirm the optimum equals q and the recovered set is exactly the matching.
- Closed-loop test (NO instance): Build a 3DM instance that admits no perfect matching (e.g. force some Y-element to appear in no triple, or force two X-elements to share their only triple); confirm the maximum common independent size is < q.
- Oracle sanity check: For each matroid, randomly sample subsets of E, verify that the independence oracle accepts iff the projection onto its coordinate is injective.
- Boundary cases: q = 1 (one triple per side, trivial YES); q = 2 with two triples covering disjoint coordinates (YES) vs. two triples sharing a coordinate (NO).
Example
Source instance (3DM):
X = {x_1, x_2}, Y = {y_1, y_2}, Z = {z_1, z_2} (q = 2). Triples:
- t_1 = (x_1, y_1, z_1)
- t_2 = (x_2, y_2, z_2)
- t_3 = (x_1, y_2, z_2)
- t_4 = (x_2, y_1, z_1)
This 3DM instance has two perfect matchings: {t_1, t_2} and {t_3, t_4}.
Constructed target instance (3-MATROID INTERSECTION):
Ground set E = {t_1, t_2, t_3, t_4}.
M_1 (partition by X-coordinate):
- block B^X_{x_1} = {t_1, t_3}, capacity 1
- block B^X_{x_2} = {t_2, t_4}, capacity 1
M_2 (partition by Y-coordinate):
- block B^Y_{y_1} = {t_1, t_4}, capacity 1
- block B^Y_{y_2} = {t_2, t_3}, capacity 1
M_3 (partition by Z-coordinate):
- block B^Z_{z_1} = {t_1, t_4}, capacity 1
- block B^Z_{z_2} = {t_2, t_3}, capacity 1
Threshold K = 2.
Verification:
- X* = {t_1, t_2}: X-projection {x_1, x_2} (M_1 ✓), Y-projection {y_1, y_2} (M_2 ✓), Z-projection {z_1, z_2} (M_3 ✓), |X*| = 2 ≥ K. YES.
- X' = {t_1, t_3}: both have X-coordinate x_1, violates M_1. Rejected.
- X'' = {t_1, t_4}: share y_1 and z_1, violates M_2 and M_3. Rejected.
So the 3-matroid intersection optimum is 2, matching the 3DM perfect matching size.
References
- [Lawler, 1976] E. L. Lawler. Combinatorial Optimization: Networks and Matroids. Holt, Rinehart and Winston, 1976. Chapter 9 (matroid intersection) — establishes NP-hardness of 3-matroid intersection via the partition-matroid encoding of 3DM.
- [Garey & Johnson, 1979] M. R. Garey and D. S. Johnson. Computers and Intractability: A Guide to the Theory of NP-Completeness. W. H. Freeman, 1979. Problem SP11, p. 223.
- [Edmonds, 1970] J. Edmonds. "Submodular functions, matroids, and certain polyhedra." In Combinatorial Structures and Their Applications, pp. 69–87, 1970. Polynomial-time algorithm for 2-matroid intersection (context for why 3-matroid intersection is the natural hardness threshold).
Specialization Note
This rule's source problem (3-DIMENSIONAL MATCHING / 3DM) is a specialization of SET PACKING (MaximumSetPacking) restricted to 3-element sets from three disjoint universes. Implementation should wait until 3DM is available as a codebase model.
Source: 3-DIMENSIONAL MATCHING (3DM)
Target: 3-MATROID INTERSECTION
Motivation: Establishes NP-completeness of 3-matroid intersection by exhibiting 3DM as a canonical special case in which each of the three matroids is a partition matroid over one coordinate of the triples. The reduction is the textbook witness that, while 2-matroid intersection is polynomial-time solvable (Edmonds), adding a third matroid jumps to NP-hardness — and it does so already for the simplest combinatorial matroids (partitions). This makes 3-matroid intersection the natural matroid-theoretic home for 3DM, hypergraph matching, and related "triple packing" problems.
Reference: Garey & Johnson, Computers and Intractability, SP11, p. 223; Lawler, Combinatorial Optimization: Networks and Matroids (1976), Ch. 9.
GJ Source Entry
Reduction Algorithm
Summary:
Given a 3DM instance with disjoint sets X, Y, Z of size q each and a collection T ⊆ X × Y × Z of triples, construct a 3-MATROID INTERSECTION instance (E, M_1, M_2, M_3, K) as follows:
Ground set: E := T. Each triple t = (x, y, z) becomes one ground-set element.
Partition matroid M_1 (X-coordinate): Partition E by first coordinate. For each x ∈ X let block B^X_x := { t ∈ T : t = (x, ·, ·) }. Declare S ⊆ E independent in M_1 iff |S ∩ B^X_x| ≤ 1 for every x ∈ X. (Equivalently: no two chosen triples share their X-element.)
Partition matroid M_2 (Y-coordinate): Same construction with blocks B^Y_y := { t ∈ T : t = (·, y, ·) }.
Partition matroid M_3 (Z-coordinate): Same construction with blocks B^Z_z := { t ∈ T : t = (·, ·, z) }.
Threshold: K := q.
All three matroids are partition matroids with per-block capacity 1, so each can be described in O(|T|) space and admits a constant-time independence oracle.
Correctness:
The transformation is computable in O(|T|) time and is many-one (witness-preserving): the selected triples are literally the matching.
Size Overhead
Symbols:
num_triples(number of input triples)ground_size(= |E|)num_matroidsk(independence threshold)Derivation:
Validation Method
Example
Source instance (3DM):
X = {x_1, x_2}, Y = {y_1, y_2}, Z = {z_1, z_2} (q = 2). Triples:
This 3DM instance has two perfect matchings: {t_1, t_2} and {t_3, t_4}.
Constructed target instance (3-MATROID INTERSECTION):
Ground set E = {t_1, t_2, t_3, t_4}.
M_1 (partition by X-coordinate):
M_2 (partition by Y-coordinate):
M_3 (partition by Z-coordinate):
Threshold K = 2.
Verification:
So the 3-matroid intersection optimum is 2, matching the 3DM perfect matching size.
References
Specialization Note
This rule's source problem (3-DIMENSIONAL MATCHING / 3DM) is a specialization of SET PACKING (MaximumSetPacking) restricted to 3-element sets from three disjoint universes. Implementation should wait until 3DM is available as a codebase model.