diff --git a/releasenotes/notes/added-reverse-inplace-for-digraph-c59759a1d54edb1a.yaml b/releasenotes/notes/added-reverse-inplace-for-digraph-c59759a1d54edb1a.yaml new file mode 100644 index 0000000000..c30ef57352 --- /dev/null +++ b/releasenotes/notes/added-reverse-inplace-for-digraph-c59759a1d54edb1a.yaml @@ -0,0 +1,17 @@ +--- +features: + - | + The :class:`~rustworkx.PyDiGraph` class has a new method + :meth:`~rustworkx.PyDiGraph.reverse_inplace``. This function reverses the edges in the graph, inplace. + For example: + import rustworkx as rx + + graph = rx.PyDiGraph() + graph.add_nodes_from(range(4)) + graph.add_edge(0, 1, 3) + graph.add_edge(1, 2, 5) + graph.add_edge(2, 3, 2) + + graph.reverse_inplace() + + assert graph.edge_list() == [(3, 2), (2, 1), (1, 0)] \ No newline at end of file