Skip to content

Fix zero-cost edges in the TSP example#229

Merged
zayenz merged 1 commit into
mainfrom
feature/fix-tsp-zero-cost-edges
Jul 14, 2026
Merged

Fix zero-cost edges in the TSP example#229
zayenz merged 1 commit into
mainfrom
feature/fix-tsp-zero-cost-edges

Conversation

@zayenz

@zayenz zayenz commented Jul 13, 2026

Copy link
Copy Markdown
Member

The br17 example reports 87 instead of the published optimum of 39 because it treats every zero in the distance matrix as a missing edge. br17 contains valid off-diagonal zero-cost edges.

Remove that extra filtering and let circuit enforce the tour. The example then reaches 39; the two smaller instances retain costs 2276 and 22.

Checks:

  • configured a Release Ninja build and built the tsp target;
  • ran instances 0, 1, and 2 to optimality, obtaining 2276, 22, and 39;
  • audited all bundled matrices: only br17 contains off-diagonal zero-cost edges; and
  • ran git diff --check.

Closes #151.

@zayenz zayenz marked this pull request as ready for review July 14, 2026 06:16
@zayenz zayenz force-pushed the feature/fix-tsp-zero-cost-edges branch 2 times, most recently from 03d2e54 to 21a7535 Compare July 14, 2026 06:21
@zayenz zayenz merged commit cc4c6d1 into main Jul 14, 2026
14 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