Skip to content

Fix same-edge solution rejected by min_distance floor#24

Merged
bnaul merged 3 commits into
mainfrom
fix-same-edge
Mar 4, 2026
Merged

Fix same-edge solution rejected by min_distance floor#24
bnaul merged 3 commits into
mainfrom
fix-same-edge

Conversation

@bnaul

@bnaul bnaul commented Mar 4, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Relax the min_distance floor (10m default) for same-edge solutions where both LRPs have excellent spatial matches (<5m from the edge)
  • DNP quantization in OpenLR can significantly overestimate short distances, and when both candidates project very close to the same edge, the spatial evidence is strong enough to trust even with large length mismatches
  • Adds a regression test verifying the fix

HERE Quality Benchmark (48K codes, KC metro)

Codes compared: 47931

Geometric quality (44765 codes decoded in both):
  Hausdorff p50: 2.7m → 2.6m
  Hausdorff p90: 22.2m → 14.5m
  Fréchet p50:   5.2m → 4.8m
  Fréchet p90:   39.7m → 33.4m

  Winners (Hausdorff improved by >5m): 1548
  Losers  (Hausdorff worsened by >5m): 0

  Quality bucket transitions:
    bad → good: 192
    ok → good:  579

No regressions. 1,548 codes improved, 771 moved to "good" quality bucket.

Test plan

  • cargo test passes including new test_same_edge_short_path_relaxed_min_distance
  • Verify specific improved codes in visualization app

🤖 Generated with Claude Code

bnaul and others added 3 commits March 4, 2026 15:33
When both LRPs project within 5m of the same edge (excellent spatial match),
relax the minimum path length to 0m in addition to the existing relaxed
maximum. The 10m min_distance floor was rejecting correct same-edge solutions
where the actual path cost was shorter than 10m (e.g., 4.6m on a 261m curved
ramp). DNP quantization can significantly overestimate short distances, and
close spatial match provides strong enough evidence to trust the result.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@bnaul bnaul merged commit e37fc5b into main Mar 4, 2026
4 checks passed
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