Construct the transitive closure graph of a simple directed graph and visualize the two graphs.
>

$\mathrm{with}\left(\mathrm{GraphTheory}\right)\:$

>

$G\u2254\mathrm{Graph}\left(6\,\left\{\left[1\,2\right]\,\left[2\,3\right]\,\left[2\,4\right]\,\left[4\,5\right]\right\}\right)$

${G}{\u2254}{\mathrm{Graph\; 1:\; a\; directed\; unweighted\; graph\; with\; 6\; vertices\; and\; 4\; arc(s)}}$
 (1) 
>

$H\u2254\mathrm{TransitiveClosure}\left(G\right)$

${H}{\u2254}{\mathrm{Graph\; 2:\; a\; directed\; unweighted\; graph\; with\; 6\; vertices\; and\; 8\; arc(s)}}$
 (2) 
>

$\mathrm{DrawGraph}\left(\left[G\,H\right]\,\mathrm{style}=\mathrm{circle}\right)$

Construct the transitive closure graph with edge weights corresponding to the path lengths in the original graph. For example, because the shortest path in G from 1 to 5 has 3 steps (1→2→4→5), the arc in TCW has weight 3.
>

$\mathrm{TCW}\u2254\mathrm{TransitiveClosure}\left(G\,\mathrm{weighted}=\mathrm{true}\right)$

${\mathrm{TCW}}{\u2254}{\mathrm{Graph\; 3:\; a\; directed\; weighted\; graph\; with\; 6\; vertices\; and\; 8\; arc(s)}}$
 (3) 
>

$\mathrm{DrawGraph}\left(\mathrm{TCW}\,\mathrm{showweights}\,\mathrm{style}=\mathrm{circle}\right)$
