The transpose of a digraph D is the graph formed by taking every edge (u,v) in D and changing it to (v,u). Intuitively, it reverses the direction of all the edges while keeping the same vertex set. One can also view the transpose in terms of adjacency matrices, where the adjacency matrix of the transpose of D is the transpose of the adjacency matrix of D. In this way, we quickly see that the transpose of a transpose digraph is the original digraph, and that this operator is trivial for simple graphs since they have symmetric matrices.
i1 : D = digraph ({{1,2},{2,3},{3,4},{4,1},{1,3},{4,2}},EntryMode=>"edges") o1 = Digraph{1 => {2, 3}} 2 => {3} 3 => {4} 4 => {1, 2} o1 : Digraph |
i2 : D' = digraphTranspose D o2 = Digraph{1 => {4} } 2 => {1, 4} 3 => {1, 2} 4 => {3} o2 : Digraph |
i3 : D'' = digraphTranspose D' o3 = Digraph{1 => {2, 3}} 2 => {3} 3 => {4} 4 => {1, 2} o3 : Digraph |
The object digraphTranspose is a method function.