This is documentation for Mathematica 8, which was
based on an earlier version of the Wolfram Language.
View current documentation (Version 11.1)

SimpleGraphQ

SimpleGraphQ[g]
yields True if the graph g is a simple graph and False otherwise.
  • A graph is simple if it has no self-loops or multiple edges between the same vertices.
Test whether a graph is simple:
Non-simple graphs:
Test whether a graph is simple:
In[1]:=
Click for copyable input
Out[1]=
In[2]:=
Click for copyable input
Out[2]=
In[3]:=
Click for copyable input
Out[3]=
 
Non-simple graphs:
In[1]:=
Click for copyable input
Out[1]=
Test undirected and directed graphs:
SimpleGraphQ gives False for expressions that are not simple graphs:
Test large graphs:
A graph with self-loops is not simple:
A simple graph can have a cycle:
A simple graph can be bipartite:
A PathGraph is always simple:
The adjacency matrix of a simple graph has zeros on the diagonal:
The incidence matrix of a simple graph has entries -1, 0, or 1:
All vertices of a simple graph have maximum degree less than the number of vertices:
A nontrivial simple graph must have at least one pair of vertices with the same degree:
A simple graph can have two edges between the same vertices but with opposite direction:
SimpleGraphQ gives False for non-explicit graphs:
New in 8