Adjacency in LaTeX (u \sim v)
- LaTeX command
u \sim v- Package
- No package needed: built into LaTeX
- Mode
- Math mode only
Where it is used
Adjacency relation: u and v are joined by an edge in the graph.
\sim is a binary relation, so TeX places balanced thick spaces around it, making u \sim v read correctly. To specify the graph, write u \sim_G v. Some authors use u \leftrightarrow v or uv \in E(G) instead. Non-adjacency is written u \nsim v. Do not confuse \sim with \simeq (asymptotic or homotopy equivalence), \approx (approximately equal), or \backsim (reversed tilde). In probability, x \sim p means sampled from, so define adjacency explicitly in interdisciplinary papers. Neighborhoods follow naturally: N(v) = \{u : u \sim v\}.
Minimal compilable example
Paste this into an empty .tex file and compile it with pdfLaTeX, XeLaTeX or LuaLaTeX.
\documentclass{article}
\begin{document}
Adjacency: $u \sim v$
\[ N(v) = \{ u \in V(G) : u \sim v \} \]
\end{document}Related symbols
All 그래프 이론 →Frequently asked questions
- How do I write Adjacency in LaTeX?
- Type u \sim v in math mode, for example $N(v) = \{ u \in V(G) : u \sim v \}$. It works in plain LaTeX without loading any package.
- Which package do I need for u \sim v?
- None. u \sim v is part of standard LaTeX, so it compiles with nothing in the preamble but the document class.
- Can I use u \sim v in text mode, or only in math mode?
- Only in math mode. Outside $...$ LaTeX stops with "Missing $ inserted", so write $u \sim v$ in running text.
Math poweredAI로 LaTeX 작성
최고의 AI LaTeX 편집기, Overleaf 대안
Octree는 15개 이상의 대학의 연구자들이 AI를 사용하여 논문을 더 빠르게 작성하도록 도움
- AI로 아름다운 TikZ 다이어그램 생성
- 이미지를 업로드하고 LaTeX로 원활하게 변환
- 논문 작성 및 서식에 대한 즉각적인 지원 받기