({{, (RefLink[ReverseGraph, paclet:ref/ReverseGraph])[g] 
gives the reverse graph of the directed graph g.}, {, (RefLink[ReverseGraph, paclet:ref/ReverseGraph])[{v->w,…}]
uses rules v->w to specify the graph g.}})

OpenersNotesSection(Spacer1)Details and Options

The reverse graph has the same vertices as g and the reverse edges.

(RefLink[ReverseGraph, paclet:ref/ReverseGraph]) works with directed graphs, multigraphs, and mixed graphs.

OpenersPrimaryExamplesSection(Spacer1)Examples  (10)

OpenersExampleSection0(Spacer1)Basic Examples  (1)

The reverse graph of a directed graph:

ReverseGraph[]

OpenersExampleSection1(Spacer1)Scope  (6)

(RefLink[ReverseGraph, paclet:ref/ReverseGraph]) does not affect undirected graphs:

ReverseGraph[]

(RefLink[ReverseGraph, paclet:ref/ReverseGraph]) works with directed graphs:

ReverseGraph[]

Multigraphs:

ReverseGraph[]

Mixed graph:

ReverseGraph[]

Use rules to specify the graph:

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

(RefLink[ReverseGraph, paclet:ref/ReverseGraph]) works with large graphs:

g=GridGraph[{10,10,10,10},DirectedEdges->True];

ReverseGraph[g];//Timing

OpenersExampleSection4(Spacer1)Properties & Relations  (3)

(RefLink[ReverseGraph, paclet:ref/ReverseGraph]) has the same (RefLink[VertexList, paclet:ref/VertexList]) as the original graph:

VertexList[]==VertexList[ReverseGraph[]]

(RefLink[ReverseGraph, paclet:ref/ReverseGraph]) is equivalent to reversing edges:

g=;

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

AdjacencyMatrix[ReverseGraph[g]]==AdjacencyMatrix[g]\[Transpose]

({{DocumentationFooterIconsRelatedFunction.png, ({{See Also}, {(RefLink[DirectedGraph, paclet:ref/DirectedGraph])  ▪  (RefLink[UndirectedGraph, paclet:ref/UndirectedGraph])}})}})

({{DocumentationFooterIconsRelatedGuide.png, ({{Related Guides}, {▪(RefLinkPlain[Graph Operations and Modifications, paclet:guide/GraphModifications])}})}})