Matching in LaTeX (M)

MM
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.

M⊆E(G),∣M∣=∣V(G)∣/2 if M is perfectM \subseteq E(G), \quad |M| = |V(G)|/2 \text{ if } M \text{ is perfect}
\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

All Teori Graf →

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.
Math poweredTulis LaTeX menggunakan AI

Editor LaTeX AI Terbaik, Alternatif Overleaf

Octree membantu penyelidik dari 15+ universiti menulis kertas penyelidikan dengan lebih cepat menggunakan AI

  • Jana diagram TikZ yang cantik menggunakan AI
  • Muat naik imej dan tukar ke LaTeX dengan lancar
  • Dapatkan bantuan segera untuk menulis dan memformat kertas penyelidikan