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

Add to_undirected method for PyDiGraph #153

Closed
mtreinish opened this issue Sep 30, 2020 · 0 comments · Fixed by #161
Closed

Add to_undirected method for PyDiGraph #153

mtreinish opened this issue Sep 30, 2020 · 0 comments · Fixed by #161
Assignees
Labels
enhancement New feature or request good first issue Good for newcomers
Milestone

Comments

@mtreinish
Copy link
Member

What is the expected enhancement?

There is no method (short of going over the edge list manually in python) to take a PyDiGraph object with directed edges and generating a PyGraph object from it with undirected edges. We should have a to_undirected method for a PyDiGraph that will treat every edge in the graph as undirected and generate a new PyGraph object from it.

@mtreinish mtreinish added enhancement New feature or request good first issue Good for newcomers labels Sep 30, 2020
mtreinish added a commit to mtreinish/retworkx that referenced this issue Oct 2, 2020
This commit adds a new method to the PyDiGraph class, to_undirected(),
which will generate an undirected PyGraph object from the PyDiGraph
object.

Fixes Qiskit#153
@mtreinish mtreinish added this to the 0.6.0 milestone Oct 6, 2020
@mtreinish mtreinish self-assigned this Oct 15, 2020
mtreinish added a commit that referenced this issue Nov 2, 2020
This commit adds a new method to the PyDiGraph class, to_undirected(),
which will generate an undirected PyGraph object from the PyDiGraph
object.

Fixes #153
mtreinish added a commit that referenced this issue Nov 9, 2020
* Add to_undirected method for PyDiGraph

This commit adds a new method to the PyDiGraph class, to_undirected(),
which will generate an undirected PyGraph object from the PyDiGraph
object.

Fixes #153

* Fix lint

* Add Dijkstra shortest path functions

This commit adds 2 new functions, digraph_dijkstra_shortest_paths() and
graph_dijkstra_shortest_path(), which is a function to get the shortest
path from a node in a graph. It leverages the same dijkstra's algorithm
module which has been modified to get a path in addition to the path
length.

Depends on #161
Fixes #151

* Fix lint

* Fix duplicate weight_callable functions from rebase

This commit fixes an issue with duplicate weight_callable functions that
happened because one was added in this PR's branch and another was
added in a different PR. The functions were mostly identical so this
just consolidates the 2.

* Apply suggestions from code review

Co-authored-by: Lauren Capelluto <laurencapelluto@gmail.com>

* Add docs for paths parameter in dijkstra::dijkstra

* Use setUp() to build common test graphs

* Move path HashMap initialization into dijkstra::dijkstra()

Co-authored-by: Lauren Capelluto <laurencapelluto@gmail.com>
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

Successfully merging a pull request may close this issue.

1 participant