Skip to content

UndirectedEdge ​

An undirected edge between two vertices — the edge head Graph holds in its edge list.

✓ checked against that system · ! checked, with disagreements (hover a chip)Wolfram LanguageUndirectedEdge✓
UndirectedEdge(u, v)an edge between uu and vv, undirected — VertexDegree and the connectivity heads count it toward both endpoints and traverse it in either direction, regardless of which argument is which.
Typed signatures
TypePackageApplies
(any, any) -> valuecombinatoricsalways

Domain: Collections

Details
  • Inert, like Graph itself — it holds exactly as written; nothing here evaluates it away.
  • Wolfram prints this infix as u↔vu \leftrightarrow v (u <-> v); Epsil has no infix form for it yet, so it round-trips through call-form syntax, UndirectedEdge(u, v), which Wolfram accepts as equivalent input.

Examples

Basic #

An edge between 1 and 2

live ↗
InUndirectedEdge(1,2)\mathrm{UndirectedEdge}(1, 2)OutUndirectedEdge(1,2)\mathrm{UndirectedEdge}(1, 2)
Scope #
live ↗
InSubgraph(CompleteGraph(4),[UndirectedEdge(1,2),UndirectedEdge(2,3)])\mathrm{Subgraph}(\mathrm{CompleteGraph}(4), \bigl\lbrack\mathrm{UndirectedEdge}(1, 2), \mathrm{UndirectedEdge}(2, 3)\bigr\rbrack)OutGraph([1,2,3],[UndirectedEdge(1,2),UndirectedEdge(1,3),UndirectedEdge(2,3)])\mathrm{Graph}(\bigl\lbrack1, 2, 3\bigr\rbrack, \bigl\lbrack\mathrm{UndirectedEdge}(1, 2), \mathrm{UndirectedEdge}(1, 3), \mathrm{UndirectedEdge}(2, 3)\bigr\rbrack)
About
Examples2
Checked againstWolfram Language 2 agree
CrosswalkWolfram Language

See also: DirectedEdge, Graph