-
Notifications
You must be signed in to change notification settings - Fork 183
discussion: API changes #665
Comments
This came out of a discussion at JuliaCon about what if any difference there is between Since we have never supported Multigraphs, this semantic debate was never an issue. Almost none of our algorithms would correctly handle multigraphs if we just dropped them in without modifying the algorithms. Does anyone have strong opinions about these names? /bikeshed. I agree that we should have different names for these concepts. A quick google search shows that "Forward Adjacencies" has been used in RFC4655.
And in this comment in BGL's implementation of Parallel Brandes' Algorithm:
I think that neighbors is the more fundamental concept and the set of outgoing edges in a multigraph is the secondary concept with a representation that depends on the implementation details of the multigraph. |
So actually, I just took a look at the code, and I realize that I misspoke yesterday. So I'll check off that first idea as "already done" - there is no need for every graph type to support I would still appreciate some discussion on the remaining issues. |
First, a propos #642, what exactly is distinction between the API and core? I assume by API you mean "if you make a custom graph Type, it must offer those functions". Does that imply that in moving into the (If I follow that right, then) I think those basic modifications are so core to network analysis they belong in the API. I suppose one can measure descriptives without them, but things like clique percolation, robustness measures, and things like Louvain algorithm all require graph modifications. Never mind just building up graphs piecemeal. |
Yeah the idea is that the interface is the minimal amount of functionality your type must provide in order to get the rest of the library functions to work on your type. There can be additional functions that you have to get in order to achieve optimal performance, but we don't really have a concrete plan for that yet. |
To elaborate a bit further, this is how I think about it as a three-tiered system: API - stuff that must be implemented in order for basic functionality tests to pass - these functions are the building blocks for everything else. These include accessors for the graph structures. Core - functions that should be implemented (and/or optimized) in order to enable more complex features. Things like Everything else - functions that use core or API to do some other stuff, and that don't necessarily serve as building blocks themselves. Examples would be the centrality measures, and a counter-example to the latter criterion would be |
Yes the Core functionality should be stuff that is defined in terms of the API but might need to be reimplemented by a type to improve performance. and the Everything else should all be completely oblivious to the fact that there are multiple types of graphs underneath. So things like |
I agree with this (and realize it's a change from my original position of having this in |
@sbromberger that's a very helpful summary, thanks. The README.md has a single category called "Core API" so I was getting a little confused. In that case, my inclination is to still have the constructors/modifiers as API, but I understand if they get shifted to core. |
The key for me is this: if we make it part of the API, then we're saying that every single graph type must implement this function. This includes immutable graphs and ones that might be backended by an external datastore. Immutable graphs can't / won't have any modifiers by definition, which is why I think these belong in core. You're 100% right about the README being ambiguous. We need to fix that. |
Yup makes sense. Hadn't thought about immutable graphs (especially backed
by a database or something) as a thing someone would want to implement.
…On Tue, Jul 11, 2017 at 7:58 PM Seth Bromberger ***@***.***> wrote:
The key for me is this: if we make it part of the API, then we're saying
that *every single graph type* must implement this function. This
includes immutable graphs and ones that might be backended by an external
datastore. Immutable graphs can't / won't have any modifiers by definition,
which is why I think these belong in core.
You're 100% right about the README being ambiguous. We need to fix that.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#665 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AJPC7TBeLUfjXaUeodEPjkVERZVlA7v1ks5sNCg2gaJpZM4ODumG>
.
|
Coming back to this. I don't think I like I think I'd prefer renaming @jpfairbanks - thoughts? |
I would prefer |
Here's my latest idea (hat tip @ararslan):
similarly,
@jpfairbanks - thoughts? (see also JuliaLang/julia#25715) |
I like it! |
other possibility is using empty
This would come to the same design as maximum_flow which takes a |
Yes. The history behind using On the flip side: where we're using empty structs, we should evaluate whether |
This bothers me, because it's redundant, and we'd need to have |
This is a problem for all functions that currently take a neighborfunction those functions currently would require you to make an anonymous function. Or "lift" the :in/:out vals up to their argument lists. |
This is a key point. We do this throughout the code for the degree functions. Alright, I think we're back to just renaming them |
Yeah, and thinking for metagraphs you might have |
I pulled 0.13.0 because I'd really like to get this in first. |
Proposal:
fadj
/badj
withoutneighbors
/inneighbors
(ref consensus in change (in|out)degree to (in|out)_degree #823)out_neighbors
andin_neighbors
add_edge!
,rem_edge!
,add_vertex!
,rem_vertex!
, andadd_vertices!
from API (put them in core)This would simplify the API to the following functions:
nv
ne
vertices
edges
is_directed
has_vertex
has_edge
in_neighbors
out_neighbors
zero
All changes would move through deprecation for at least one minor version.
cc @jpfairbanks @juliohm
The text was updated successfully, but these errors were encountered: