This repository was archived by the owner on Jun 18, 2026. It is now read-only.
Commit 429b56a
committed
feat: Interactive Graph Partitioning Visualizer with Kernighan-Lin algorithm
Add docs/partitioning.html — an interactive balanced graph bisection tool:
- Canvas-based visualization with draggable nodes colored by partition (blue/orange)
- Kernighan-Lin (KL) algorithm with step-by-step animation and speed control
- Random bisection baseline for comparison
- Click nodes to manually swap between partitions
- 8 preset graphs: Petersen, Grid 4x4, Complete K8, Barbell, Hypercube Q4, Wheel W12, Random 15, Mesh 5x5
- Text input/export for custom adjacency lists
- Real-time metrics: cut size, balance ratio, KL pass count
- Algorithm comparison table (Random vs KL)
- Proactive insights: cut quality rating, balance assessment, convergence info
- Cut edges shown as dashed red lines, internal edges as solid gray
Usage: Open docs/partitioning.html in a browser, pick a preset or enter a graph, then run KL to minimize the edge cut.1 parent 5672e17 commit 429b56a
2 files changed
Lines changed: 702 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
50 | 50 | | |
51 | 51 | | |
52 | 52 | | |
| 53 | + | |
53 | 54 | | |
54 | 55 | | |
55 | 56 | | |
| |||
165 | 166 | | |
166 | 167 | | |
167 | 168 | | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
168 | 174 | | |
169 | 175 | | |
170 | 176 | | |
| |||
0 commit comments