Skip to content
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 Optimal Sugiyama Layout #4

Merged
merged 27 commits into from
Sep 25, 2020
Merged

Add Optimal Sugiyama Layout #4

merged 27 commits into from
Sep 25, 2020

Conversation

oxinabox
Copy link
Owner

@oxinabox oxinabox commented Jul 21, 2020

I am actually working more off this paper
https://ialab.it.monash.edu/~dwyer/papers/optimal-sankey-diagrams.pdf

so perhaps it should be a ZarateLayout ?

TODO

  • Dummy Nodes
  • Permuting Order
  • Arranging
  • Weights for crossings
  • Do the perfomance constraint tweaks mentioned in the paper
  • Option to try multiple equally good orderings to see if any yeild better arrangement score.
  • Rewrite Arrangement subproblem from a QP into a SOCP and swap to ECOS
  • Vertically center the graph (right now the vertical position is basically arbitary, and thigns tend to be anywherre from 25-100, but really could be up in 10_000s or anywhere). Potentially this might cause stability issues (which centering in post would not fix)

Also supports weights for crossings so should be perfect for Sankey
(cc @daschw)

@daschw
Copy link

daschw commented Jul 22, 2020

Oooh, that looks amazing. Thanks for pinging!

@oxinabox
Copy link
Owner Author

sankey_3twos

@daschw for a Sankey diagram should the weights control the distance during arrangement, or just how hard to try for different overlapping line-crossings during ordering?

Currently it does both.
Which is why the 5 and 5 are lifted up in the diagram shown above.
The Tension from the 3->5 line is greater than that from the 3->6 line, so it pulls it up.

@oxinabox
Copy link
Owner Author

Oh wow my git settings are a total mess

@oxinabox
Copy link
Owner Author

oxinabox commented Aug 18, 2020

I added checking for multiple solutions. It doesn't find many that are better than but does find some that are better in the like 10^-7 order or something.
and lots that are worse (in the 10^0 order), which suggests either something special about the first, or just getting lucky.

@daschw
Copy link

daschw commented Aug 19, 2020

@daschw for a Sankey diagram should the weights control the distance during arrangement, or just how hard to try for different overlapping line-crossings during ordering?

Sorry, I missed this question. Looking at e.g. https://observablehq.com/@d3/sankey-diagram it does not seem like the weights impact the distance. It rather looks the maximum yaxis range is minimized.

@oxinabox
Copy link
Owner Author

Looking at e.g. https://observablehq.com/@d3/sankey-diagram it does not seem like the weights impact the distance. It rather looks the maximum yaxis range is minimized.

Cool, if we remove the weighting from that step then that is what we will have.
our notion of score for the distance step is the (currently weighted) sum of y-axis differences between connected vertexs. Which i think is what you are saying?

@oxinabox
Copy link
Owner Author

I think this basically done.
Its no where near as fast as the paper claims, but that could be the difference in solvers.
Probably will merge it soon.
Need to workout what is up with the CI first

@oxinabox
Copy link
Owner Author

with enhancements that are in the commit i am about to push was able to solve the large dep graph in 67 seconds
image

Probably the images are slightly different because there are multiple
equivelent solutions.
test/demos.jl Outdated Show resolved Hide resolved
test/demos.jl Outdated Show resolved Hide resolved
@oxinabox
Copy link
Owner Author

For some reason coveralls is failing to upload but tests are passing

@oxinabox oxinabox merged commit 98d34fc into main Sep 25, 2020
@oxinabox oxinabox deleted the ox/Sugiyama1 branch September 25, 2020 12:22
@daschw
Copy link

daschw commented Feb 23, 2021

I finally managed to continue work on this : https://github.com/daschw/SankeyPlots.jl

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants