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

DirectedGraph

DirectedGraph[g]
gives a directed graph from the undirected graph g.
DirectedGraph
gives a directed graph using the conversion conv.
  • The following conversions conv can be used:
Automaticconvert to both and
"Acyclic"convert to if u precedes v in the vertex list and otherwise
"Random"convert to either or randomly
Convert each undirected edge of the graph to both directions:
A random direction:
Convert each undirected edge of the graph to both directions:
In[1]:=
Click for copyable input
Out[1]=
 
A random direction:
In[1]:=
Click for copyable input
Out[1]=
The input is unchanged for directed graphs:
DirectedGraph works with undirected graphs:
Works with large graphs:
Find strongly connected components in a random directed grid graph:
Highlight the components of size greater than 1:
A directed graph can be constructed by a list of DirectedEdge objects:
A graph is either undirected or directed:
A non-symmetric adjacency matrix is interpreted to be a directed graph:
Use DirectedEdges->False to interpret it as an undirected graph:
New in 8