|
1 | 1 | # CH Router Visualization |
2 | 2 |
|
3 | | -Interactive D3.js visualization of the Contraction Hierarchies (CH) routing algorithm vs Dijkstra on the Berlin road network. |
| 3 | +Interactive Leaflet.js and canvas visualization of the Contraction Hierarchies (CH) routing algorithm vs Dijkstra on the Berlin road network. |
4 | 4 |
|
5 | 5 | Created by Steffen Axer ([iteratively.io](https://iteratively.io)) to demonstrate CH routing efficiency for LinkedIn. |
6 | 6 |
|
@@ -48,35 +48,36 @@ Most browsers block `fetch()` from `file://` URLs. Use a local server as above, |
48 | 48 |
|
49 | 49 | ## Visualization Features |
50 | 50 |
|
51 | | -- **Split-screen** Dijkstra vs CH comparison (synchronized animation) |
| 51 | +- **Split-screen** Dijkstra vs CH comparison (synchronized pan/zoom via Leaflet maps) |
| 52 | +- **OSM tile background** — dark-themed OpenStreetMap tiles with WGS84 coordinates |
52 | 53 | - **Play / Pause / Step** controls with speed slider (1×–50× events per frame) |
53 | | -- **Progress bar** with click-to-seek |
54 | | -- **2.5D mode** — nodes lifted by their CH contraction level, showing the hierarchy |
| 54 | +- **Step slider** — drag to seek forward/backward through events; forward (▸) and backward (◂) step buttons |
| 55 | +- **2.5D mode** — CSS perspective tilt + nodes lifted by CH level, showing the hierarchy |
55 | 56 | - **Meeting point** golden glow when the bidirectional CH search converges |
56 | 57 | - **Stall-on-demand** visualization (gray flash for pruned nodes) |
57 | 58 | - **Final overlay** showing search space savings (e.g. "97% less search space") |
58 | 59 | - **Cinema mode** — hides controls, auto-plays for screen recording |
59 | 60 | - **Video export** — native `canvas.captureStream(60fps)` + `MediaRecorder` → downloads `ch-router-berlin.webm` |
60 | | -- **4 pre-computed OD pairs** selectable via dropdown |
| 61 | +- **4 pre-computed OD pairs** selectable via dropdown (long cross-city routes) |
61 | 62 |
|
62 | 63 | ## Color Scheme |
63 | 64 |
|
64 | 65 | | Element | Color | |
65 | 66 | |---|---| |
66 | | -| Background | `#0d1117` | |
67 | | -| Network edges | `#1e2937` | |
68 | | -| CH forward search | `#58a6ff` (blue) | |
69 | | -| CH backward search | `#f78166` (orange) | |
70 | | -| Dijkstra settled | `#da3633` (red) | |
71 | | -| Final path | `#3fb950` (green) | |
72 | | -| Meeting point | `#d29922` (gold) | |
73 | | -| Stalled nodes | `#8b949e` (gray) | |
| 67 | +| Background | `#0c0e14` | |
| 68 | +| Network edges | `rgba(255,255,255,0.09)` | |
| 69 | +| CH forward search | `#38bdf8` (sky blue) | |
| 70 | +| CH backward search | `#f472b6` (pink) | |
| 71 | +| Dijkstra settled | `#ef4444` (red) | |
| 72 | +| Final path | `#34d399` (emerald) | |
| 73 | +| Meeting point | `#fbbf24` (amber) | |
| 74 | +| Stalled nodes | `#64748b` (slate) | |
74 | 75 |
|
75 | 76 | ## OD Pairs |
76 | 77 |
|
77 | 78 | | Route | ~Dijkstra settled | ~CH settled | Savings | |
78 | 79 | |---|---|---|---| |
79 | | -| Kreuzberg → Charlottenburg | ~3,000–5,000 | ~80–150 | ~97% | |
80 | | -| Mitte → Neukölln | ~2,000–3,000 | ~60–120 | ~96% | |
81 | | -| Spandau → Lichtenberg | ~6,000–8,000 | ~150–250 | ~97% | |
82 | | -| Prenzlauer Berg → Tempelhof | ~3,000–5,000 | ~100–180 | ~96% | |
| 80 | +| Spandau → Marzahn (West-East) | ~8,000–12,000 | ~200–350 | ~97% | |
| 81 | +| Frohnau → Lichtenrade (North-South) | ~8,000–12,000 | ~200–350 | ~97% | |
| 82 | +| Wannsee → Karow (SW-NE Diagonal) | ~10,000–15,000 | ~250–400 | ~97% | |
| 83 | +| Tegel → Adlershof (NW-SE Diagonal) | ~8,000–12,000 | ~200–350 | ~97% | |
0 commit comments