Complete Graph in LaTeX (K_n)

KnK_n
LaTeX command
K_n
Package
No package needed: built into LaTeX
Mode
Math mode only

Where it is used

Complete graph on n vertices, in which every pair of distinct vertices is joined by an edge.

K_n has \binom{n}{2} = n(n-1)/2 edges and chromatic number n. The letter honors Kuratowski, whose theorem says a graph is planar if and only if it contains no subdivision of K_5 or K_{3,3}. Ramsey numbers are phrased with complete graphs, R(3,3) = 6 meaning any 2-coloring of the edges of K_6 contains a monochromatic triangle. Cayley's formula counts n^{n-2} spanning trees of K_n. Use braces for multi-character subscripts like K_{n+1}. A clique of size k in G is a subgraph isomorphic to K_k.

Minimal compilable example

Paste this into an empty .tex file and compile it with pdfLaTeX, XeLaTeX or LuaLaTeX.

∣E(Kn)∣=(n2)=n(n−1)2|E(K_n)| = \binom{n}{2} = \frac{n(n-1)}{2}
\documentclass{article}
\usepackage{amsmath}
\begin{document}
Complete Graph: $K_n$

\[ |E(K_n)| = \binom{n}{2} = \frac{n(n-1)}{2} \]
\end{document}

Related symbols

All Graph Theory →

Frequently asked questions

How do I write Complete Graph in LaTeX?
Type K_n in math mode, for example $|E(K_n)| = \binom{n}{2} = \frac{n(n-1)}{2}$. It works in plain LaTeX without loading any package.
Which package do I need for K_n?
None. K_n is part of standard LaTeX, so it compiles with nothing in the preamble but the document class.
Can I use K_n in text mode, or only in math mode?
Only in math mode. Outside $...$ LaTeX stops with "Missing $ inserted", so write $K_n$ in running text.
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