-
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
All simple paths (refresh #20) #353
Conversation
- this updates the port of sbromberger/LightGraphs.jl#1540 from JuliaGraphs#20 - has a number of simplifications relative to original implementation - original implementation by @i-aki-y - cutoff now defaults to `nv(g)` Co-authored-by: akiyuki ishikawa <[email protected]> Co-authored-by: Etienne dg <[email protected]>
- `format(Graphs, overwrite=true)`
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #353 +/- ##
==========================================
- Coverage 97.29% 97.28% -0.02%
==========================================
Files 117 118 +1
Lines 6814 6876 +62
==========================================
+ Hits 6630 6689 +59
- Misses 184 187 +3 ☔ View full report in Codecov by Sentry. |
documentation seems to be failing |
Should be fixed now, thanks. |
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 reviewed everything except the actual DFS, because I'm wondering if there is an exploitable overlap with #163
There is one API question we should settle: what should the set of all paths from I propose we change it to return EDIT: to be more explicit, the choices are between the following behaviors. Current behavior: g = path_graph(4)
@test Set(all_simple_paths(g, 1, 1)) == Set(Int[])
@test Set(all_simple_paths(g, 1, [1, 4])) == Set([[1, 2, 3, 4]]) Suggested behavior: g = path_graph(4)
@test Set(all_simple_paths(g, 1, 1)) == Set([[1]])
@test Set(all_simple_paths(g, 1, [1, 4])) == Set([[1], [1, 2, 3, 4]]) Although, honestly, the suggested behavior is not so natural to implement in the current iterator scheme, so I'd be happy to keep as-is also. |
I've gone ahead an implemented the proposed |
I agree with your suggestion that paths from |
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'm now reasonably confident that the implementation is correct! A few minor tweaks and I can merge
Co-authored-by: Guillaume Dalle <[email protected]>
Co-authored-by: Guillaume Dalle <[email protected]>
Co-authored-by: Guillaume Dalle <[email protected]>
Co-authored-by: Guillaume Dalle <[email protected]>
Thanks for the second review. I've updated everything accordingly, with the exception of any action on your |
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.
thank you for the contribution!
Sorry I only see this now that the work is done. Anyway thank you! |
Cc @mwien Graphs.jl has now path enumeration |
This refreshes #20 by @etiennedeg.
(I couldn't figure out how to do it there directly and also didn't want to bother with fixing merge conflicts either)
The original implementation is by @i-aki-y in sbromberger/LightGraphs.jl#1540.
This "refresh" also simplifies the original implementation a bit (to the extent that I understand it), implements the comments/suggestions that were made in #20 (e.g.,
cutoff
is now set tonv(g)
), and improves the documentation (and removes superfluous documentation of internal methods), and removes redundant methods (e.g., thelength
andcollect
implementations; the latter comes from Base, and the former is a performance trap).Cc. @gdalle cf. Slack conversation about this (and him pointing out the existence of #20).
I suspect there will be some issue from Formatter.jl: but there's no clue as to what's wrong when I run it locally, just that something is wrong.