Skip to content

Phase 6: MINGLE multilevel agglomerative edge bundling - #24

Merged
schochastics merged 1 commit into
mainfrom
phase-6-mingle
Jul 23, 2026
Merged

schochastics merged 1 commit into
mainfrom
phase-6-mingle

Conversation

@schochastics

Copy link
Copy Markdown
Owner

Seventh phase (see _docs/REFACTORING-PLAN.md). Adds the scalability-oriented bundler none of the existing four cover.

What

  • src/mingle.cpp (mingle_iter) + new export edge_bundle_mingle(object, xy, segments = 50, bundle_strength = 0.9).
  • Gansner, Hu, North & Scheidegger (2011): edges are grouped bottom-up; two bundles merge when routing them through shared geometric-median meeting points reduces total ink. Greedy ink-reducing matching per level until no improvement; the merge tree is rendered as a per-edge control polyline through its chain of meeting points, relaxed toward the straight line by bundle_strength.

Deviation from the plan (dependency)

kNN over edges is brute force (O(E²)), so no new dependency was added. This trades the paper's O(E log E) scalability for zero deps and full correctness at interactive sizes; a kd-tree can be swapped in later. Documented in the roxygen + plan.

Tests

Contract (x,y,index,group, 50 pts/edge), endpoints fixed, parallel edges bundle (mid-spread 5 → ~0.5), bundle_strength = 0 → straight, single edge stays straight. FAIL 0 | PASS 82.

Note

Not visually validated this session.

🤖 Generated with Claude Code

Add src/mingle.cpp (mingle_iter) and the exported edge_bundle_mingle().
Edges are grouped bottom-up: two bundles merge when routing them through
shared geometric-median meeting points reduces total ink; the merge tree
is rendered as a per-edge control polyline through its chain of meeting
points, relaxed toward the straight line by bundle_strength.

kNN over edges is brute force (O(E^2)) so no new dependency is required;
a kd-tree can be substituted later for very large graphs.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@schochastics
schochastics merged commit 9a449de into main Jul 23, 2026
@schochastics
schochastics deleted the phase-6-mingle branch July 23, 2026 20:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant