JuliaGraphs / JuliaGraphs/GraphPlot.jl

spring_layout does not use the correct Fruchterman-Reingold aglorithm

Open
#81 2 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

hacktoberfest
Dominant language
Julia
Stars
213
Forks
62
PR merge metrics
No merged PRs in 30d

Description

The documentation for spring_layoutsays, that the algorithm uses the the forces

Attractive force:  f_a(d) =  d^2 / k
Repulsive force:  f_r(d) = -k^2 / d

but what it actually does, is using

Attractive force:  f_a(d) =  d / k
Repulsive force:  f_r(d) = -k^2 / d^2

where d is the distance between two vertices and k is some constant. That also works, so I'm wondering, if we want to keep using this modified version or use the original version by Fruchterman and Reingold.
Networkx uses the same modified version, so either this is done on purpose or the error was copied when implementing it in Julia.

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

Start with the spring_layout implementation and its documentation, then compare the documented Fruchterman-Reingold formulas with the formulas actually used. Determine whether the modified forces are intentional or should match the original algorithm; done means the implementation and documentation agree, with behavior checked against the chosen formulas.

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.