DirectedGraphQ

DirectedGraphQ[g]
yields True if the graph g is a directed graph and False otherwise.

DetailsDetails

  • A graph is directed if it contains at least one edge, and every edge in the graph is directed.

ExamplesExamplesopen allclose all

Basic Examples  (2)Basic Examples  (2)

Test whether a graph is directed:

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

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]=
Introduced in 2010
(8.0)