Skip to content
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

Expand graph operations #440

Open
georgios-ts opened this issue Sep 8, 2021 · 3 comments
Open

Expand graph operations #440

georgios-ts opened this issue Sep 8, 2021 · 3 comments
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@georgios-ts
Copy link
Collaborator

georgios-ts commented Sep 8, 2021

What is the expected enhancement?

Graph operations (https://en.wikipedia.org/wiki/Graph_operations) produce new graphs from initial ones. Right now retworkx can compose, take the union of two graphs or return the complement of a graph. We can expand this list similar to NetworkX functionality https://networkx.org/documentation/stable/reference/algorithms/operators.html.

@georgios-ts georgios-ts added enhancement New feature or request good first issue Good for newcomers labels Sep 8, 2021
@nahumsa
Copy link
Contributor

nahumsa commented Oct 18, 2021

I would like to work on the cartesian_product of graphs.
If anyone is already working on it, please let me know.

This was referenced Oct 20, 2021
@e-eight
Copy link
Contributor

e-eight commented Oct 27, 2021

I plan to work on the symmetric difference operation. If anyone is already working on it, please let me know.

mtreinish pushed a commit that referenced this issue Dec 3, 2021
This commit adds the Cartesian Product for PyDiGraph and
PyGraph. After this commit it is possible to rewrite the
grid_graph generator to generate N-dimensional graphs.

Related to #440

* add cartesian product

* add edge weights

Co-authored-by: georgios-ts <45130028+georgios-ts@users.noreply.github.com>

* add weight handling

* lint

* fmt

* add capacity for the final_graph

Co-authored-by: georgios-ts <45130028+georgios-ts@users.noreply.github.com>

* fix digraph_cartesian_product doc

Co-authored-by: georgios-ts <45130028+georgios-ts@users.noreply.github.com>

* add node references

* remove unwrap

Co-authored-by: georgios-ts <45130028+georgios-ts@users.noreply.github.com>

* add custom return type for the node map created in cartesian product

* add second return

* add `cartesian_product` to __init__

* fix register

* Update src/cartesian_product.rs

Co-authored-by: georgios-ts <45130028+georgios-ts@users.noreply.github.com>

* update docstring

* updated docstring

* fix docs

Co-authored-by: georgios-ts <45130028+georgios-ts@users.noreply.github.com>
Co-authored-by: georgios-ts <ts.giorgos@yahoo.gr>
e-eight pushed a commit to e-eight/retworkx that referenced this issue Dec 5, 2021
This commit adds the Cartesian Product for PyDiGraph and
PyGraph. After this commit it is possible to rewrite the
grid_graph generator to generate N-dimensional graphs.

Related to Qiskit#440

* add cartesian product

* add edge weights

Co-authored-by: georgios-ts <45130028+georgios-ts@users.noreply.github.com>

* add weight handling

* lint

* fmt

* add capacity for the final_graph

Co-authored-by: georgios-ts <45130028+georgios-ts@users.noreply.github.com>

* fix digraph_cartesian_product doc

Co-authored-by: georgios-ts <45130028+georgios-ts@users.noreply.github.com>

* add node references

* remove unwrap

Co-authored-by: georgios-ts <45130028+georgios-ts@users.noreply.github.com>

* add custom return type for the node map created in cartesian product

* add second return

* add `cartesian_product` to __init__

* fix register

* Update src/cartesian_product.rs

Co-authored-by: georgios-ts <45130028+georgios-ts@users.noreply.github.com>

* update docstring

* updated docstring

* fix docs

Co-authored-by: georgios-ts <45130028+georgios-ts@users.noreply.github.com>
Co-authored-by: georgios-ts <ts.giorgos@yahoo.gr>
@nahumsa
Copy link
Contributor

nahumsa commented Feb 10, 2022

Since that are a lot of graph operations that could be implemented, I think it is useful to have a summary of which operations are already implemented. Let me know if I missed something.

Operations:

mtreinish pushed a commit that referenced this issue Feb 19, 2022
This adds the tensor product of graphs for PyDiGraph and PyGraph.

This PR is related to #440.

* add tensor product

* lint

* fix release notes

* add ProductNodeMap to tensor product

* Update releasenotes/notes/add-tensor-product-651db371a96d650c.yaml

* lint

* black lint

* black lint

* fix docs

* add for loop for clarity

* add with_capacity for final_graph

* add node_map and edge assertions

* lint

* Change to assert equals

* Update assert equal
InnovativeInventor pushed a commit to InnovativeInventor/retworkx that referenced this issue Mar 19, 2022
This adds the tensor product of graphs for PyDiGraph and PyGraph.

This PR is related to Qiskit#440.

* add tensor product

* lint

* fix release notes

* add ProductNodeMap to tensor product

* Update releasenotes/notes/add-tensor-product-651db371a96d650c.yaml

* lint

* black lint

* black lint

* fix docs

* add for loop for clarity

* add with_capacity for final_graph

* add node_map and edge assertions

* lint

* Change to assert equals

* Update assert equal
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

3 participants