Skip to main content

Module fdeb

Module fdeb 

Source
Expand description

Force-Directed Edge Bundling (FDEB) — the answer to the hairball curse (#2).

Straight edges in a dense directed graph smear into an unreadable hairball. FDEB (Holten & van Wijk, 2009) turns each edge into a flexible wire subdivided into control points, then lets compatible edges — ones travelling the same way, at a similar scale and close together — attract each other’s control points. Edges going the same direction collapse into shared “information highways” that split again near their endpoints, so the eye follows trunks instead of spaghetti.

§Reused force pipeline

The bundling force is the same boids/n-body shape as [facett_core::render::gpu::particles] and crate::gpu_layout: a per-point electrostatic attraction toward the matching control points of compatible edges (cohesion) balanced by a spring holding each wire’s own points evenly spaced (the rubberband). It is a pure, deterministic function of the input positions + params (FC-7): fixed iteration order, no RNG.

§What lands here vs the roadmap

This is the CPU reference FDEB: compatibility (angle · scale · position) is precomputed once, then a fixed-subdivision force loop bundles the wires. The cycle-refinement schedule (double the subdivisions each cycle) and the GPU port (the control points are particles; compatibility is the neighbour kernel — it drops straight onto the particles.wgsl storage-ping-pong) are documented in .nornir/elite-graph-engine.md. The output is bundled polylines a host paints as glowing splines.

Structs§

BundleParams
FDEB tuning. Default bundles moderately on a unit-ish coordinate scale.
BundledEdge
One bundled edge: its endpoints + the subdivided control polyline (endpoints included, so path.len() == subdivisions + 2). Feed path to a spline painter.

Functions§

bundle
Bundle the edges (index pairs into nodes) with FDEB. Returns one BundledEdge per input edge whose path is the bundled control polyline. Deterministic in (nodes, edges, p). Self-loops / out-of-range edges become a straight degenerate path (left unbundled).
occupancy
Occlusion / ink-coverage metric: how many distinct cells of a cell-sized grid the edge polylines touch (sampled densely along each path). Bundling concentrates edges onto shared trunks → fewer distinct cells → less occlusion. Read as DATA: a drop vs the straight baseline proves the bundle de-hairballs the view.
straight
The straight-edge baseline polylines (same subdivision count, no bundling) — the control comparison for the occlusion metric.
total_length
Total polyline length over all edges (bundling bows wires, so this is a secondary diagnostic — the primary win is the occupancy drop).

Type Aliases§

P2
A 2D point.