3-dimensional matching

From Wikipedia, the free encyclopedia
Jump to navigation Jump to search
3-dimensional matchings. (a) Input T. (b)–(c) Solutions.

In the mathematical discipline of graph theory, a 3-dimensional matching is a generalization of bipartite matching (also known as 2-dimensional matching) to 3-uniform hypergraphs. Finding a largest 3-dimensional matching is a well-known NP-hard problem in computational complexity theory.


Let X, Y, and Z be finite, disjoint sets, and let T be a subset of X × Y × Z. That is, T consists of triples (xyz) such that x ∈ X, y ∈ Y, and z ∈ Z. Now M ⊆ T is a 3-dimensional matching if the following holds: for any two distinct triples (x1y1z1) ∈ M and (x2y2z2) ∈ M, we have x1 ≠ x2, y1 ≠ y2, and z1 ≠ z2.


The figure on the right illustrates 3-dimensional matchings. The set X is marked with red dots, Y is marked with blue dots, and Z is marked with green dots. Figure (a) shows the set T (gray areas). Figure (b) shows a 3-dimensional matching M with |M| = 2, and Figure (c) shows a 3-dimensional matching M with |M| = 3.

The matching M illustrated in Figure (c) is a maximum 3-dimensional matching, i.e., it maximises |M|. The matching illustrated in Figures (b)–(c) are maximal 3-dimensional matchings, i.e., they cannot be extended by adding more elements from T.

Here is example interactive visualisation in javascript

Comparison with bipartite matching[edit]

A 2-dimensional matching can be defined in a completely analogous manner. Let X and Y be finite, disjoint sets, and let T be a subset of X × Y. Now M ⊆ T is a 2-dimensional matching if the following holds: for any two distinct pairs (x1y1) ∈ M and (x2y2) ∈ M, we have x1 ≠ x2 and y1 ≠ y2.

In the case of 2-dimensional matching, the set T can be interpreted as the set of edges in a bipartite graph G = (XYT); each edge in T connects a vertex in X to a vertex in Y. A 2-dimensional matching is then a matching in the graph G, that is, a set of pairwise non-adjacent edges.

Hence 3-dimensional matchings can be interpreted as a generalization of matchings to hypergraphs: the sets X, Y, and Z contain the vertices, each element of T is a hyperedge, and the set M consists of pairwise non-adjacent edges (edges that do not have a common vertex). In case of 2-dimensional matching, we have Y = Z.

Comparison with set packing[edit]

A 3-dimensional matching is a special case of a set packing: we can interpret each element (xyz) of T as a subset {xyz} of X ∪ Y ∪ Z; then a 3-dimensional matching M consists of pairwise disjoint subsets.

Decision problem[edit]

In computational complexity theory, 3-dimensional matching is also the name of the following decision problem: given a set T and an integer k, decide whether there exists a 3-dimensional matching M ⊆ T with |M| ≥ k.

This decision problem is known to be NP-complete; it is one of Karp's 21 NP-complete problems.[1] There exist though polynomial time algorithms for that problem for dense hypergraphs.[2][3]

The problem is NP-complete even in the special case that k = |X| = |Y| = |Z|.[1][4][5] In this case, a 3-dimensional (dominating) matching is not only a set packing but also an exact cover: the set M covers each element of X, Y, and Z exactly once.[6]

Optimization problem[edit]

A maximum 3-dimensional matching is a largest 3-dimensional matching. In computational complexity theory, this is also the name of the following optimization problem: given a set T, find a 3-dimensional matching M ⊆ T that maximizes |M|.

Since the decision problem described above is NP-complete, this optimization problem is NP-hard, and hence it seems that there is no polynomial-time algorithm for finding a maximum 3-dimensional matching. However, there are efficient polynomial-time algorithms for finding a maximum bipartite matching (maximum 2-dimensional matching), for example, the Hopcroft–Karp algorithm.

Approximation algorithms[edit]

The problem is APX-complete, that is, it is hard to approximate within some constant.[7][8][9] However, for any constant ε > 0 there is a polynomial-time (4/3 + ε)-approximation algorithm for 3-dimensional matching.[10]

There is a very simple polynomial-time 3-approximation algorithm for 3-dimensional matching: find any maximal 3-dimensional matching.[9] Just like a maximal matching is within factor 2 of a maximum matching,[11] a maximal 3-dimensional matching is within factor 3 of a maximum 3-dimensional matching.

See also[edit]


  1. ^ a b Karp (1972).
  2. ^ Karpinski, Rucinski & Szymanska (2009)
  3. ^ Keevash, Knox & Mycroft (2013)
  4. ^ Garey & Johnson (1979), Section 3.1 and problem SP1 in Appendix A.3.1.
  5. ^ Korte & Vygen (2006), Section 15.5.
  6. ^ Papadimitriou & Steiglitz (1998), Section 15.7.
  7. ^ Crescenzi et al. (2000).
  8. ^ Ausiello et al. (2003), problem SP1 in Appendix B.
  9. ^ a b Kann (1991)
  10. ^ Cygan, Marek (2013). "Improved Approximation for 3-Dimensional Matching via Bounded Pathwidth Local Search" (PDF). IEEE 54th Annual Symposium on Foundations of Computer Science. doi:10.1109/FOCS.2013.61.
  11. ^ Matching (graph theory)#Properties.