SimpleGraph

SimpleGraph[g]

gives the underlying simple graph from the graph g.

SimpleGraph[{vw,}]

uses rules vw to specify the graph g.

Details and Options

  • SimpleGraph[g] removes all self-loops and multiple edges between the same vertices.
  • SimpleGraph preserves directed edges as directed. UndirectedGraph can be used to compute the underlying undirected graph.
  • SimpleGraph works with undirected graphs, directed graphs, multigraphs, and mixed graphs.

Examples

open allclose all

Basic Examples  (1)

Remove self-loops from a graph:

In[1]:=
Click for copyable input
Out[1]=

Scope  (6)

Properties & Relations  (7)

See Also

SimpleGraphQ  UndirectedGraph

Introduced in 2010
(8.0)
| Updated in 2015
(10.3)