Complete Graph in LaTeX (K_n)

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

Try Complete Graph in a real LaTeX document

Open a ready-to-compile document that already uses K_n, with the right packages loaded. Edit it and see the PDF, no install needed.

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 نظرية البيان →

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 poweredاكتب LaTeX باستخدام الذكاء الاصطناعي

أفضل محرر LaTeX بالذكاء الاصطناعي، بديل Overleaf

يساعد Octree الباحثين من أكثر من 15 جامعة على كتابة أوراق البحث بشكل أسرع باستخدام الذكاء الاصطناعي

  • أنشئ رسوم TikZ جميلة باستخدام الذكاء الاصطناعي
  • ارفع صورة وحولها إلى LaTeX بسلاسة
  • احصل على مساعدة فورية في كتابة وتنسيق أوراق البحث