#graph #graph-algorithms #force #spatialization

nightly forceatlas2

fast force-directed generic n-dimension graph layout

12 releases (6 breaking)

0.7.0 May 2, 2024
0.6.1 Mar 22, 2024
0.5.0 Jun 23, 2023
0.4.1 Apr 30, 2023
0.1.0 Apr 3, 2021

#41 in Visualization

Download history 3/week @ 2024-02-16 28/week @ 2024-02-23 7/week @ 2024-03-01 1/week @ 2024-03-08 123/week @ 2024-03-15 158/week @ 2024-03-22 72/week @ 2024-03-29 15/week @ 2024-04-05 87/week @ 2024-04-26 44/week @ 2024-05-03

131 downloads per month

AGPL-3.0-only

105KB
1.5K SLoC

ForceAtlas2 Rust

Implementation of ForceAtlas2 – force-directed Continuous Graph Layout Algorithm for Handy Network Visualization (i.e. position the nodes of a n-dimension graph for drawing it more human-readably)

Example graph spacialized with ForceAtlas2-rs

Examples

Install Rustup and switch to nightly:

rustup toolchain install nightly && rustup default nightly

Clone repository:

git clone https://framagit.org/ZettaScript/forceatlas2-rs && cd forceatlas2-rs

The file examples/wot.csv lists the edges of a directed graph, in two columns.

GTK viewer

Interactive viewer. You need GTK installed.

cargo run --release -p viz -- examples/wot.csv

Bindings

There is a binding for use in Python, fa2rs.

Improvements

Previous versions of this crate were using hand-written AVX2 code to speed up repulsion by 16. It was however still O(N^2). Now the only implementation of repulsion uses the Barnes-Hut algorithm (quadtree/octree, O(NlogN)), which makes any kind of parallelization harder (SIMD, multithreading, GPU). Some research papers describe ways to parallelize quadtree building or even to implement it using SIMD or GPU.

License

Support me via LiberaPay

GNU AGPL v3, CopyLeft 2020-2024 Pascal Engélibert (why copyleft?)

Implementation details inspired by:

The ForceAtlas2 paper was released under CC BY, Copyright 2014 Jacomy et al.

This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, version 3 of the License.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License along with this program. If not, see https://www.gnu.org/licenses/.

Dependencies

~2–7.5MB
~46K SLoC