-
Notifications
You must be signed in to change notification settings - Fork 93
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
two sided dijkstra #268
Open
Dolgalad
wants to merge
19
commits into
JuliaGraphs:master
Choose a base branch
from
Dolgalad:bidij
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
two sided dijkstra #268
Changes from all commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
9b43737
added bidijkstra_shortest_path (documentation and test needed)
b37aefd
added bidijkstra_shortest_path (documentation and test needed)
779b167
Merge remote-tracking branch 'refs/remotes/origin/bidij' into bidij
a2d65d4
exporting bidijkstra_shortest_path
d28db69
simple test for bidijkstra_shortest_path function
515091c
bidijkstra_shortest_path documentation
e3bede8
Merge branch 'master' into pr/Dolgalad/268
gdalle 20b5bb8
removed undesired dependencies Distributions, StatsPlots
2abd6b7
removed spaces, Int64[]->Int[]
7504b6d
using relax in dijkstra_shortest_paths
806593d
relax arguments u,v now untyped
0de4e92
bidijkstra_shortest_path tests
cb9eebe
cosmetic mu to \mu
e9aecef
Merge remote-tracking branch 'upstream/master' into bidij
40bb78a
docstring correction
22670f3
Merge remote-tracking branch 'upstream/master' into bidij
3b2d21a
solved issue when dealing with directed graphs
313c464
error in building path when midpoint corresponds to either source or …
08d696a
reverting to old dijkstra implementation (not relying on relax functi…
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
@testset "Bidijkstra" begin | ||
g3 = path_graph(5) | ||
g4 = path_digraph(5) | ||
|
||
d1 = float([0 1 2 3 4; 5 0 6 7 8; 9 10 0 11 12; 13 14 15 0 16; 17 18 19 20 0]) | ||
d2 = sparse(float([0 1 2 3 4; 5 0 6 7 8; 9 10 0 11 12; 13 14 15 0 16; 17 18 19 20 0])) | ||
for g in testgraphs(g3), dg in testdigraphs(g4) | ||
@test @inferred(bidijkstra_shortest_path(g, 1, 4, d1)) == | ||
@inferred(bidijkstra_shortest_path(dg, 1, 4, d1)) == | ||
@inferred(bidijkstra_shortest_path(g, 1, 4, d2)) | ||
@test isempty(@inferred(bidijkstra_shortest_path(dg, 4, 1))) | ||
end | ||
|
||
# test for #1258 | ||
g = complete_graph(4) | ||
w = float([1 1 1 4; 1 1 1 1; 1 1 1 1; 4 1 1 1]) | ||
ds = dijkstra_shortest_paths(g, 1, w) | ||
@test length(bidijkstra_shortest_path(g, 1, 4, w)) == 3 # path is a sequence of vertices | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This relax function clarifies things, would it be hard to add it to the original
dijkstra
too?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was hoping you would notice =p I'll make the changes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have a new version of the
relax
function that should work for both thedijkstra_shortest_paths
andbidijkstra_shortest_path
but it is a bit clunky. I am wondering; why the need for theparents
andpreds
structures ? wouldn't the list of predecessors be enough ?A cosmetic note: should we rename the function the
bidijkstra_shortest_paths
if it should be able to deal with multiple paths ?