Skip to content

Correctly parse LOWER_ROW edge weight format - #135

Merged
leonlan merged 5 commits into
mainfrom
fix-tests
Apr 6, 2026
Merged

Correctly parse LOWER_ROW edge weight format#135
leonlan merged 5 commits into
mainfrom
fix-tests

Conversation

@leonlan

@leonlanleonlan commented Apr 5, 2026

Copy link
Copy Markdown
Member

Closes#134.

  • I incorrectly assumed LOWER_ROW matrices must be given in strict triangular form, but the values may be spread arbitrarily across lines as long as it matches the expected number of elements for a triangular matrix. Not strictly mentioned as TSPLIB95 specification in the Reinelt 1991 paper, but LKH3's parser also handles these cases.
  • In Bug in distance calculation from flattened matrix #40, the Eilon instance was incorrectly assumed to use a different format based on the paper, and a special case was added to handle it. This was wrong: CVRPLIB treats it as a row-wise, lower triangular matrix, which is now handled correctly without special casing.

@leonlanleonlan changed the title Remove eilon shortcutCorrectly parse LOWER_ROW edge weight typeApr 5, 2026
@leonlanleonlan changed the title Correctly parse LOWER_ROW edge weight typeCorrectly parse LOWER_ROW edge weight formatApr 5, 2026
Comment threadvrplib/parse/parse_distances.py Outdated
@codecov

codecovBot commented Apr 5, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (5d8a8ca) to head (7cb9794).
⚠️ Report is 10 commits behind head on main.

Additional details and impacted files
@@ Coverage Diff @@## main #135 +/- ##
=========================================
Coverage 100.00% 100.00% =========================================
Files 13 13 Lines 230 215 -15 =========================================
- Hits 230 215 -15 

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@leonlan
leonlan requested a review from N-WoudaApril 5, 2026 19:22

@N-WoudaN-Wouda left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@leonlan
leonlan merged commit f27d946 into mainApr 6, 2026
6 checks passed
Sign up for freeto 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.

Bug with LOWER_ROW edge weight

2 participants

@leonlan@N-Wouda