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

DirectedGraphQ

DirectedGraphQ[g]
yields True if the graph g is a directed graph and False otherwise.
  • A graph is directed if it contains at least one edge and every edge in the graph is directed.
Test whether a graph is directed:
DirectedGraphQ gives False for inputs that are not directed graphs:
Test whether a graph is directed:
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]=
 
DirectedGraphQ gives False for inputs that are not directed graphs:
In[1]:=
Click for copyable input
Out[1]=
In[2]:=
Click for copyable input
Out[2]=
Test undirected and directed graphs:
DirectedGraphQ gives False for anything that is not a directed graph:
Test large graphs:
A directed graph can have self-loops:
A non-symmetric adjacency matrix corresponds to a directed graph:
The incidence matrix of a directed graph has at least one entry which is :
DirectedGraphQ gives False for non-explicit graphs:
New in 8