Mathematica 9 is now available
THIS IS DOCUMENTATION FOR AN OBSOLETE PRODUCT.
SEE THE DOCUMENTATION CENTER FOR THE LATEST INFORMATION.
Mathematica > Mathematics and Algorithms > Graphs & Networks > Graph Predicates and Properties > UndirectedGraphQ >
Mathematica > Visualization and Graphics > Graphs & Networks > Graph Predicates and Properties > UndirectedGraphQ >

UndirectedGraphQ

UndirectedGraphQ[g]
yields True if the graph g is an undirected graph and False otherwise.
  • A graph is undirected if every edge in the graph is undirected.
Test whether a graph is undirected:
UndirectedGraphQ gives False for inputs that are not undirected graphs:
Test whether a graph is undirected:
In[1]:=
Click for copyable input
Out[1]=
In[2]:=
Click for copyable input
Out[2]=
In[3]:=
Click for copyable input
Out[3]=
In[4]:=
Click for copyable input
Out[4]=
In[5]:=
Click for copyable input
Out[5]=
In[6]:=
Click for copyable input
Out[6]=
 
UndirectedGraphQ gives False for inputs that are not undirected graphs:
In[1]:=
Click for copyable input
Out[1]=
In[2]:=
Click for copyable input
Out[2]=
Test undirected and directed graphs:
UndirectedGraphQ gives False for anything that is not an undirected graph:
Test large graphs:
The empty graphs are undirected graphs:
An undirected graph can have self-loops:
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:
UndirectedGraphQ gives False for non-explicit graphs:
New in 8
Ask a question about this page  |  Suggest an improvement  |  Leave a message for the team
Format:   HTML  |  CDF