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 Graph Theory →

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 poweredSumulat ng LaTeX gamit ang AI

Pinakamahusay na AI LaTeX Editor, Alternatibo sa Overleaf

Tinutulungan ng Octree ang mga researcher mula sa 15+ na unibersidad na sumulat ng research papers nang mas mabilis gamit ang AI

  • Gumawa ng magagandang TikZ diagrams gamit ang AI
  • Mag-upload ng larawan at i-convert ito sa LaTeX nang walang problema
  • Makakuha ng instant na tulong sa pagsulat at pag-format ng research papers