ReverseGraph[g]
gives the reverse graph of the directed graph g.
ReverseGraph[{vw,…}]
uses rules vw to specify the graph g.
ReverseGraph
ReverseGraph[g]
gives the reverse graph of the directed graph g.
ReverseGraph[{vw,…}]
uses rules vw to specify the graph g.
Details and Options
- ReverseGraph is also known as transpose graph or converse graph.
- The reverse graph has the same vertices as g and the reverse edges.
- ReverseGraph works with directed graphs, multigraphs, and mixed graphs.
Examples
open all close allBasic Examples (1)
Scope (6)
ReverseGraph does not affect undirected graphs:
ReverseGraph[[image]]ReverseGraph works with directed graphs:
ReverseGraph[[image]]ReverseGraph[[image]]ReverseGraph[[image]]Use rules to specify the graph:
ReverseGraph[{1 -> 3, 2 -> 1, 3 -> 6, 4 -> 6, 1 -> 5, 5 -> 4, 6 -> 1}]ReverseGraph works with large graphs:
g = GridGraph[{10, 10, 10, 10}, DirectedEdges -> True];ReverseGraph[g];//TimingProperties & Relations (3)
ReverseGraph has the same VertexList as the original graph:
VertexList[[image]] == VertexList[ReverseGraph[[image]]]ReverseGraph is equivalent to reversing edges:
g = [image];Graph[VertexList[g], Reverse /@ EdgeList[g], AbsoluteOptions[g, VertexCoordinates], EdgeStyle -> Arrowheads[Small]]The adjacency matrix of a reverse graph is the transpose of the matrix of the original graph:
g = [image];AdjacencyMatrix[ReverseGraph[g]] == AdjacencyMatrix[g]See Also
Related Guides
Text
Wolfram Research (2010), ReverseGraph, Wolfram Language function, https://reference.wolfram.com/language/ref/ReverseGraph.html (updated 2015).
CMS
Wolfram Language. 2010. "ReverseGraph." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2015. https://reference.wolfram.com/language/ref/ReverseGraph.html.
APA
Wolfram Language. (2010). ReverseGraph. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/ReverseGraph.html
BibTeX
@misc{reference.wolfram_2026_reversegraph, author="Wolfram Research", title="{ReverseGraph}", year="2015", howpublished="\url{https://reference.wolfram.com/language/ref/ReverseGraph.html}", note=[Accessed: 13-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_reversegraph, organization={Wolfram Research}, title={ReverseGraph}, year={2015}, url={https://reference.wolfram.com/language/ref/ReverseGraph.html}, note=[Accessed: 13-June-2026]}