rustworkx
rustworkx copied to clipboard
A BFS layers algorithm
What is the expected enhancement?
Should be similar to the networkx API: https://networkx.org/documentation/stable/reference/algorithms/generated/networkx.algorithms.traversal.breadth_first_search.bfs_layers.html
It would be great to allow using the visit.BFSVisitor
feature, like the current rustworkx bfs_search
implementation
I would like to be assigned to this task, if possible
@mtreinish Not sure if this task is still up for grabs, but glad to take it on at some point!
@abhamra sure thing, I've assigned the issue to you.
Should it be a pub fn
in https://github.com/Qiskit/rustworkx/blob/main/rustworkx-core/src/traversal/bfs_visit.rs ?
Should it be a
pub fn
in https://github.com/Qiskit/rustworkx/blob/main/rustworkx-core/src/traversal/bfs_visit.rs ?
I had a similar question; essentially, do we want it in rustworkx-core
so it's supported for all petgraphs, or just for the Python graph / digraphs through src/traversal/mod.rs
, which is where bfs_search
is?
I think ideally we'd add the interface to rustworkx-core too. The underlying implementation of bfs_search
relies on the rustworkx-core function @1ucian0 linked to above. For this I'd expect we'd follow the same pattern so that we expose a rust API from rustworkx-core and use that in the python side of the library.
@abhamra can you create a PR to see where you are and discuss further steps?