A playground to explore, develop, and benchmark algorithms that resolve overlapping nodes in the browser. Although the primary use cases are React Flow & Svelte Flow, the implementations aim to be use‑case agnostic.
Each algorithm implements the same CollisionAlgorithm interface (nodes in, nodes out) but uses different strategies for collision detection.
[!IMPORTANT]
Every benchmark is incomplete and flawed. Always expect mistakes, either in the implementation, the test environment, or in the method of measurement.
There are outstanding optimizations to be done to better leverage spatial indexes and further reduce overhead. Check out the issues tab if you are interested.
Nodes are positioned in a dense grid with maximum overlap. This scenario stresses algorithms with many collision pairs.
Nodes are spaced apart with no overlaps. This tests the best-case scenario where algorithms can early-exit without collision resolution.
Nodes form several clusters with overlaps within each cluster. This represents a realistic use case with localized collision groups.
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
# macOS
brew install binaryen
# Debian/Ubuntu
sudo apt install binaryen
# Arch Linux
sudo pacman -S binaryen
Node.js (v22 or higher)
pnpm
npm install -g pnpm
git clone https://github.com/xyflow/node-collision-algorithms.git
cd node-collision-algorithms
pnpm install
pnpm run build:wasm
pnpm run dev
The application will be available at http://localhost:5173