Closed thchr closed 3 months ago
Attention: Patch coverage is 95.16129%
with 3 lines
in your changes are missing coverage. Please review.
Project coverage is 97.28%. Comparing base (
e773bce
) to head (1c9a813
). Report is 5 commits behind head on master.
Files | Patch % | Lines |
---|---|---|
src/traversals/all_simple_paths.jl | 95.16% | 3 Missing :warning: |
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
documentation seems to be failing
documentation seems to be failing
Should be fixed now, thanks.
There is one API question we should settle: what should the set of all paths from u
to v = u
be? I.e., what happens when the start and end point are identical? To my mind, it should return [[u]]
which is a path of zero length. Currently, however, it returns no paths, i.e., [Int[]]
.
I propose we change it to return [[u]]
in this case.
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 u = v
special-casing, adding corresponding tests also.
I agree with your suggestion that paths from u
to u
should be [u]
and not []
.
This is also more coherent with the way lengths are measured in the algorithm: a path [u]
has length 0
Thanks for the second review. I've updated everything accordingly, with the exception of any action on your _stepback!
question: I simply don't know (and admit that I do not have time or motivation to find out at the moment; I just want something that works and doesn't stall again).
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 https://github.com/sbromberger/LightGraphs.jl/pull/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.