 ReverseGraph - Maple Help

GraphTheory

 ReverseGraph
 construct reverse graph Calling Sequence ReverseGraph( G ) Parameters

 G - graph Description

 • The ReverseGraph( G ) command constructs the reverse graph of the graph G. The reverse graph is a graph with the same vertices as G but with the directions of all edges reversed.
 • This operation defined on all graphs but only gives meaningful results for directed graphs.
 • This operation is also known as the transpose graph or converse graph. The adjacency matrix of ReverseGraph(G) is the transpose of the adjacency matrix of G. Examples

Compute the reverse graph a simple directed graph.

 > $\mathrm{with}\left(\mathrm{GraphTheory}\right):$
 > $G≔\mathrm{Graph}\left(6,\left\{\left[1,2\right],\left[2,3\right],\left[2,4\right],\left[4,5\right]\right\}\right)$
 ${G}{≔}{\mathrm{Graph 1: a directed graph with 6 vertices and 4 arc\left(s\right)}}$ (1)
 > $\mathrm{DrawGraph}\left(G\right)$ > $H≔\mathrm{ReverseGraph}\left(G\right)$
 ${H}{≔}{\mathrm{Graph 2: a directed graph with 6 vertices and 4 arc\left(s\right)}}$ (2)
 > $\mathrm{DrawGraph}\left(H\right)$ > $\mathbf{use}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}\mathrm{LinearAlgebra}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}\mathbf{in}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}\mathrm{Equal}\left(\mathrm{AdjacencyMatrix}\left(H\right),\mathrm{Transpose}\left(\mathrm{AdjacencyMatrix}\left(G\right)\right)\right)\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}\mathbf{end use}$
 ${\mathrm{true}}$ (3) Compatibility

 • The GraphTheory[ReverseGraph] command was introduced in Maple 2016.