JuliaGraphs / NetworkLayout.jl

Layout algorithms for graphs and trees in pure Julia.
Other
96 stars 22 forks source link

Feat request: integrate `by_axis_local_stress_graph` network layout from GraphRecipes #39

Closed mroavi closed 3 years ago

mroavi commented 3 years ago

This is the default network layout used in GraphRecipies. It would be really nice to have this integrated into NetwrokLayout.jl so that it can be used with GraphMakie.jl. It is the network layout that works best for the type of graphs I'm using.

Source reference of this network layout: "section 2.3 from http://link.springer.com/chapter/10.1007%2F978-3-540-31843-9_25#page-1".

See original issue: https://github.com/JuliaPlots/GraphMakie.jl/issues/31

hexaeder commented 3 years ago

Hm.... both layouts reference the same paper. For some graphs (i.e. complete_graph(10)) the results look kinda the same. The implementation is very different though... For any tree-like graph the results of GraphRecipes are so much better

hexaeder commented 3 years ago

The "ideal distance" d_ij in NetworkLayout is just the adj matrix (i.e. 1 for every connected pair, 0 else). This seems to be wrong. It should be something like the shortes path between two nodes. Thats what GraphRecipes does. It makes sense that the layout looks only good for complete graphs now (where the adj matrix is the minimum pairwise distance between all nodes). The implementation differences come down to the two solution strategies: equation solvers (2.1 in the paper) and local optimization (2.3).