-
Notifications
You must be signed in to change notification settings - Fork 304
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
Separate edge weights from graph objects and update primitives to support general edge properties. #2843
Separate edge weights from graph objects and update primitives to support general edge properties. #2843
Conversation
…ove_graph_functions
…going_e and transform_reduce_e
…ge weight objects
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 like how this simplifies much of the code - especially when we don't operate on weights.
Looks good. There are several PRs in the pipeline that will merge before this that will require updates based on the changes here, but it should be relatively manageable.
rerun tests |
rerun tests |
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## branch-22.12 #2843 +/- ##
===============================================
Coverage ? 60.10%
===============================================
Files ? 123
Lines ? 7277
Branches ? 0
===============================================
Hits ? 4374
Misses ? 2903
Partials ? 0 Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
@gpucibot merge |
This PR separates edge weights from
graph_t
andgraph_view_t
. Now edge weights are stored inedge_property_t
like any other edge properties (e.g. edge IDs & types).Two major benefits are
This PR changes many files (due to the changes in the
graph_t
andgraph_view_t
classes) but most changes are repetitive.To highlight major changes,
create_graph_from_edgelist
will returninstead of
i.e. edge weights will be returned in a separate object.
Algorithms working on weighted graphs (or both unweighted & weighted graphs) will take the additional input argument:
edge_property_view_t<edge_t, weight_t const*>
orstd::optional<edge_property_view_t<edge_t, weight_t const*>>
Primitives
e_op
's input parameters were previously(vertex_t src, vertex_t dst, weight_t w, source_property, destination_property)
or(vertex_t src, vertex_t dst, source_property, destination_property)
.Now it will be
(vertex_t src, vertex_t dst, source_property, destination property, edge property)
Primitives with
e_op
will take an additionaledge_property_view_t
type input parameter (which can be edge_dummy_property_t{}.view() if no edge properties are used).Edge weights are added in the C++ side (before type erasing) of the C API
cugraph_graph_t
.This doesn't require any changes in the C side of the C API, so I assume this won't disrupt the pylibcugraph and python layers (once cython.cu file is removed).