rustworkx icon indicating copy to clipboard operation
rustworkx copied to clipboard

Add checking for self loops and parallel edges

Open enavarro51 opened this issue 2 years ago • 0 comments

What is the expected enhancement?

There are 12 functions in rustworkx that state the following in the docs,

///     The function implicitly assumes that there are no parallel edges
///     or self loops. It may produce incorrect/unexpected results if the
///     input graph has self loops or parallel edges.

To prevent unexpected behavior, it would be good if all these functions checked for parallel edges or self loops in the input graph and errored out if found. The check could be put into rustworkx-core/src/utils.rs.

enavarro51 avatar Feb 04 '23 21:02 enavarro51