This repository was archived by the owner on Jun 18, 2026. It is now read-only.
Commit 5672e17
committed
perf: O(1) neighbor index lookups in face-walk dart tracing
Pre-build HashMap<vertex, HashMap<neighbor, position>> from the planar
embedding before tracing faces. Replaces List.indexOf(curr) — an O(degree)
scan called once per dart (2E times total) — with O(1) HashMap.get(),
reducing enumerateFacesInternal from O(E × max_degree) to O(V + E).1 parent 4a79e21 commit 5672e17
1 file changed
Lines changed: 16 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
239 | 239 | | |
240 | 240 | | |
241 | 241 | | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
242 | 256 | | |
243 | 257 | | |
244 | 258 | | |
| |||
260 | 274 | | |
261 | 275 | | |
262 | 276 | | |
263 | | - | |
| 277 | + | |
264 | 278 | | |
265 | | - | |
| 279 | + | |
266 | 280 | | |
267 | 281 | | |
268 | 282 | | |
| |||
0 commit comments