Qiskit / rustworkx

A high performance Python graph library implemented in Rust.
https://www.rustworkx.org
Apache License 2.0
967 stars 140 forks source link

Move `collect_runs()` functionality to rustworkx-core #1199

Closed mtreinish closed 2 weeks ago

mtreinish commented 1 month ago

What is the expected enhancement?

The collect_runs() function is only exposed via a Python interface currently:

https://github.com/Qiskit/rustworkx/blob/0ec113b077fc27943947496cbef4f88daed558bf/src/dag_algo/mod.rs#L607-L670

We should port it to rustworkx-core, so that rust users can leverage the function.

One tweak that probably makes sense for the rustworkx-core version is that instead of returning a Vec of Vecs of node weights we should have it return of an iterator of Vecs node ids. This would be more flexible and performant for rust space users and for the python side of rustworkx we can just collect the iterator to a Vec (for backwards compatibility).

enavarro51 commented 1 month ago

@mtreinish Is this needed for 0.15.0? I can take this on, but it may take me a couple of weeks and I didn't want to hold up 0.15.0 release.

mtreinish commented 1 month ago

Yeah, I was thinking of trying to squeeze this into 0.15.0 if possible. But also I was viewing this and the other issues I was opening around moving a function into rustworkx-core as good first issues for people trying to get their feet wet with the language since their a good way to start learning about generics and traits.

eliarbel commented 1 month ago

I'd be happy to have it as my first Rust issue