Path in LaTeX (P_n)

PnP_n
LaTeX command
P_n
Package
No package needed: built into LaTeX
Mode
Math mode only

Where it is used

Path graph on n vertices: n vertices joined in a line by n - 1 edges.

P_n is a basic family in graph theory, along with C_n and K_n. Conventions differ, which is a real source of confusion: many texts let n count vertices, while others, including Diestel, write P^k for a path with k edges. State yours. Paths have chromatic number 2 for n \geq 2 and are trees. In walk counting, the number of paths is distinct from walks because vertices cannot repeat. The subscript is a plain index; for longer indices, use braces, P_{n+1}. Do not confuse with P(n, k), permutations.

Minimal compilable example

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

Pn has n vertices and n−1 edgesP_n \text{ has } n \text{ vertices and } n - 1 \text{ edges}
\documentclass{article}
\usepackage{amsmath}
\begin{document}
Path: $P_n$

\[ P_n \text{ has } n \text{ vertices and } n - 1 \text{ edges} \]
\end{document}

Related symbols

All 그래프 이론 →

Frequently asked questions

How do I write Path in LaTeX?
Type P_n in math mode, for example $P_n \text{ has } n \text{ vertices and } n - 1 \text{ edges}$. It works in plain LaTeX without loading any package.
Which package do I need for P_n?
None. P_n is part of standard LaTeX, so it compiles with nothing in the preamble but the document class.
Can I use P_n in text mode, or only in math mode?
Only in math mode. Outside $...$ LaTeX stops with "Missing $ inserted", so write $P_n$ in running text.
Math poweredAI로 LaTeX 작성

최고의 AI LaTeX 편집기, Overleaf 대안

Octree는 15개 이상의 대학의 연구자들이 AI를 사용하여 논문을 더 빠르게 작성하도록 도움

  • AI로 아름다운 TikZ 다이어그램 생성
  • 이미지를 업로드하고 LaTeX로 원활하게 변환
  • 논문 작성 및 서식에 대한 즉각적인 지원 받기