UndirectedGraph

UndirectedGraph[g]

gives an undirected graph from the directed graph g.

UndirectedGraph[{vw,}]

uses rules vw to specify the graph g.

Details and Options

  • The undirected edge uv is an edge in the resulting undirected graph if either of the directed edges uv or vu is an edge of g.
  • UndirectedGraph works with directed graphs, multigraphs, and mixed graphs.

Examples

open allclose all

Basic Examples  (1)

Give an undirected graph from a directed graph:

Scope  (7)

The input is unchanged for undirected graphs:

UndirectedGraph works with directed graphs:

Multigraphs:

Mixed graphs:

Use rules to specify the graph:

Directed edges with different directions convert to one undirected edge:

UndirectedGraph works with large graphs:

Properties & Relations  (4)

An undirected graph can be constructed by a list of UndirectedEdge objects:

A graph is either undirected or directed:

A symmetric adjacency matrix is interpreted to be an undirected graph:

Use DirectedEdges->True to interpret it as a directed graph:

The incidence matrix of an undirected graph has no negative entries:

Wolfram Research (2010), UndirectedGraph, Wolfram Language function, https://reference.wolfram.com/language/ref/UndirectedGraph.html (updated 2015).

Text

Wolfram Research (2010), UndirectedGraph, Wolfram Language function, https://reference.wolfram.com/language/ref/UndirectedGraph.html (updated 2015).

CMS

Wolfram Language. 2010. "UndirectedGraph." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2015. https://reference.wolfram.com/language/ref/UndirectedGraph.html.

APA

Wolfram Language. (2010). UndirectedGraph. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/UndirectedGraph.html

BibTeX

@misc{reference.wolfram_2024_undirectedgraph, author="Wolfram Research", title="{UndirectedGraph}", year="2015", howpublished="\url{https://reference.wolfram.com/language/ref/UndirectedGraph.html}", note=[Accessed: 17-November-2024 ]}

BibLaTeX

@online{reference.wolfram_2024_undirectedgraph, organization={Wolfram Research}, title={UndirectedGraph}, year={2015}, url={https://reference.wolfram.com/language/ref/UndirectedGraph.html}, note=[Accessed: 17-November-2024 ]}