({{, (RefLink[DirectedEdges, paclet:ref/DirectedEdges]) 
is an option for (RefLink[Graph, paclet:ref/Graph]), (RefLink[GraphPlot, paclet:ref/GraphPlot]), and related functions that specifies whether edges should be taken to be directed.}})

OpenersNotesSection(Spacer1)Details and Options

(RefLink[DirectedEdges, paclet:ref/DirectedEdges])->(RefLink[True, paclet:ref/True]) specifies that edges should be directed.

(RefLink[DirectedEdges, paclet:ref/DirectedEdges])->(RefLink[False, paclet:ref/False]) specifies that edges should be undirected.

OpenersPrimaryExamplesSection(Spacer1)Examples  (10)

OpenersExampleSection0(Spacer1)Basic Examples  (5)

By default rules are taken to be directed edges:

Graph[{1->2,2->3,3->1}]

Specify undirected edges:

Graph[{1->2,2->3,3->1},DirectedEdges->False]

Obtain a (RefLink[CycleGraph, paclet:ref/CycleGraph]) with directed edges:

CycleGraph[6,DirectedEdges->True]

Create a directed graph from a symmetric adjacency matrix:

AdjacencyGraph[(({{0, 1, 1}, {1, 0, 1}, {1, 1, 0}})),DirectedEdges->True]

Show edges as arrows in (RefLink[GraphPlot, paclet:ref/GraphPlot]):

GraphPlot[{1->2,2->3,3->4,4->1,2->4,4->5,4->6},DirectedEdges->True]

Do not show edges as arrows in (RefLink[LayeredGraphPlot, paclet:ref/LayeredGraphPlot]):

LayeredGraphPlot[{1->2,2->3,3->4,4->1,2->4,4->5,4->6},DirectedEdges->False]

OpenersExampleSection1(Spacer1)Scope  (5)

(RefLink[DirectedEdges, paclet:ref/DirectedEdges]) is an option to special graph constructors including (RefLink[PathGraph, paclet:ref/PathGraph]):

PathGraph[Range[4],DirectedEdges->True]

(RefLink[CompleteGraph, paclet:ref/CompleteGraph]), (RefLink[GridGraph, paclet:ref/GridGraph]), and (RefLink[ButterflyGraph, paclet:ref/ButterflyGraph]):

{CompleteGraph[5,DirectedEdges->True],GridGraph[{2,3},DirectedEdges->True],ButterflyGraph[2,DirectedEdges->True]}

(RefLink[CycleGraph, paclet:ref/CycleGraph]), (RefLink[StarGraph, paclet:ref/StarGraph]), and (RefLink[WheelGraph, paclet:ref/WheelGraph]):

{CycleGraph[7,DirectedEdges->True],StarGraph[6,DirectedEdges->True],WheelGraph[6,DirectedEdges->True]}

(RefLink[CompleteKaryTree, paclet:ref/CompleteKaryTree]) and (RefLink[KaryTree, paclet:ref/KaryTree]):

{CompleteKaryTree[3,2,DirectedEdges->True],KaryTree[6,3,DirectedEdges->True]}

(RefLink[DirectedEdges, paclet:ref/DirectedEdges])->(RefLink[True, paclet:ref/True]) prevents (RefLink[AdjacencyGraph, paclet:ref/AdjacencyGraph]) from creating undirected graphs:

AdjacencyGraph[(({{0, 1, 1}, {1, 0, 1}, {1, 1, 0}})),DirectedEdges->True]

(RefLink[WeightedAdjacencyGraph, paclet:ref/WeightedAdjacencyGraph]):

WeightedAdjacencyGraph[(({{∞, 1, 2, ∞}, {1, ∞, 1, 1}, {2, 1, ∞, 3}, {∞, 1, 3, ∞}})),DirectedEdges->True]

(RefLink[DirectedEdges, paclet:ref/DirectedEdges]) works with (RefLink[RandomGraph, paclet:ref/RandomGraph]) and (RefLink[UniformGraphDistribution, paclet:ref/UniformGraphDistribution]):

RandomGraph[UniformGraphDistribution[5,6],DirectedEdges->True]

(RefLink[BernoulliGraphDistribution, paclet:ref/BernoulliGraphDistribution]):

RandomGraph[BernoulliGraphDistribution[5,0.6],DirectedEdges->True]

By default, edges are shown as lines in (RefLink[GraphPlot, paclet:ref/GraphPlot]) and (RefLink[TreePlot, paclet:ref/TreePlot]):

GraphPlot[{1->2,2->3,3->4,4->1,2->4}]

Show edges as arrows:

GraphPlot[{1->2,2->3,3->4,4->1,2->4},DirectedEdges->True]

By default, edges are shown as arrows in (RefLink[LayeredGraphPlot, paclet:ref/LayeredGraphPlot]):

LayeredGraphPlot[{1->2,2->3,3->4,1->4,2->5}]

This shows edges as lines:

LayeredGraphPlot[{1->2,2->3,3->4,1->4,2->5},DirectedEdges->False]

({{DocumentationFooterIconsRelatedFunction.png, ({{See Also}, {(RefLink[Graph, paclet:ref/Graph])  ▪  (RefLink[CycleGraph, paclet:ref/CycleGraph])  ▪  (RefLink[RandomGraph, paclet:ref/RandomGraph])  ▪  (RefLink[GraphPlot, paclet:ref/GraphPlot])  ▪  (RefLink[LayeredGraphPlot, paclet:ref/LayeredGraphPlot])}})}})

({{DocumentationFooterIconsRelatedTutorial.png, ({{Tutorials}, {▪(RefLinkPlain[Graph Drawing, paclet:tutorial/GraphDrawingOverview])}})}})