-
Notifications
You must be signed in to change notification settings - Fork 15
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
Improve simplification of networks #120
Comments
I've come to look at this issue. After inspection, I find that the described issue is indeed present, i.e., we do indeed need to perform the described steps to simplify a network properly. Im unsure what the performance impact of this convolution is though. Towards the proposed solutions: I don't think we can use Possible solutions I see are: Reimplementing the |
Preamble: In our last meeting, we discussed, that any form of performing simplification on the edge list directly involves us reimplementing So I have been searching the docs for a function to merge networks natively. My code ( ## merge the simplified networks
network = igraph::disjoint_union(networks)
vertex.count = igraph::vcount(networks[[1]])
network = igraph::contract(network,
rep(1:vertex.count, length(networks)),
vertex.attr.comb = "first") |
I have tested the code for merging networks suggested by @MaLoefUDS on three different projects. Then, I checked the performance. I've chosen a rather naive approach having only 0 or 1 repetitions – consequently, my measurements are not really reliable. In particular, I did not measure how long the actual merging step takes, but I measured the time of executing the complete
So, the performance improvement seems to be marginal or even non-existent. For smaller projects, we have observed an improvement of around 2 seconds, but for the largest project in my test set, the performance has slightly worsened. @MaLoefUDS @hechtlC: Do you think it is worth to repeat with more projects (even larger projects) and more repetitions, to find out whether there is a real performance improvement on average, or should we just stop the experiment here as the result of my naive approach are not really promising? And another issue I've spotted: The new code produces the following warning:
As we actually want to reduce the number of warnings and not increase it, I dislike this warning... So, in general, I am not sure if should continue here or just stop because there is not really an observable improvement... What are your thoughts? |
The preliminary differences show no clear pattern, so I guess we can say that |
As we cannot see any promising performance improvement from our preliminary performance checks, there is agreement that we don't follow up on the idea of replacing the implementation of As there were no other promising ideas on how to significantly improve the simplification of networks, I'll close this issue. |
Description
Currently, the code in the function
simplify.network()
is quite complex: To preserve an edge for each existing relation, we need to obtain the complete edge list, split it, construct networks from the separate different edge lists again, simplify these, and merge the separate networks in the end (by obtaining their edge lists...).We need to find a way to apply the
EDGE.ATTR.HANDLING
on the raw edge lists (i.e., data.frames). Maybe, using the existing list when constructing an appropriatesqldf
statement is a worth a try. Also, trying to use"unique"
as a value in theEDGE.ATTR.HANDLING
list may solve the issue right away. 😉https://github.com/se-passau/codeface-extraction-r/blob/2241817620505a396846da1d2afa0264afafb55a/util-networks.R#L1192-L1233
https://github.com/se-passau/codeface-extraction-r/blob/2241817620505a396846da1d2afa0264afafb55a/util-networks.R#L44-L63
Versions
This affects the upcoming version
v3.2
as it contains the code of PR #115.The text was updated successfully, but these errors were encountered: