-
Notifications
You must be signed in to change notification settings - Fork 145
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add APIs to update an edge's data payload inplace (#236)
* Add APIs to update an edge's data payload inplace This commit adds 2 new methods to the graph classes, update_edge and update_edge_by_index, which are used to update the data payload/weight of an edge in the graph in place. Prior to this the only way to update an edge would be to remove it and add a new edge with the new data payload which may change the edge index (assuming something was using it). * Apply suggestions from code review Co-authored-by: Lauren Capelluto <laurencapelluto@gmail.com> * Add tests with parallel edges Co-authored-by: Lauren Capelluto <laurencapelluto@gmail.com>
- Loading branch information
1 parent
9d8d505
commit f908abb
Showing
5 changed files
with
194 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
--- | ||
features: | ||
- | | ||
Two new methods, :meth:`~retworkx.PyDiGraph.update_edge` and | ||
:meth:`~retworkx.PyDiGraph.update_edge_by_index` were added to the | ||
:class:`retworkx.PyDiGraph` and :class:`retworkx.PyGraph` ( | ||
:meth:`~retworkx.PyGraph.update_edge` and | ||
:meth:`~retworkx.PyGraph.update_edge_by_index`) classes. These methods | ||
are used to update the data payload/weight of an edge in the graph either | ||
by the nodes of an edge or by edge index. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters