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 Graph Theory →

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 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