WOLFRAM

gives a directed graph from the undirected graph g.

DirectedGraph[g,conv]

gives a directed graph using the conversion conv.

DirectedGraph[{vw,},]

uses rules vw to specify the graph g.

Details and Options

Examples

open allclose all

Basic Examples  (3)Summary of the most common use cases

Convert each undirected edge of the graph to both directions:

Out[1]=1

A random direction:

Out[1]=1

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

Out[1]=1

Scope  (6)Survey of the scope of standard use cases

The input is unchanged for directed graphs:

Out[2]=2

DirectedGraph works with undirected graphs:

Out[1]=1

Multigraphs:

Out[1]=1

Mixed graphs:

Out[1]=1

Use rules to specify the graph:

Out[1]=1

DirectedGraph works with large graphs:

Out[2]=2

Applications  (1)Sample problems that can be solved with this function

Find strongly connected components in a random directed grid graph:

Highlight the components of size greater than 1:

Out[3]=3

Properties & Relations  (3)Properties of the function, and connections to other functions

A directed graph can be constructed by a list of DirectedEdge objects:

Out[1]=1
Out[2]=2

A graph is either undirected or directed:

Out[2]=2
Out[3]=3

A nonsymmetric adjacency matrix is interpreted to be a directed graph:

Out[2]=2
Out[3]=3

Use DirectedEdges->False to interpret it as an undirected graph:

Out[4]=4
Wolfram Research (2010), DirectedGraph, Wolfram Language function, https://reference.wolfram.com/language/ref/DirectedGraph.html (updated 2015).
Wolfram Research (2010), DirectedGraph, Wolfram Language function, https://reference.wolfram.com/language/ref/DirectedGraph.html (updated 2015).

Text

Wolfram Research (2010), DirectedGraph, Wolfram Language function, https://reference.wolfram.com/language/ref/DirectedGraph.html (updated 2015).

Wolfram Research (2010), DirectedGraph, Wolfram Language function, https://reference.wolfram.com/language/ref/DirectedGraph.html (updated 2015).

CMS

Wolfram Language. 2010. "DirectedGraph." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2015. https://reference.wolfram.com/language/ref/DirectedGraph.html.

Wolfram Language. 2010. "DirectedGraph." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2015. https://reference.wolfram.com/language/ref/DirectedGraph.html.

APA

Wolfram Language. (2010). DirectedGraph. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/DirectedGraph.html

Wolfram Language. (2010). DirectedGraph. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/DirectedGraph.html

BibTeX

@misc{reference.wolfram_2025_directedgraph, author="Wolfram Research", title="{DirectedGraph}", year="2015", howpublished="\url{https://reference.wolfram.com/language/ref/DirectedGraph.html}", note=[Accessed: 29-May-2025 ]}

@misc{reference.wolfram_2025_directedgraph, author="Wolfram Research", title="{DirectedGraph}", year="2015", howpublished="\url{https://reference.wolfram.com/language/ref/DirectedGraph.html}", note=[Accessed: 29-May-2025 ]}

BibLaTeX

@online{reference.wolfram_2025_directedgraph, organization={Wolfram Research}, title={DirectedGraph}, year={2015}, url={https://reference.wolfram.com/language/ref/DirectedGraph.html}, note=[Accessed: 29-May-2025 ]}

@online{reference.wolfram_2025_directedgraph, organization={Wolfram Research}, title={DirectedGraph}, year={2015}, url={https://reference.wolfram.com/language/ref/DirectedGraph.html}, note=[Accessed: 29-May-2025 ]}