Note

This documents the development version of NetworkX. Documentation for the current release can be found here.

networkx.algorithms.operators.unary.reverse

reverse(G, copy=True)[source]

Returns the reverse directed graph of G.

Parameters
Gdirected graph

A NetworkX directed graph

copybool

If True, then a new graph is returned. If False, then the graph is reversed in place.

Returns
Hdirected graph

The reversed G.