-
-
Notifications
You must be signed in to change notification settings - Fork 392
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 cutoff versions of shortest path functions #2362
base: master
Are you sure you want to change the base?
Conversation
Codecov Report
@@ Coverage Diff @@
## master #2362 +/- ##
==========================================
+ Coverage 83.50% 83.54% +0.03%
==========================================
Files 377 377
Lines 61909 61932 +23
==========================================
+ Hits 51700 51742 +42
+ Misses 10209 10190 -19
... and 4 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
|
is telling me I have a non-breaking space somewhere (https://en.wikipedia.org/wiki/Non-breaking_space), but I'm not sure how to find where this problem is. |
This is due to my change, I'll fix it in a moment. Somehow the failure happens only on the CI but not locally. |
Fixed on |
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.
Thanks! This is an initial review round, will take a more detailed look later.
igraph_vector_int_list_t *vertices, | ||
igraph_vector_int_list_t *edges, | ||
igraph_vector_int_t *nrgeo, | ||
igraph_integer_t from, const igraph_vs_t to, | ||
igraph_neimode_t mode) { | ||
igraph_neimode_t mode, igraph_integer_t cutoff) { |
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.
Can we make the cutoff be an igraph_real_t
even in the unweighted version, for clarity? This is the choice I made in igraph_distances()
, with the reasoning that passing 2.1
should include paths of length 2.0
. However, if the parameter is of integer type, then 2.1
is rounded to 2
, and will exclude paths of length 2
.
* \function igraph_get_all_shortest_paths | ||
* \brief All shortest paths (geodesics) from a vertex. | ||
* \function igraph_get_all_shortest_paths_cutoff | ||
* \brief All shortest paths (geodesics) from a vertex, with cutoff. |
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.
Let's add \experimental
for all new functions, even if changes are unlikely. We can remove that in 0.11. igraph_distances_cutoff()
is also marked as experimental.
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.
These docs say "added in 0.2", but that's for igraph_get_all_shortest_paths()
, not for igraph_get_all_shortest_paths_cutoff()
.
* \function igraph_get_all_shortest_paths | ||
* \brief All shortest paths (geodesics) from a vertex. | ||
* | ||
* \ref igraph_get_all_shortest_paths() without a cutoff. |
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.
Did you mean the following?
* \ref igraph_get_all_shortest_paths() without a cutoff. | |
* \ref igraph_get_all_shortest_paths_cutoff() without a cutoff. |
Can we keep the full original docs here please, especially since the new function will be "experimental"?
@@ -320,6 +320,31 @@ igraph_error_t igraph_shortest_paths_dijkstra(const igraph_t *graph, | |||
* \function igraph_get_shortest_paths_dijkstra | |||
* \brief Weighted shortest paths from a vertex. | |||
* | |||
* \ref igraph_get_shortest_paths_dijkstra() without a cutoff. |
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.
Same comment as above, please keep the original docs, and add a reference to the cutoff version.
/** | ||
* \ingroup structural | ||
* \function igraph_get_shortest_paths_dijkstra_cutoff | ||
* \brief Weighted shortest paths from a vertex with a cutoff. |
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.
Mark as experimental.
@@ -705,8 +735,8 @@ igraph_error_t igraph_get_shortest_path_dijkstra(const igraph_t *graph, | |||
|
|||
/** | |||
* \ingroup structural | |||
* \function igraph_get_all_shortest_paths_dijkstra | |||
* \brief All weighted shortest paths (geodesics) from a vertex. | |||
* \function igraph_get_all_shortest_paths_dijkstra_cutoff |
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.
Mark as experimental.
|
||
/** | ||
* \ingroup structural | ||
* \function igraph_get_all_shortest_paths_dijkstra |
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.
Keep original docs.
* \function igraph_get_shortest_paths | ||
* \brief Shortest paths from a vertex. | ||
* \function igraph_get_shortest_paths_cutoff | ||
* \brief Shortest paths from a vertex with a cutoff. |
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.
Mark as experimental.
igraph_vector_int_list_t *vertices, | ||
igraph_vector_int_list_t *edges, | ||
igraph_integer_t from, const igraph_vs_t to, | ||
igraph_neimode_t mode, | ||
igraph_vector_int_t *parents, | ||
igraph_vector_int_t *inbound_edges) { | ||
igraph_vector_int_t *inbound_edges, | ||
igraph_integer_t cutoff) { |
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.
Make it an igraph_real_t
.
/** | ||
* \ingroup structural | ||
* \function igraph_get_shortest_paths | ||
* \brief Shortest paths from a vertex. |
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.
Keep original docs.
fixes #2358