JuliaGraphs / JuliaGraphs/NetworkLayout.jl

Layouts of graphs with multiple components

Open
#80 1 comment 0 reactions 0 assignees View on GitHub

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:

  1. The two graphs are seemingly unnecessarily far apart.
  2. 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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.