-
Notifications
You must be signed in to change notification settings - Fork 34
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
Attempt to order rectangles while minimizing crossing of flows #79
Comments
@Alex7722 thank you! As i mentioned by email, i'll come back to this when i have more bandwidth, but it would be fantastic to finally address this need in the package itself. I wonder if you could edit the issue into a formal reproducible example and include the generation of the plot you shared by email? Reproducible examples can be relatively easily prepared using the reprex package, and this vignette offers some guidance. (Since the data set is large, it's OK with me if you include a |
Note: This would address #6. |
I may not come back to this for another month or two, but i've come across two more points of reference: This IEEE paper formalizes the optimization problem, and the CRAN Task View on Optimization lists several packages that might be used to implement it. |
Hi @corybrunson, do you have an update on this by chance? I saw that you posted an article on this a couple weeks ago, but I wasn't able to reproduce the behavior in that article with the development version or the |
Hi @ajwilk, sorry, i haven't gotten started on this. The vignette you linked to has actually been around for a while and does not contain any optimization of this kind. Once something is implemented, though, i'll definitely include an example of it in the vignette! (Note: If the method from this issue is used for optimization, then the |
My and a coauthor just released a beta version of our package for dynamic network analysis. We cleaned up the function to minimize the crossing of flows in a way that is very flexible with some examples: https://github.com/agoutsmedt/networkflow/blob/master/R/minimize_crossing_alluvial.R It seems to work well even for complex alluvials, however, right now it is for a particular kind of alluvial. An example: |
@Alex7722 nifty! Could you provide a side-by-side comparison of plots prepared using versus not using your function? That would provide solid justification for me to make {networkflow} an optional dependency for the next release. (Smaller examples would be included in documentation, but a large example might be suitable for a vignette.) |
It is great to be able to describe the cases for which the technique works best. Do you mind my adapting the larger example into a vignette? Would you prefer to? And when do you expect networkflow to be on CRAN? (I don't think it can be included as a dependency until then.) |
We should be on CRAN in the coming months, but no specific timeline yet. However the big drawback of our function is that it's also dependent on quite a few packages, and most notably the latest development version of data.table(). Also, the function parameters are really suited for our package as it is really a middle-step function in a larger workflow for network analysis and its name doesn't make a lot of sense. Finally, the alluvial needs to (1) be structured as a long format and (2) be a data.table. I made a minimal example by changing the student data with a bad-case scenario where "Sculpure" (btw a small typo there) go into "Digital Art" :
Its even possible to play with the Iode.guidance (backfront) to get results close to optimum, but it would be better if a function also ordered the alluvium in an optimal way inside the stratums. |
Ah, that's an interesting caveat. For comparison, {ggalluvial} doesn't |
I will let you know once we are on CRAN. |
A first attempt to order rectangles while minimizing crossing of flows:
Data used to build the function can be found here
The text was updated successfully, but these errors were encountered: