Skip to content

Add weight functions to bidirectional_dijkstra and astar - #3799

Merged
dschult merged 7 commits into
networkx:masterfrom
boothby:issue3754
Jan 31, 2020
Merged

dschult merged 7 commits into
networkx:masterfrom
boothby:issue3754

Conversation

@boothby

@boothby boothby commented Jan 26, 2020

Copy link
Copy Markdown
Contributor

See discussion in #3754 and #3774.

Knock-on benefits:

  1. Uncovered/fixed an inconsistency in Bellman-Ford (easy 1-line fix)
  2. Added support for multigraphs in astar

@pep8speaks

pep8speaks commented Jan 26, 2020 •

Copy link
Copy Markdown

Hello @boothby! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:

There are currently no PEP 8 issues detected in this Pull Request. Cheers! 🍻

Comment last updated at 2020-01-31 03:40:01 UTC

@dschult

dschult commented Jan 28, 2020

Copy link
Copy Markdown
Member

small tweak -- I think this came from bellman-ford, but it is not needed.

G_succ = G._succ if G.is_directed() else G._adj . Should be just G_succ = G._adj

It's not needed because G._adj is always G._succ for directed graphs. It was designed that way so you can just use G._adj for successors whether G is directed or undirected.

@boothby

boothby commented Jan 28, 2020

Copy link
Copy Markdown
Contributor Author

Thanks for the heads-up! I'll fix that sometime tonight or tomorrow.

@dschult

dschult commented Jan 31, 2020

Copy link
Copy Markdown
Member

This looks good. Anything else before its merged?

@boothby

boothby commented Jan 31, 2020

Copy link
Copy Markdown
Contributor Author

Thanks! I've got nothing else to add

@boothby

boothby commented Jan 31, 2020

Copy link
Copy Markdown
Contributor Author

Trawling old tickets, I found #717, which is coincidentally addressed by commit d5aa0e8

@dschult
dschult merged commit 4f1d26f into networkx:master Jan 31, 2020
@boothby
boothby deleted the issue3754 branch January 31, 2020 22:18
kazimierz-256 pushed a commit to kazimierz-256/networkx that referenced this pull request Mar 20, 2020
Fixes networkx#3774 
Fixes networkx#3754 
Fixes networkx#717

* added tests for weight functions in shortest_path algorithms
    * networkx networkx#3774
    * networkx networkx#3754

* corrected edge direction in bellman-ford weight function

* support weight functions in bidirectional_dijkstra (networkx networkx#3754)

* support weight functions in astar (networkx networkx#3774)

* astar now supports multigraphs

* fixed pep8 issues

* reviewer comments
dschult pushed a commit that referenced this pull request May 7, 2020
Correct the docstring of the function astar_path for the commit  #3799

Fixes #3946
kiryph pushed a commit to kiryph/networkx that referenced this pull request Jul 21, 2020
Fixes networkx#3774 
Fixes networkx#3754 
Fixes networkx#717

* added tests for weight functions in shortest_path algorithms
    * networkx networkx#3774
    * networkx networkx#3754

* corrected edge direction in bellman-ford weight function

* support weight functions in bidirectional_dijkstra (networkx networkx#3754)

* support weight functions in astar (networkx networkx#3774)

* astar now supports multigraphs

* fixed pep8 issues

* reviewer comments
kiryph pushed a commit to kiryph/networkx that referenced this pull request Jul 21, 2020
Correct the docstring of the function astar_path for the commit  networkx#3799

Fixes networkx#3946
MridulS pushed a commit to MridulS/networkx that referenced this pull request Feb 4, 2023
Fixes networkx#3774 
Fixes networkx#3754 
Fixes networkx#717

* added tests for weight functions in shortest_path algorithms
    * networkx networkx#3774
    * networkx networkx#3754

* corrected edge direction in bellman-ford weight function

* support weight functions in bidirectional_dijkstra (networkx networkx#3754)

* support weight functions in astar (networkx networkx#3774)

* astar now supports multigraphs

* fixed pep8 issues

* reviewer comments
MridulS pushed a commit to MridulS/networkx that referenced this pull request Feb 4, 2023
Correct the docstring of the function astar_path for the commit  networkx#3799

Fixes networkx#3946
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

3 participants