Matching in LaTeX (M)
- LaTeX command
M- Package
- No package needed: built into LaTeX
- Mode
- Text and math mode
Where it is used
Capital M, the standard letter for a matching: a set of edges no two of which share a vertex.
A matching M \subseteq E(G) is perfect when it covers every vertex, so |M| = |V(G)|/2, and maximum when no larger one exists; its size is the matching number \nu(G). Hall's theorem gives the condition for a perfect matching in bipartite graphs: |N(S)| \geq |S| for every subset S of one side. Algorithms include Hopcroft-Karp for bipartite graphs and Edmonds' blossom algorithm in general. Augmenting paths are often written relative to M, and the symmetric difference M \triangle M' appears in many proofs. Avoid M if a matrix also needs a name.
Minimal compilable example
Paste this into an empty .tex file and compile it with pdfLaTeX, XeLaTeX or LuaLaTeX.
\documentclass{article}
\usepackage{amsmath}
\begin{document}
Matching: $M$
\[ M \subseteq E(G), \quad |M| = |V(G)|/2 \text{ if } M \text{ is perfect} \]
\end{document}Related symbols
- Planar Graph
G \hookrightarrow \mathbb{R}^2 - Independent Set
\alpha(G) - Clique
\omega(G) - Chromatic Number
\chi(G) - Forest
F - Tree
T
Frequently asked questions
- How do I write Matching in LaTeX?
- Type M in math mode, for example $M \subseteq E(G), \quad |M| = |V(G)|/2 \text{ if } M \text{ is perfect}$. It works in plain LaTeX without loading any package.
- Which package do I need for M?
- None. M is part of standard LaTeX, so it compiles with nothing in the preamble but the document class.
- Can I use M in text mode, or only in math mode?
- Both. M compiles in running text as well as inside $...$; in a formula keep it in math mode so it gets math fonts and spacing.