UndirectedEdge

UndirectedEdge[u,v] or uv

represents an undirected edge between u and v.

UndirectedEdge[u,v,t] or uv

represents an undirected edge between u and v with tag t.

Details

Examples

open allclose all

Basic Examples  (5)

Build a graph with undirected edges:

List of edges:

Use ue to enter directly:

Enter using a two-way rule <->:

The two-way rules are converted to undirected edges:

Style and label individual edges:

StandardForm formatting:

Scope  (6)

Use wrappers to specify edge properties, including style:

Labels:

Interactive behavior:

Wrappers can be used to specify any supported edge annotation:

As well as new ones:

Use UndirectedEdge to specify individual edges for options, including style:

Labels:

Use a list of edges to indicate which edges to highlight:

A subgraph:

Use edge patterns to select and count edges:

Properties & Relations  (3)

Use UndirectedEdge to construct undirected graphs:

Tree graphs:

Path graphs:

Inside graph constructors, TwoWayRule[a,b] is converted to UndirectedEdge[a,b]:

The adjacency matrix of an undirected graph is symmetric:

Introduced in 2010
 (8.0)
 |
Updated in 2020
 (12.1)