DirectedGraph

DirectedGraph[g]
gives a directed graph from the undirected graph g.

DirectedGraph[g, conv]
gives a directed graph using the conversion conv.

Details and OptionsDetails and Options

ExamplesExamplesopen allclose all

Basic Examples (3)Basic Examples (3)

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]=

A direction according to the vertex order in the vertex list:

In[1]:=
Click for copyable input
Out[1]=
New in 8
New to Mathematica? Find your learning path »
Have a question? Ask support »