Skip to content

spring_layout does not use the correct Fruchterman-Reingold aglorithm #81

Open
@simonschoelly

Description

@simonschoelly

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions