JuliaGraphs / JuliaGraphs/NetworkLayout.jl

Feature request: layouts for weighted graphs

Open
#63 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

If one has a weighted graph, would it make sense for the layout algorithm to account for the weights?

This is done in, for instance, the R package qgraph.

Perhaps I'm viewing this too simplistically, but I think that all that needs to be done is multiply by the weights at some point. For example, in the Spring layout, there is now

https://github.com/JuliaGraphs/NetworkLayout.jl/blob/6574223d3c915c82695761a7c1318779f498f155/src/spring.jl#L95-L102

where, if I understand the code correctly, this line F_d = d / K - K^2 / d^2 could be changed to account for the weight of the edge. One option is to simply weigh the attraction by the (normalized) edge strength, which is I think what qgraph does (see https://github.com/cran/qgraph/blob/57d588ee05a554f9d1078914e05ce03662c610b2/src/layout_rcpp.cpp#L111).

Any thoughts? I'd be happy to open a draft PR for a single layout (e.g., spring).

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

Read src/spring.jl around lines 95–102 and compare the linked qgraph implementation to understand how normalized edge weights might affect spring attraction. The requested scope is a weighted spring layout, but the design and validation criteria remain open, so confirm those before implementing.

Written by the indexing model from the issue text.

Assessment

Tech stack
julia
Domain
data-visualization
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
32/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.