-
Notifications
You must be signed in to change notification settings - Fork 161
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Expanded grid_graph functionality #1327
Comments
Looks like this is a specific request related to Issue #150 |
I don't think we have anyone working on adding those specific generators now. But if you submitted them I'd me happy to review. For the special case of grid graphs, I think you can achieve a somewhat similar result with https://www.rustworkx.org/apiref/rustworkx.cartesian_product.html#rustworkx.cartesian_product and taking the product of https://www.rustworkx.org/dev/apiref/rustworkx.graph_line_graph.html in the meantime. Of course the intermediary graphs are not very useful, but it shouldn't be hard to beat Python for loops performance wise. |
Thanks for the suggestion. I know that networkx uses 3D example:
|
That makes sense. By the way, once #1292 is released in 0.16 I think your code will also run faster if you switch to the iterators |
Yes! Fantastic, I initially started with a generator expression and was disappointed to see it wasn't supported. I assumed it was a quirk related to rust, but glad to see it'll be supported soon. If I submit a PR with pythonic solutions will that be acceptable for the code base? I'm happy to generalize and clean up my code, but I don't want to mess with rust. |
I’d say as a draft it would be welcome. At the very least it would be useful for the unit tests as they are written in Python. We could test the final Rust implementation using your Python implementation as a reference |
What is the expected enhancement?
grid_graph in rustworkx only reproduces the functionality of grid_2d_graph from networkx. It would be convenient to extend grid_graph to higher dimensions in rustworkx, as I find graph generation is a significant bottleneck for my code.
Additionally, it would be very nice to see an extension of grid_graph to more lattice types, such as fcc, bcc, hexagonal 3d. This should also come with a flag to auto-label nodes with a tuple/vector containing spatial information.
The text was updated successfully, but these errors were encountered: