JuliaGraphs / JuliaGraphs/NetworkLayout.jl
Layouts of graphs with multiple components
Nobody has claimed this yet.
- Dominant language
- Julia
- Stars
- 109
- Forks
- 25
- PR merge metrics
- No merged PRs in 30d
Description
Several of the layout algorithms produce not-very-useful layouts if the input graph is not connected, i.e., has more than one connected component.
For example:
using GLMakie, GraphMakie, Graphs
g = wheel_graph(4)
es = collect(edges(g))
g2 = Graph(vcat(es, [Edge(e.src + nv(g), e.dst + nv(g)) for e in es])) # make two unconnected copies of `g`
graphplot(g2; layout=Spring())
Produces:
Which has at least two issues:
- The two graphs are seemingly unnecessarily far apart.
- The layout of each individual component is worse than it would be for a single component (compare with
graphplot(g, layout=Spring())below):
From testing, Stress, Spectral, and especially SFDP have this issue. Stress probably also has the issue, but it is less pronounced. E.g., here's graphplot(g2; layout=SFDP()):
I think it would make sense to apply these layout algorithms on the connected components of a graph individually, and then somehow layout their components subsequently.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the disconnected two-copy example with GraphMakie and inspect the Stress, Spectral, and SFDP layout implementations. Determine how connected components are handled; done means each component retains a useful layout and the components are subsequently arranged without excessive separation.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- julia
- Domain
- data-visualization
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100