Connected in LaTeX (u \leftrightarrow v)

u↔vu \leftrightarrow v
LaTeX command
u \leftrightarrow v
Package
No package needed: built into LaTeX
Mode
Math mode only

Where it is used

Connectivity relation: there is a path between vertices u and v, so they lie in the same component.

\leftrightarrow is a relation-class arrow, so it gets symmetric spacing. In graph theory, u \leftrightarrow v often means u and v are connected, while in Markov chains it means two states communicate. Directed graphs need care: mutual reachability is the strongly connected relation, sometimes written u \rightleftarrows v. Do not confuse \leftrightarrow with the longer \longleftrightarrow or the double-arrow \Leftrightarrow, which means logical equivalence. Some authors write u \sim v for adjacency and reserve \leftrightarrow for connectivity, which is clean if stated. It is an equivalence relation whose classes are components.

Minimal compilable example

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

u↔v  ⟺  ∃ a u-v path in Gu \leftrightarrow v \iff \exists \text{ a } u\text{-}v \text{ path in } G
\documentclass{article}
\usepackage{amsmath}
\begin{document}
Connected: $u \leftrightarrow v$

\[ u \leftrightarrow v \iff \exists \text{ a } u\text{-}v \text{ path in } G \]
\end{document}

Related symbols

All グラフ理論 →

Frequently asked questions

How do I write Connected in LaTeX?
Type u \leftrightarrow v in math mode, for example $u \leftrightarrow v \iff \exists \text{ a } u\text{-}v \text{ path in } G$. It works in plain LaTeX without loading any package.
Which package do I need for u \leftrightarrow v?
None. u \leftrightarrow v is part of standard LaTeX, so it compiles with nothing in the preamble but the document class.
Can I use u \leftrightarrow v in text mode, or only in math mode?
Only in math mode. Outside $...$ LaTeX stops with "Missing $ inserted", so write $u \leftrightarrow v$ in running text.
Math poweredAIでLaTeXを書く

最高のAI LaTeXエディタ、Overleaf代替

Octreeは15以上の大学の研究者がAIを使って論文をより速く書くのを支援

  • AIで美しいTikZダイアグラムを生成
  • 画像をアップロードしてシームレスにLaTeXに変換
  • 論文の執筆とフォーマットに即座にサポートを取得