rustworkx icon indicating copy to clipboard operation
rustworkx copied to clipboard

A BFS layers algorithm

Open LaurentBergeron opened this issue 2 years ago • 7 comments

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

LaurentBergeron avatar Feb 02 '23 21:02 LaurentBergeron

I would like to be assigned to this task, if possible

abhamra avatar Oct 04 '23 22:10 abhamra

@mtreinish Not sure if this task is still up for grabs, but glad to take it on at some point!

abhamra avatar Oct 08 '23 01:10 abhamra

@abhamra sure thing, I've assigned the issue to you.

mtreinish avatar Oct 08 '23 21:10 mtreinish

Should it be a pub fn in https://github.com/Qiskit/rustworkx/blob/main/rustworkx-core/src/traversal/bfs_visit.rs ?

1ucian0 avatar May 29 '24 10:05 1ucian0

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?

abhamra avatar May 30 '24 00:05 abhamra

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.

mtreinish avatar May 30 '24 11:05 mtreinish

@abhamra can you create a PR to see where you are and discuss further steps?

mircomarahrens avatar Jul 24 '24 12:07 mircomarahrens